diff options
author | Charles Krinke | 2008-09-14 00:47:45 +0000 |
---|---|---|
committer | Charles Krinke | 2008-09-14 00:47:45 +0000 |
commit | f2d60976d0875c47398ff76ef9de192cc8f3fb02 (patch) | |
tree | da58f3ff92e1419755068464b92d784c8fec04e5 /OpenSim/Region/ScriptEngine | |
parent | Fixed several cases of inverted colors and alpha in DNE and XEngine. (diff) | |
download | opensim-SC_OLD-f2d60976d0875c47398ff76ef9de192cc8f3fb02.zip opensim-SC_OLD-f2d60976d0875c47398ff76ef9de192cc8f3fb02.tar.gz opensim-SC_OLD-f2d60976d0875c47398ff76ef9de192cc8f3fb02.tar.bz2 opensim-SC_OLD-f2d60976d0875c47398ff76ef9de192cc8f3fb02.tar.xz |
Mantis#2183. Thank you kindly, Ewe Loon for a patch that addresses:
after using llTakeControls my sim receives about 200 messages per second,
l of which get queued , this could be because there is no lag as the viewer
and sim are on the same computer. The patch I have included checks to see if
the "Changed" param is 0 then searches the EventQueue for Control messages
being sent to the same localid, if it finds a message already in the Queue
and Changed==0 then the new message is only notifing you the key is being held,
since there is already a message the new one isnt needed so it isnt added
to the queue.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs index 89d7045..5a9385f 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs | |||
@@ -357,6 +357,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
357 | 357 | ||
358 | public void control(uint localID, UUID itemID, UUID agentID, uint held, uint change) | 358 | public void control(uint localID, UUID itemID, UUID agentID, uint held, uint change) |
359 | { | 359 | { |
360 | if ((change == 0) && (myScriptEngine.m_EventQueueManager.CheckEeventQueueForEvent(localID,"control"))) return; | ||
360 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "control", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLString(agentID.ToString()), new LSL_Types.LSLInteger(held), new LSL_Types.LSLInteger(change)}); | 361 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "control", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLString(agentID.ToString()), new LSL_Types.LSLInteger(held), new LSL_Types.LSLInteger(change)}); |
361 | } | 362 | } |
362 | 363 | ||
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs index 1a08795..af7fca3 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs | |||
@@ -288,6 +288,31 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
288 | } | 288 | } |
289 | } | 289 | } |
290 | #endregion | 290 | #endregion |
291 | |||
292 | #region " Check execution queue for a specified Event" | ||
293 | /// <summary> | ||
294 | /// checks to see if a specified event type is already in the queue | ||
295 | /// </summary> | ||
296 | /// <param name="localID">Region object ID</param> | ||
297 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> | ||
298 | /// <returns>true if event is found , false if not found</returns> | ||
299 | /// | ||
300 | public bool CheckEeventQueueForEvent(uint localID, string FunctionName) | ||
301 | { | ||
302 | if (eventQueue.Count > 0) | ||
303 | { | ||
304 | lock (eventQueue) | ||
305 | { | ||
306 | foreach (EventQueueManager.QueueItemStruct QIS in eventQueue) | ||
307 | { | ||
308 | if ((QIS.functionName == FunctionName) && (QIS.localID == localID)) | ||
309 | return true; | ||
310 | } | ||
311 | } | ||
312 | } | ||
313 | return false; | ||
314 | } | ||
315 | #endregion | ||
291 | 316 | ||
292 | #region " Add events to execution queue " | 317 | #region " Add events to execution queue " |
293 | /// <summary> | 318 | /// <summary> |