aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
diff options
context:
space:
mode:
authorMelanie Thielker2008-09-25 05:13:44 +0000
committerMelanie Thielker2008-09-25 05:13:44 +0000
commitf3c8963c86dbc969541ede80ae37eb59d26b7809 (patch)
treeff1e5cea74e9d5c2b73c476320a7bddf11d93766 /OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
parentMantis#2123. Thank you kindly, Idb for a patch that solves: (diff)
downloadopensim-SC-f3c8963c86dbc969541ede80ae37eb59d26b7809.zip
opensim-SC-f3c8963c86dbc969541ede80ae37eb59d26b7809.tar.gz
opensim-SC-f3c8963c86dbc969541ede80ae37eb59d26b7809.tar.bz2
opensim-SC-f3c8963c86dbc969541ede80ae37eb59d26b7809.tar.xz
Convergence is almost complete. This brings the diff between the API to < 10k
and makes it use a common set of types in both engine. Fixes the issues with running both engines and HTTP requests / listens / timers etc.. Also fixes a couple of minor Scene issues and a CTB by nullref.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs19
1 files changed, 17 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
index ff8e16f..095e11f 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
@@ -33,6 +33,7 @@ using System.Runtime.Serialization.Formatters.Binary;
33using System.Threading; 33using System.Threading;
34using OpenMetaverse; 34using OpenMetaverse;
35using OpenSim.Region.Environment.Scenes; 35using OpenSim.Region.Environment.Scenes;
36using OpenSim.Region.ScriptEngine.Shared;
36 37
37namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase 38namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
38{ 39{
@@ -65,6 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
65 private int LoadUnloadMaxQueueSize; 66 private int LoadUnloadMaxQueueSize;
66 private Object scriptLock = new Object(); 67 private Object scriptLock = new Object();
67 private bool m_started = false; 68 private bool m_started = false;
69 private Dictionary<IScript, DetectParams[]> detparms = new Dictionary<IScript, DetectParams[]>();
68 70
69 // Load/Unload structure 71 // Load/Unload structure
70 private struct LUStruct 72 private struct LUStruct
@@ -228,6 +230,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
228 if (item.Action == LUType.Unload) 230 if (item.Action == LUType.Unload)
229 { 231 {
230 _StopScript(item.localID, item.itemID); 232 _StopScript(item.localID, item.itemID);
233 RemoveScript(item.localID, item.itemID);
231 } 234 }
232 else if (item.Action == LUType.Load) 235 else if (item.Action == LUType.Load)
233 { 236 {
@@ -318,7 +321,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
318 /// <param name="itemID">Script ID</param> 321 /// <param name="itemID">Script ID</param>
319 /// <param name="FunctionName">Name of function</param> 322 /// <param name="FunctionName">Name of function</param>
320 /// <param name="args">Arguments to pass to function</param> 323 /// <param name="args">Arguments to pass to function</param>
321 internal void ExecuteEvent(uint localID, UUID itemID, string FunctionName, EventQueueManager.Queue_llDetectParams_Struct qParams, object[] args) 324 internal void ExecuteEvent(uint localID, UUID itemID, string FunctionName, DetectParams[] qParams, object[] args)
322 { 325 {
323 //cfk 2-7-08 dont need this right now and the default Linux build has DEBUG defined 326 //cfk 2-7-08 dont need this right now and the default Linux build has DEBUG defined
324 ///#if DEBUG 327 ///#if DEBUG
@@ -337,8 +340,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
337 /// Console.WriteLine("ScriptEngine: Executing event: " + FunctionName); 340 /// Console.WriteLine("ScriptEngine: Executing event: " + FunctionName);
338 ///#endif 341 ///#endif
339 // Must be done in correct AppDomain, so leaving it up to the script itself 342 // Must be done in correct AppDomain, so leaving it up to the script itself
340 Script.llDetectParams = qParams; 343 detparms[Script] = qParams;
341 Script.Exec.ExecuteEvent(FunctionName, args); 344 Script.Exec.ExecuteEvent(FunctionName, args);
345 detparms.Remove(Script);
342 } 346 }
343 347
344 public uint GetLocalID(UUID itemID) 348 public uint GetLocalID(UUID itemID)
@@ -430,6 +434,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
430 434
431 public void RemoveScript(uint localID, UUID itemID) 435 public void RemoveScript(uint localID, UUID itemID)
432 { 436 {
437 if (localID == 0)
438 localID = GetLocalID(itemID);
439
433 // Don't have that object? 440 // Don't have that object?
434 if (Scripts.ContainsKey(localID) == false) 441 if (Scripts.ContainsKey(localID) == false)
435 return; 442 return;
@@ -486,5 +493,13 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
486 // set { _PleaseShutdown = value; } 493 // set { _PleaseShutdown = value; }
487 //} 494 //}
488 //private bool _PleaseShutdown = false; 495 //private bool _PleaseShutdown = false;
496
497 public DetectParams[] GetDetectParams(IScript script)
498 {
499 if (detparms.ContainsKey(script))
500 return detparms[script];
501
502 return null;
503 }
489 } 504 }
490} 505}