diff options
author | Charles Krinke | 2009-03-15 19:39:43 +0000 |
---|---|---|
committer | Charles Krinke | 2009-03-15 19:39:43 +0000 |
commit | 9e4d9e2c3f9332c7c6f73b08bb4374862352d86e (patch) | |
tree | 527c6f75a30701a1fb55c2920dfebea57d42ac2a /OpenSim | |
parent | Changing a few methods to public. This is the collection of methods that will... (diff) | |
download | opensim-SC_OLD-9e4d9e2c3f9332c7c6f73b08bb4374862352d86e.zip opensim-SC_OLD-9e4d9e2c3f9332c7c6f73b08bb4374862352d86e.tar.gz opensim-SC_OLD-9e4d9e2c3f9332c7c6f73b08bb4374862352d86e.tar.bz2 opensim-SC_OLD-9e4d9e2c3f9332c7c6f73b08bb4374862352d86e.tar.xz |
Fixes Mantis #3289. Thank you kindly, Ewe Loon, for a patch that:
fixes Sporadic Errors in "Dictionary<InstanceData, DetectParams[]"
Causing total script Failure
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index 32eb200..5ceab0a 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | |||
@@ -500,16 +500,33 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
500 | internal void ExecuteEvent(uint localID, UUID itemID, | 500 | internal void ExecuteEvent(uint localID, UUID itemID, |
501 | string FunctionName, DetectParams[] qParams, object[] args) | 501 | string FunctionName, DetectParams[] qParams, object[] args) |
502 | { | 502 | { |
503 | InstanceData id = GetScript(localID, itemID); | 503 | int ExeStage=0; // ;^) Ewe Loon, for debuging |
504 | if (id == null) | 504 | InstanceData id=null; |
505 | return; | 505 | try // ;^) Ewe Loon,fix |
506 | 506 | { // ;^) Ewe Loon,fix | |
507 | detparms[id] = qParams; | 507 | ExeStage = 1; // ;^) Ewe Loon, for debuging |
508 | 508 | id = GetScript(localID, itemID); | |
509 | if (id.Running) | 509 | if (id == null) |
510 | id.Script.ExecuteEvent(id.State, FunctionName, args); | 510 | return; |
511 | 511 | ExeStage = 2; // ;^) Ewe Loon, for debuging | |
512 | detparms.Remove(id); | 512 | if (qParams.Length>0) // ;^) Ewe Loon,fix |
513 | detparms[id] = qParams; | ||
514 | ExeStage = 3; // ;^) Ewe Loon, for debuging | ||
515 | if (id.Running) | ||
516 | id.Script.ExecuteEvent(id.State, FunctionName, args); | ||
517 | ExeStage = 4; // ;^) Ewe Loon, for debuging | ||
518 | if (qParams.Length>0) // ;^) Ewe Loon,fix | ||
519 | detparms.Remove(id); | ||
520 | ExeStage = 5; // ;^) Ewe Loon, for debuging | ||
521 | } | ||
522 | catch (Exception e) // ;^) Ewe Loon, From here down tis fix | ||
523 | { | ||
524 | if ((ExeStage == 3)&&(qParams.Length>0)) | ||
525 | detparms.Remove(id); | ||
526 | SceneObjectPart ob = m_scriptEngine.World.GetSceneObjectPart(localID); | ||
527 | m_log.InfoFormat("[Script Error] ,{0},{1},@{2},{3},{4},{5}", ob.Name , FunctionName, ExeStage, e.Message, qParams.Length, detparms.Count); | ||
528 | if (ExeStage != 2) throw e; | ||
529 | } | ||
513 | } | 530 | } |
514 | 531 | ||
515 | public uint GetLocalID(UUID itemID) | 532 | public uint GetLocalID(UUID itemID) |
@@ -569,6 +586,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
569 | 586 | ||
570 | Dictionary<UUID, InstanceData> Obj; | 587 | Dictionary<UUID, InstanceData> Obj; |
571 | Scripts.TryGetValue(localID, out Obj); | 588 | Scripts.TryGetValue(localID, out Obj); |
589 | if (Obj==null) return null; | ||
572 | if (Obj.ContainsKey(itemID) == false) | 590 | if (Obj.ContainsKey(itemID) == false) |
573 | return null; | 591 | return null; |
574 | 592 | ||