<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Using C# for game scripts, part 2</title><link>http://blogs.msdn.com/dowens/archive/2007/04/18/using-c-for-game-scripts-part-2.aspx</link><description>In my last post I showed you how to get scripts to be compiled dynamically at run-time. This makes things super easy, but I left you guys hanging on two fronts. I didn't show you how to compile multiple scripts into the same assembly. I totally spaced</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Using C# for game scripts, part 2</title><link>http://blogs.msdn.com/dowens/archive/2007/04/18/using-c-for-game-scripts-part-2.aspx#2184569</link><pubDate>Thu, 19 Apr 2007 05:19:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2184569</guid><dc:creator>Max Battcher</dc:creator><description>&lt;p&gt;Here's a quick tip for setting up that Scripts Class Library... &amp;nbsp;Visual Studio does not provide a decent UI for this, but MSBuild supports wild-cards. &amp;nbsp;So, create your Project in Visual Studio and then open up the project's .csproj file in the text editor of choice. &amp;nbsp;Then you can edit in your choice of Compile tags like:&lt;/p&gt;
&lt;p&gt;&amp;lt;Compile Include=&amp;quot;*.cs&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;This way you don't need to worry about adding each and every script into the process and all of the latest files will be included on build. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;(Quick Caveats: Visual Studio won't refresh it's Project Explorer all that often, and I would suggest not using Visual Studio to Add/Remove any further items after adding in your wild card.)&lt;/p&gt;
</description></item><item><title>Game: Scripts and XML Data</title><link>http://blogs.msdn.com/dowens/archive/2007/04/18/using-c-for-game-scripts-part-2.aspx#2206515</link><pubDate>Fri, 20 Apr 2007 15:22:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2206515</guid><dc:creator>Walter Stiers - Academic Relations Team (BeLux)</dc:creator><description>&lt;p&gt;David's Blog has some recent entries I would like to refer: Using C# for game scripts, part 2 Using C#&lt;/p&gt;
</description></item><item><title>re: Using C# for game scripts, part 2</title><link>http://blogs.msdn.com/dowens/archive/2007/04/18/using-c-for-game-scripts-part-2.aspx#2251843</link><pubDate>Tue, 24 Apr 2007 02:21:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2251843</guid><dc:creator>zygote</dc:creator><description>&lt;p&gt;Very nice work indeed. I have written a scripting engine in c# myself for XNA. I have yet to write an article on it however :)&lt;/p&gt;
&lt;p&gt;Ziggy&lt;/p&gt;
&lt;p&gt;Ziggyware.com XNA News and Tutorials&lt;/p&gt;
</description></item><item><title>re: Using C# for game scripts, part 2</title><link>http://blogs.msdn.com/dowens/archive/2007/04/18/using-c-for-game-scripts-part-2.aspx#2303905</link><pubDate>Sat, 28 Apr 2007 00:42:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2303905</guid><dc:creator>kamil</dc:creator><description>&lt;p&gt;thank you very much&lt;/p&gt;</description></item><item><title>re: Using C# for game scripts, part 2</title><link>http://blogs.msdn.com/dowens/archive/2007/04/18/using-c-for-game-scripts-part-2.aspx#2574548</link><pubDate>Sat, 12 May 2007 19:52:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2574548</guid><dc:creator>Bubu</dc:creator><description>&lt;p&gt;How are such scripts debugged???&lt;/p&gt;
</description></item><item><title>re: Using C# for game scripts, part 2</title><link>http://blogs.msdn.com/dowens/archive/2007/04/18/using-c-for-game-scripts-part-2.aspx#2617329</link><pubDate>Mon, 14 May 2007 08:30:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2617329</guid><dc:creator>Digini</dc:creator><description>&lt;p&gt;I just wanted to point out that if you use this technique as it stands you should be careful not to change the scripts too often while the program is running.&lt;/p&gt;
&lt;p&gt;There is currently no way in the CLR to unload an Assembly from an AppDomain after it has been loaded. &amp;nbsp;You have to throw away the whole domain and start over. &amp;nbsp;So, this is why the technique David talks about here is cool as long as the scripts are loaded at startup and never change. &amp;nbsp;If you anticipate the need to change scripts a lot during runtime you need to load these dynamic script DLLs in a seperate AppDomain so you can unload it. &lt;/p&gt;
&lt;p&gt;If you do use a seperate AppDomain you should be aware that there is some overhead associated with cross domain method calls since the calls actually go through a proxy-stub to ensure the preservation of the security context of the domain.&lt;/p&gt;
</description></item><item><title>re: Using C# for game scripts, part 2</title><link>http://blogs.msdn.com/dowens/archive/2007/04/18/using-c-for-game-scripts-part-2.aspx#3385104</link><pubDate>Mon, 18 Jun 2007 17:44:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3385104</guid><dc:creator>Geron</dc:creator><description>&lt;p&gt;Is there any way to restrict a compiled script from using file I/O etc (or certain namespaces). The compiled assembly will run under the same credentials as the host application I believe. So I want some way to restrict a user from writing &amp;quot;malicious&amp;quot; scripts. Simply scanning the script file and removing all occurrences of &amp;quot;#using System.IO;&amp;quot; etc doesn't feel secure enough. A user might even use ImportDLL-declarations to access unmanaged code!&lt;/p&gt;
</description></item><item><title>re: Using C# for game scripts, part 2</title><link>http://blogs.msdn.com/dowens/archive/2007/04/18/using-c-for-game-scripts-part-2.aspx#3387676</link><pubDate>Mon, 18 Jun 2007 21:00:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3387676</guid><dc:creator>dowens</dc:creator><description>&lt;p&gt;Geron, this is actually one of the biggest drawbacks to this approach; you are not allowed to limit the namespaces that are available. You could probably run the scripts in a lesser access than the app that is running, but I don't know of a way to actually limit the libraries that can be used in a full-proof manner.&lt;/p&gt;
</description></item></channel></rss>