mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 22:05:36 +08:00
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.
This commit is contained in:
@@ -198,10 +198,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
det.Add(d);
|
||||
}
|
||||
|
||||
myScriptEngine.PostObjectEvent(localID, new EventParams(
|
||||
"collision_start",
|
||||
new Object[] { new LSL_Types.LSLInteger(1) },
|
||||
det.ToArray()));
|
||||
if (det.Count > 0)
|
||||
myScriptEngine.PostObjectEvent(localID, new EventParams(
|
||||
"collision_start",
|
||||
new Object[] { new LSL_Types.LSLInteger(det.Count) },
|
||||
det.ToArray()));
|
||||
}
|
||||
|
||||
public void collision(uint localID, ColliderArgs col)
|
||||
@@ -217,9 +218,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
det.Add(d);
|
||||
}
|
||||
|
||||
myScriptEngine.PostObjectEvent(localID, new EventParams(
|
||||
"collision", new Object[] { new LSL_Types.LSLInteger(1) },
|
||||
det.ToArray()));
|
||||
if (det.Count > 0)
|
||||
myScriptEngine.PostObjectEvent(localID, new EventParams(
|
||||
"collision", new Object[] { new LSL_Types.LSLInteger(det.Count) },
|
||||
det.ToArray()));
|
||||
}
|
||||
|
||||
public void collision_end(uint localID, ColliderArgs col)
|
||||
@@ -235,10 +237,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
det.Add(d);
|
||||
}
|
||||
|
||||
myScriptEngine.PostObjectEvent(localID, new EventParams(
|
||||
"collision_end",
|
||||
new Object[] { new LSL_Types.LSLInteger(1) },
|
||||
det.ToArray()));
|
||||
if (det.Count > 0)
|
||||
myScriptEngine.PostObjectEvent(localID, new EventParams(
|
||||
"collision_end",
|
||||
new Object[] { new LSL_Types.LSLInteger(det.Count) },
|
||||
det.ToArray()));
|
||||
}
|
||||
|
||||
public void land_collision_start(uint localID, UUID itemID)
|
||||
|
||||
Reference in New Issue
Block a user