From 402be52e31fca9d29e72338c738e65e4fbd5c18c Mon Sep 17 00:00:00 2001 From: Scionwest_cp Date: Tue, 26 Apr 2011 20:39:28 -0700 Subject: [PATCH] MudEngine: - Added support for the rScript engine to Game. It still contains code with MudEngine.Scripting.ScriptEngine, however it is not used by anything. - Added MudScriptCompiler. Custom Compiler created using ICompiler, included with the rScript engine. * At this time, ScriptEngine is no longer used, and has been fully replaced by the rScript Engine and MudScriptCompiler. * Take note that the MudScriptCompiler only supports C# Keywords, and not some of the standard .NET Types. For a string, you'll need to use 'string' and not 'String'. I'm looking into why this is the case. Until the issue is fixed, none of the example game scripts will run. --- MudEngine/GameManagement/Game.cs | 6 +- MudEngine/MudEngine.csproj | 5 +- MudEngine/Scripting/MudScriptCompiler.cs | 192 +++++++++++++++++++++++ MudEngine/Scripting/ScriptEngine.cs | 2 +- 4 files changed, 201 insertions(+), 4 deletions(-) create mode 100644 MudEngine/Scripting/MudScriptCompiler.cs diff --git a/MudEngine/GameManagement/Game.cs b/MudEngine/GameManagement/Game.cs index a4e4e90..24984f8 100644 --- a/MudEngine/GameManagement/Game.cs +++ b/MudEngine/GameManagement/Game.cs @@ -251,8 +251,12 @@ namespace MudEngine.GameManagement //scriptEngine.Initialize(); //Instance the new scripting engine - Scripting.Compiler = "C#"; + Scripting.Compiler = "MudScriptCompiler"; + if (!System.IO.File.Exists("MudEngine.dll")) + Log.Write("CRITICAL ERROR: Un-able to locate MudEngine.dll"); + Scripting.AddAssemblyReference("MudEngine.dll"); + if (!Scripting.Compile(DataPaths.Scripts)) { Log.Write("CRITICAL ERROR: Game Script Repository failed to compile!"); diff --git a/MudEngine/MudEngine.csproj b/MudEngine/MudEngine.csproj index e8b6b58..531af46 100644 --- a/MudEngine/MudEngine.csproj +++ b/MudEngine/MudEngine.csproj @@ -36,7 +36,8 @@ - + + False ..\..\rScript\rScripting\bin\Release\rScripting.dll @@ -84,11 +85,11 @@ + -