aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
diff options
context:
space:
mode:
authorTedd Hansen2007-08-12 19:04:07 +0000
committerTedd Hansen2007-08-12 19:04:07 +0000
commited1208d04378b2ef9928ed270c99f4f99f3a30d5 (patch)
treeb801ad73f59f7c055fde2f3b75022735b1a8051d /OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
parentScriptManager now uses LSL-compiler. (diff)
downloadopensim-SC_OLD-ed1208d04378b2ef9928ed270c99f4f99f3a30d5.zip
opensim-SC_OLD-ed1208d04378b2ef9928ed270c99f4f99f3a30d5.tar.gz
opensim-SC_OLD-ed1208d04378b2ef9928ed270c99f4f99f3a30d5.tar.bz2
opensim-SC_OLD-ed1208d04378b2ef9928ed270c99f4f99f3a30d5.tar.xz
ScriptEngine successfully compiles script, we are now even further than LSO was.
Also added C# script support.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs22
1 files changed, 15 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index 832807d..c34889a 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -114,15 +114,23 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
114 FileName = ScriptID; 114 FileName = ScriptID;
115 115
116 // * Does script need compile? Send it to LSL compiler first. (TODO: Use (and clean) compiler cache) 116 // * Does script need compile? Send it to LSL compiler first. (TODO: Use (and clean) compiler cache)
117 if (FileName.ToLower().EndsWith(".lsl")) 117 Common.SendToDebug("ScriptManager Script extension: " + System.IO.Path.GetExtension(FileName).ToLower());
118 switch (System.IO.Path.GetExtension(FileName).ToLower())
118 { 119 {
119 Common.SendToDebug("ScriptManager Script is LSL, compiling to .Net Assembly"); 120 case ".txt":
120 // Create a new instance of the compiler (currently we don't want reuse) 121 case ".lsl":
121 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler LSLCompiler = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler(); 122 case ".cs":
122 // Compile 123 Common.SendToDebug("ScriptManager Script is CS/LSL, compiling to .Net Assembly");
123 FileName = LSLCompiler.Compile(FileName); 124 // Create a new instance of the compiler (currently we don't want reuse)
125 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler LSLCompiler = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler();
126 // Compile
127 FileName = LSLCompiler.Compile(FileName);
128 break;
129 default:
130 throw new Exception("Unknown script type.");
124 } 131 }
125 132
133 Common.SendToDebug("Compilation done");
126 // * Insert yield into code 134 // * Insert yield into code
127 FileName = ProcessYield(FileName); 135 FileName = ProcessYield(FileName);
128 136
@@ -197,7 +205,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
197 Type t; 205 Type t;
198 //try 206 //try
199 //{ 207 //{
200 t = a.GetType("LSL_ScriptObject", true); 208 t = a.GetType("SecondLife.Script", true);
201 //} 209 //}
202 //catch (Exception e) 210 //catch (Exception e)
203 //{ 211 //{