aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
diff options
context:
space:
mode:
authorTedd Hansen2007-08-14 15:59:36 +0000
committerTedd Hansen2007-08-14 15:59:36 +0000
commitafaa12a9e2fd24c03c0f46716e9758cc591703c2 (patch)
treef6f6977314ab65d88822b592378806142090e99d /OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
parentMore inventory work, should be able to now create new inventory folders and t... (diff)
downloadopensim-SC-afaa12a9e2fd24c03c0f46716e9758cc591703c2.zip
opensim-SC-afaa12a9e2fd24c03c0f46716e9758cc591703c2.tar.gz
opensim-SC-afaa12a9e2fd24c03c0f46716e9758cc591703c2.tar.bz2
opensim-SC-afaa12a9e2fd24c03c0f46716e9758cc591703c2.tar.xz
ScriptEngine: Some error handling, logs to logger
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs18
1 files changed, 9 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index 0c5bfc2..0c4adc1 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
41 public ScriptManager(ScriptEngine _ScriptEngine) 41 public ScriptManager(ScriptEngine _ScriptEngine)
42 { 42 {
43 myScriptEngine = _ScriptEngine; 43 myScriptEngine = _ScriptEngine;
44 Common.SendToDebug("ScriptManager Start"); 44 myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager Start");
45 } 45 }
46 46
47 47
@@ -102,7 +102,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
102 /// <param name="ObjectID"></param> 102 /// <param name="ObjectID"></param>
103 public void StartScript(string ScriptID, string ObjectID) 103 public void StartScript(string ScriptID, string ObjectID)
104 { 104 {
105 Common.SendToDebug("ScriptManager StartScript: ScriptID: " + ScriptID + ", ObjectID: " + ObjectID); 105 myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager StartScript: ScriptID: " + ScriptID + ", ObjectID: " + ObjectID);
106 106
107 // We will initialize and start the script. 107 // We will initialize and start the script.
108 // It will be up to the script itself to hook up the correct events. 108 // It will be up to the script itself to hook up the correct events.
@@ -114,13 +114,13 @@ 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 Common.SendToDebug("ScriptManager Script extension: " + System.IO.Path.GetExtension(FileName).ToLower()); 117 myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager Script extension: " + System.IO.Path.GetExtension(FileName).ToLower());
118 switch (System.IO.Path.GetExtension(FileName).ToLower()) 118 switch (System.IO.Path.GetExtension(FileName).ToLower())
119 { 119 {
120 case ".txt": 120 case ".txt":
121 case ".lsl": 121 case ".lsl":
122 case ".cs": 122 case ".cs":
123 Common.SendToDebug("ScriptManager Script is CS/LSL, compiling to .Net Assembly"); 123 myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager Script is CS/LSL, compiling to .Net Assembly");
124 // Create a new instance of the compiler (currently we don't want reuse) 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(); 125 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler LSLCompiler = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler();
126 // Compile 126 // Compile
@@ -130,7 +130,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
130 throw new Exception("Unknown script type."); 130 throw new Exception("Unknown script type.");
131 } 131 }
132 132
133 Common.SendToDebug("Compilation done"); 133 myScriptEngine.m_logger.Verbose("ScriptEngine", "Compilation done");
134 // * Insert yield into code 134 // * Insert yield into code
135 FileName = ProcessYield(FileName); 135 FileName = ProcessYield(FileName);
136 136
@@ -149,7 +149,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
149 //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL_BuiltIn_Commands_Interface LSLB = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL_BuiltIn_Commands_TestImplementation(FullScriptID); 149 //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL_BuiltIn_Commands_Interface LSLB = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL_BuiltIn_Commands_TestImplementation(FullScriptID);
150 150
151 // Start the script - giving it BuiltIns 151 // Start the script - giving it BuiltIns
152 Common.SendToDebug("ScriptManager initializing script, handing over private builtin command interface"); 152 myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager initializing script, handing over private builtin command interface");
153 Script.Start(myScriptEngine.World, ScriptID); 153 Script.Start(myScriptEngine.World, ScriptID);
154 154
155 155
@@ -174,7 +174,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
174 /// <returns></returns> 174 /// <returns></returns>
175 private OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass LoadAndInitAssembly(AppDomain FreeAppDomain, string FileName) 175 private OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass LoadAndInitAssembly(AppDomain FreeAppDomain, string FileName)
176 { 176 {
177 Common.SendToDebug("ScriptManager Loading Assembly " + FileName); 177 myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager Loading Assembly " + FileName);
178 // Load .Net Assembly (.dll) 178 // Load .Net Assembly (.dll)
179 // Initialize and return it 179 // Initialize and return it
180 180
@@ -218,7 +218,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
218 218
219 internal void ExecuteFunction(string ObjectID, string ScriptID, string FunctionName, object[] args) 219 internal void ExecuteFunction(string ObjectID, string ScriptID, string FunctionName, object[] args)
220 { 220 {
221 Common.SendToDebug("Executing Function ObjectID: " + ObjectID + ", ScriptID: " + ScriptID + ", FunctionName: " + FunctionName); 221 myScriptEngine.m_logger.Verbose("ScriptEngine", "Executing Function ObjectID: " + ObjectID + ", ScriptID: " + ScriptID + ", FunctionName: " + FunctionName);
222 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = myScriptEngine.myScriptManager.GetScript(ObjectID, ScriptID); 222 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = myScriptEngine.myScriptManager.GetScript(ObjectID, ScriptID);
223 223
224 Type type = Script.GetType(); 224 Type type = Script.GetType();
@@ -226,7 +226,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
226 226
227 //System.Collections.Generic.List<string> Functions = (System.Collections.Generic.List<string>) 227 //System.Collections.Generic.List<string> Functions = (System.Collections.Generic.List<string>)
228 //Type type = typeof(OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass); 228 //Type type = typeof(OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass);
229 Common.SendToDebug("Invoke: \"" + Script.State + "_event_" + FunctionName + "\""); 229 myScriptEngine.m_logger.Verbose("ScriptEngine", "Invoke: \"" + Script.State + "_event_" + FunctionName + "\"");
230 type.InvokeMember(Script.State + "_event_" + FunctionName, BindingFlags.InvokeMethod, null, Script, args); 230 type.InvokeMember(Script.State + "_event_" + FunctionName, BindingFlags.InvokeMethod, null, Script, args);
231 //System.Collections.Generic.List<string> Functions = (System.Collections.Generic.List<string>)type.InvokeMember("GetFunctions", BindingFlags.InvokeMethod, null, Script, null); 231 //System.Collections.Generic.List<string> Functions = (System.Collections.Generic.List<string>)type.InvokeMember("GetFunctions", BindingFlags.InvokeMethod, null, Script, null);
232 232