diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs index d0af720..ac0ab7e 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs | |||
@@ -322,7 +322,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
322 | /// <param name="localID">Region object ID</param> | 322 | /// <param name="localID">Region object ID</param> |
323 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> | 323 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> |
324 | /// <param name="param">Array of parameters to match event mask</param> | 324 | /// <param name="param">Array of parameters to match event mask</param> |
325 | public void AddToObjectQueue(uint localID, string FunctionName, Queue_llDetectParams_Struct qParams, params object[] param) | 325 | public bool AddToObjectQueue(uint localID, string FunctionName, Queue_llDetectParams_Struct qParams, params object[] param) |
326 | { | 326 | { |
327 | // Determine all scripts in Object and add to their queue | 327 | // Determine all scripts in Object and add to their queue |
328 | //myScriptEngine.log.Info("[" + ScriptEngineName + "]: EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName); | 328 | //myScriptEngine.log.Info("[" + ScriptEngineName + "]: EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName); |
@@ -331,10 +331,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
331 | if (m_ScriptEngine.m_ScriptManager.Scripts.ContainsKey(localID) == false) | 331 | if (m_ScriptEngine.m_ScriptManager.Scripts.ContainsKey(localID) == false) |
332 | { | 332 | { |
333 | //Console.WriteLine("Event \String.Empty + FunctionName + "\" for localID: " + localID + ". No scripts found on this localID."); | 333 | //Console.WriteLine("Event \String.Empty + FunctionName + "\" for localID: " + localID + ". No scripts found on this localID."); |
334 | return; | 334 | return false; |
335 | } | 335 | } |
336 | 336 | ||
337 | Dictionary<UUID, IScript>.KeyCollection scriptKeys = | 337 | List<UUID> scriptKeys = |
338 | m_ScriptEngine.m_ScriptManager.GetScriptKeys(localID); | 338 | m_ScriptEngine.m_ScriptManager.GetScriptKeys(localID); |
339 | 339 | ||
340 | foreach (UUID itemID in scriptKeys) | 340 | foreach (UUID itemID in scriptKeys) |
@@ -343,6 +343,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
343 | // TODO: Some scripts may not subscribe to this event. Should we NOT add it? Does it matter? | 343 | // TODO: Some scripts may not subscribe to this event. Should we NOT add it? Does it matter? |
344 | AddToScriptQueue(localID, itemID, FunctionName, qParams, param); | 344 | AddToScriptQueue(localID, itemID, FunctionName, qParams, param); |
345 | } | 345 | } |
346 | return true; | ||
346 | } | 347 | } |
347 | 348 | ||
348 | /// <summary> | 349 | /// <summary> |
@@ -352,12 +353,12 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
352 | /// <param name="itemID">Region script ID</param> | 353 | /// <param name="itemID">Region script ID</param> |
353 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> | 354 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> |
354 | /// <param name="param">Array of parameters to match event mask</param> | 355 | /// <param name="param">Array of parameters to match event mask</param> |
355 | public void AddToScriptQueue(uint localID, UUID itemID, string FunctionName, Queue_llDetectParams_Struct qParams, params object[] param) | 356 | public bool AddToScriptQueue(uint localID, UUID itemID, string FunctionName, Queue_llDetectParams_Struct qParams, params object[] param) |
356 | { | 357 | { |
357 | List<UUID> keylist = new List<UUID>(m_ScriptEngine.m_ScriptManager.GetScriptKeys(localID)); | 358 | List<UUID> keylist = new List<UUID>(m_ScriptEngine.m_ScriptManager.GetScriptKeys(localID)); |
358 | 359 | ||
359 | if (!keylist.Contains(itemID)) // We don't manage that script | 360 | if (!keylist.Contains(itemID)) // We don't manage that script |
360 | return; | 361 | return false; |
361 | 362 | ||
362 | lock (eventQueue) | 363 | lock (eventQueue) |
363 | { | 364 | { |
@@ -365,7 +366,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
365 | { | 366 | { |
366 | m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + "]: ERROR: Event execution queue item count is at " + eventQueue.Count + ". Config variable \"EventExecutionMaxQueueSize\" is set to " + EventExecutionMaxQueueSize + ", so ignoring new event."); | 367 | m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + "]: ERROR: Event execution queue item count is at " + eventQueue.Count + ". Config variable \"EventExecutionMaxQueueSize\" is set to " + EventExecutionMaxQueueSize + ", so ignoring new event."); |
367 | m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + "]: Event ignored: localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName); | 368 | m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + "]: Event ignored: localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName); |
368 | return; | 369 | return false; |
369 | } | 370 | } |
370 | 371 | ||
371 | // Create a structure and add data | 372 | // Create a structure and add data |
@@ -379,6 +380,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
379 | // Add it to queue | 380 | // Add it to queue |
380 | eventQueue.Enqueue(QIS); | 381 | eventQueue.Enqueue(QIS); |
381 | } | 382 | } |
383 | return true; | ||
382 | } | 384 | } |
383 | #endregion | 385 | #endregion |
384 | 386 | ||