aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorTedd Hansen2007-08-22 18:41:31 +0000
committerTedd Hansen2007-08-22 18:41:31 +0000
commit0eadb7591eef84b082b81e8f5df941c0c1f7725a (patch)
tree370409f1a6321cb0c1240f8f3bb927d51d461a81 /OpenSim/Region/ScriptEngine
parentAdded OnRemoveScript(uint localID, LLUUID itemID) event , trigged when a scri... (diff)
downloadopensim-SC-0eadb7591eef84b082b81e8f5df941c0c1f7725a.zip
opensim-SC-0eadb7591eef84b082b81e8f5df941c0c1f7725a.tar.gz
opensim-SC-0eadb7591eef84b082b81e8f5df941c0c1f7725a.tar.bz2
opensim-SC-0eadb7591eef84b082b81e8f5df941c0c1f7725a.tar.xz
Added OnRemoveScript event handler to ScriptEngine. Fixed event queuing of empty objects crash.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs4
3 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
index 9dd274e..14ee1ec 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
@@ -13,7 +13,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
13 { 13 {
14 private LSL2CSConverter LSL_Converter = new LSL2CSConverter(); 14 private LSL2CSConverter LSL_Converter = new LSL2CSConverter();
15 private CSharpCodeProvider codeProvider = new CSharpCodeProvider(); 15 private CSharpCodeProvider codeProvider = new CSharpCodeProvider();
16 private int ScriptCompileCounter = 0; 16 private static UInt64 ScriptCompileCounter = 0;
17 //private ICodeCompiler icc = codeProvider.CreateCompiler(); 17 //private ICodeCompiler icc = codeProvider.CreateCompiler();
18 public string CompileFromFile(string LSOFileName) 18 public string CompileFromFile(string LSOFileName)
19 { 19 {
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs
index 92afcf3..4343ea1 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs
@@ -54,6 +54,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
54 //myScriptEngine.Log.Verbose("ScriptEngine", "EventManager Hooking up to server events"); 54 //myScriptEngine.Log.Verbose("ScriptEngine", "EventManager Hooking up to server events");
55 myScriptEngine.World.EventManager.OnObjectGrab += new OpenSim.Region.Environment.Scenes.EventManager.ObjectGrabDelegate(touch_start); 55 myScriptEngine.World.EventManager.OnObjectGrab += new OpenSim.Region.Environment.Scenes.EventManager.ObjectGrabDelegate(touch_start);
56 myScriptEngine.World.EventManager.OnRezScript += new OpenSim.Region.Environment.Scenes.EventManager.NewRezScript(OnRezScript); 56 myScriptEngine.World.EventManager.OnRezScript += new OpenSim.Region.Environment.Scenes.EventManager.NewRezScript(OnRezScript);
57 myScriptEngine.World.EventManager.OnRemoveScript += new OpenSim.Region.Environment.Scenes.EventManager.RemoveScript(OnRemoveScript);
57 58
58 } 59 }
59 60
@@ -73,6 +74,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
73 // Path.Combine("ScriptEngines", "Default.lsl"), 74 // Path.Combine("ScriptEngines", "Default.lsl"),
74 // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost() 75 // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost()
75 //); 76 //);
77 Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + script.Length);
76 myScriptEngine.myScriptManager.StartScript( 78 myScriptEngine.myScriptManager.StartScript(
77 localID, 79 localID,
78 itemID, 80 itemID,
@@ -80,7 +82,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
80 ); 82 );
81 83
82 } 84 }
83 public void OnDeRezScript(uint localID, LLUUID itemID) 85 public void OnRemoveScript(uint localID, LLUUID itemID)
84 { 86 {
85 //myScriptEngine.myScriptManager.StartScript( 87 //myScriptEngine.myScriptManager.StartScript(
86 // Path.Combine("ScriptEngines", "Default.lsl"), 88 // Path.Combine("ScriptEngines", "Default.lsl"),
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs
index 3ef21db..23cd4e8 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs
@@ -239,6 +239,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
239 lock (QueueLock) 239 lock (QueueLock)
240 { 240 {
241 241
242 // Do we have any scripts in this object at all? If not, return
243 if (myScriptEngine.myScriptManager.Scripts.ContainsKey(localID) == false)
244 return;
245
242 foreach (LLUUID itemID in myScriptEngine.myScriptManager.GetScriptKeys(localID)) 246 foreach (LLUUID itemID in myScriptEngine.myScriptManager.GetScriptKeys(localID))
243 { 247 {
244 // Add to each script in that object 248 // Add to each script in that object