diff options
author | Tedd Hansen | 2007-08-25 19:08:15 +0000 |
---|---|---|
committer | Tedd Hansen | 2007-08-25 19:08:15 +0000 |
commit | b75c1b2191640f4a140dc4cd0e8ce35ab64863d9 (patch) | |
tree | 05a5194e8e304df86897003bdbceca68fd65fd80 /OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | |
parent | Scripts no longer crash sim after 5 minutes (override InitializeLifetimeServi... (diff) | |
download | opensim-SC-b75c1b2191640f4a140dc4cd0e8ce35ab64863d9.zip opensim-SC-b75c1b2191640f4a140dc4cd0e8ce35ab64863d9.tar.gz opensim-SC-b75c1b2191640f4a140dc4cd0e8ce35ab64863d9.tar.bz2 opensim-SC-b75c1b2191640f4a140dc4cd0e8ce35ab64863d9.tar.xz |
Added class for "long commands" (command that returns as event) with dedicated thread for processing. Added support for llSetTimerEvent(). Deleting old compiled scripts before new compile is attempted (avoids loading wrong script on compile error).
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index 9621e56..29171a1 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | |||
@@ -249,6 +249,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
249 | { | 249 | { |
250 | 250 | ||
251 | 251 | ||
252 | |||
253 | |||
252 | // Create a new instance of the compiler (currently we don't want reuse) | 254 | // Create a new instance of the compiler (currently we don't want reuse) |
253 | OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler LSLCompiler = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler(); | 255 | OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler LSLCompiler = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler(); |
254 | // Compile (We assume LSL) | 256 | // Compile (We assume LSL) |
@@ -272,11 +274,15 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
272 | 274 | ||
273 | // We need to give (untrusted) assembly a private instance of BuiltIns | 275 | // We need to give (untrusted) assembly a private instance of BuiltIns |
274 | // this private copy will contain Read-Only FullitemID so that it can bring that on to the server whenever needed. | 276 | // this private copy will contain Read-Only FullitemID so that it can bring that on to the server whenever needed. |
275 | LSL_BuiltIn_Commands LSLB = new LSL_BuiltIn_Commands(this, World.GetSceneObjectPart(localID)); | 277 | LSL_BuiltIn_Commands LSLB = new LSL_BuiltIn_Commands(m_scriptEngine, World.GetSceneObjectPart(localID), localID, itemID); |
276 | 278 | ||
277 | // Start the script - giving it BuiltIns | 279 | // Start the script - giving it BuiltIns |
278 | CompiledScript.Start(LSLB); | 280 | CompiledScript.Start(LSLB); |
279 | 281 | ||
282 | // Fire the first start-event | ||
283 | m_scriptEngine.myEventQueueManager.AddToObjectQueue(localID, "state_entry", new object[] { }); | ||
284 | |||
285 | |||
280 | } | 286 | } |
281 | catch (Exception e) | 287 | catch (Exception e) |
282 | { | 288 | { |
@@ -291,6 +297,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
291 | // Stop script | 297 | // Stop script |
292 | Console.WriteLine("Stop script localID: " + localID + " LLUID: " + itemID.ToString()); | 298 | Console.WriteLine("Stop script localID: " + localID + " LLUID: " + itemID.ToString()); |
293 | 299 | ||
300 | // Stop long command on script | ||
301 | m_scriptEngine.myLSLLongCmdHandler.RemoveScript(localID, itemID); | ||
302 | |||
294 | // Get AppDomain | 303 | // Get AppDomain |
295 | AppDomain ad = GetScript(localID, itemID).Exec.GetAppDomain(); | 304 | AppDomain ad = GetScript(localID, itemID).Exec.GetAppDomain(); |
296 | // Tell script not to accept new requests | 305 | // Tell script not to accept new requests |
@@ -328,12 +337,5 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
328 | 337 | ||
329 | } | 338 | } |
330 | 339 | ||
331 | public string RegionName | ||
332 | { | ||
333 | get | ||
334 | { | ||
335 | return World.RegionInfo.RegionName; | ||
336 | } | ||
337 | } | ||
338 | } | 340 | } |
339 | } | 341 | } |