diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs | 17 |
2 files changed, 13 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs index 93b68d4..0e852d1 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs | |||
@@ -190,7 +190,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
190 | { | 190 | { |
191 | Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + | 191 | Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + |
192 | script.Length); | 192 | script.Length); |
193 | myScriptEngine.m_ScriptManager.StartScript(localID, itemID, script); | 193 | myScriptEngine.m_ScriptManager.StartScript(localID, itemID, script, startParam, postOnRez); |
194 | } | 194 | } |
195 | 195 | ||
196 | public void OnRemoveScript(uint localID, LLUUID itemID) | 196 | public void OnRemoveScript(uint localID, LLUUID itemID) |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs index eed0b86..75ab2aa 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs | |||
@@ -72,6 +72,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
72 | public LLUUID itemID; | 72 | public LLUUID itemID; |
73 | public string script; | 73 | public string script; |
74 | public LUType Action; | 74 | public LUType Action; |
75 | public int startParam; | ||
76 | public bool postOnRez; | ||
75 | } | 77 | } |
76 | 78 | ||
77 | private enum LUType | 79 | private enum LUType |
@@ -223,7 +225,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
223 | } | 225 | } |
224 | else if (item.Action == LUType.Load) | 226 | else if (item.Action == LUType.Load) |
225 | { | 227 | { |
226 | _StartScript(item.localID, item.itemID, item.script); | 228 | _StartScript(item.localID, item.itemID, item.script, item.startParam, item.postOnRez); |
227 | } | 229 | } |
228 | } | 230 | } |
229 | } | 231 | } |
@@ -252,7 +254,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
252 | /// </summary> | 254 | /// </summary> |
253 | /// <param name="itemID"></param> | 255 | /// <param name="itemID"></param> |
254 | /// <param name="localID"></param> | 256 | /// <param name="localID"></param> |
255 | public void StartScript(uint localID, LLUUID itemID, string Script) | 257 | public void StartScript(uint localID, LLUUID itemID, string Script, int startParam, bool postOnRez) |
256 | { | 258 | { |
257 | lock (LUQueue) | 259 | lock (LUQueue) |
258 | { | 260 | { |
@@ -267,6 +269,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
267 | ls.itemID = itemID; | 269 | ls.itemID = itemID; |
268 | ls.script = Script; | 270 | ls.script = Script; |
269 | ls.Action = LUType.Load; | 271 | ls.Action = LUType.Load; |
272 | ls.startParam = startParam; | ||
273 | ls.postOnRez = postOnRez; | ||
270 | LUQueue.Enqueue(ls); | 274 | LUQueue.Enqueue(ls); |
271 | } | 275 | } |
272 | } | 276 | } |
@@ -282,6 +286,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
282 | ls.localID = localID; | 286 | ls.localID = localID; |
283 | ls.itemID = itemID; | 287 | ls.itemID = itemID; |
284 | ls.Action = LUType.Unload; | 288 | ls.Action = LUType.Unload; |
289 | ls.startParam = 0; | ||
290 | ls.postOnRez = false; | ||
285 | lock (LUQueue) | 291 | lock (LUQueue) |
286 | { | 292 | { |
287 | LUQueue.Enqueue(ls); | 293 | LUQueue.Enqueue(ls); |
@@ -291,7 +297,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
291 | // Create a new instance of the compiler (reuse) | 297 | // Create a new instance of the compiler (reuse) |
292 | //private Compiler.LSL.Compiler LSLCompiler = new Compiler.LSL.Compiler(); | 298 | //private Compiler.LSL.Compiler LSLCompiler = new Compiler.LSL.Compiler(); |
293 | 299 | ||
294 | public abstract void _StartScript(uint localID, LLUUID itemID, string Script); | 300 | public abstract void _StartScript(uint localID, LLUUID itemID, string Script, int startParam, bool postOnRez); |
295 | public abstract void _StopScript(uint localID, LLUUID itemID); | 301 | public abstract void _StopScript(uint localID, LLUUID itemID); |
296 | 302 | ||
297 | 303 | ||
@@ -423,9 +429,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
423 | 429 | ||
424 | public void ResetScript(uint localID, LLUUID itemID) | 430 | public void ResetScript(uint localID, LLUUID itemID) |
425 | { | 431 | { |
426 | string script = GetScript(localID, itemID).Source; | 432 | IScript s = GetScript(localID, itemID); |
433 | string script = s.Source; | ||
427 | StopScript(localID, itemID); | 434 | StopScript(localID, itemID); |
428 | StartScript(localID, itemID, script); | 435 | StartScript(localID, itemID, script, s.StartParam, false); |
429 | } | 436 | } |
430 | 437 | ||
431 | 438 | ||