aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
diff options
context:
space:
mode:
authorMelanie Thielker2008-09-18 18:50:39 +0000
committerMelanie Thielker2008-09-18 18:50:39 +0000
commit903fbd1f06b990141a90b539a2dbe77ab6be830e (patch)
tree9e33425216bd3a5631cf561d279ba503565c1e05 /OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
parent* Updates the SQLite region database to support the same properties that the ... (diff)
downloadopensim-SC-903fbd1f06b990141a90b539a2dbe77ab6be830e.zip
opensim-SC-903fbd1f06b990141a90b539a2dbe77ab6be830e.tar.gz
opensim-SC-903fbd1f06b990141a90b539a2dbe77ab6be830e.tar.bz2
opensim-SC-903fbd1f06b990141a90b539a2dbe77ab6be830e.tar.xz
XEngine: fix collisions, add event coalescing for collision events.
Fix a nasty concurrency issue that could cause a high event frequency to start more than one thread pool job for a single script.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/EventManager.cs25
1 files changed, 14 insertions, 11 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
index 22abd79..9ed2fbb 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
@@ -198,10 +198,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
198 det.Add(d); 198 det.Add(d);
199 } 199 }
200 200
201 myScriptEngine.PostObjectEvent(localID, new EventParams( 201 if (det.Count > 0)
202 "collision_start", 202 myScriptEngine.PostObjectEvent(localID, new EventParams(
203 new Object[] { new LSL_Types.LSLInteger(1) }, 203 "collision_start",
204 det.ToArray())); 204 new Object[] { new LSL_Types.LSLInteger(det.Count) },
205 det.ToArray()));
205 } 206 }
206 207
207 public void collision(uint localID, ColliderArgs col) 208 public void collision(uint localID, ColliderArgs col)
@@ -217,9 +218,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
217 det.Add(d); 218 det.Add(d);
218 } 219 }
219 220
220 myScriptEngine.PostObjectEvent(localID, new EventParams( 221 if (det.Count > 0)
221 "collision", new Object[] { new LSL_Types.LSLInteger(1) }, 222 myScriptEngine.PostObjectEvent(localID, new EventParams(
222 det.ToArray())); 223 "collision", new Object[] { new LSL_Types.LSLInteger(det.Count) },
224 det.ToArray()));
223 } 225 }
224 226
225 public void collision_end(uint localID, ColliderArgs col) 227 public void collision_end(uint localID, ColliderArgs col)
@@ -235,10 +237,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
235 det.Add(d); 237 det.Add(d);
236 } 238 }
237 239
238 myScriptEngine.PostObjectEvent(localID, new EventParams( 240 if (det.Count > 0)
239 "collision_end", 241 myScriptEngine.PostObjectEvent(localID, new EventParams(
240 new Object[] { new LSL_Types.LSLInteger(1) }, 242 "collision_end",
241 det.ToArray())); 243 new Object[] { new LSL_Types.LSLInteger(det.Count) },
244 det.ToArray()));
242 } 245 }
243 246
244 public void land_collision_start(uint localID, UUID itemID) 247 public void land_collision_start(uint localID, UUID itemID)