diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
5 files changed, 96 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index 14edde4..993d10f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs | |||
@@ -247,7 +247,58 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
247 | 247 | ||
248 | // Remove Sensors | 248 | // Remove Sensors |
249 | m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID); | 249 | m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID); |
250 | } | ||
251 | |||
252 | /// <summary> | ||
253 | /// Get the sensor repeat plugin for this script engine. | ||
254 | /// </summary> | ||
255 | /// <param name="engine"></param> | ||
256 | /// <returns></returns> | ||
257 | public static SensorRepeat GetSensorRepeatPlugin(IScriptEngine engine) | ||
258 | { | ||
259 | if (m_SensorRepeat.ContainsKey(engine)) | ||
260 | return m_SensorRepeat[engine]; | ||
261 | else | ||
262 | return null; | ||
263 | } | ||
250 | 264 | ||
265 | /// <summary> | ||
266 | /// Get the dataserver plugin for this script engine. | ||
267 | /// </summary> | ||
268 | /// <param name="engine"></param> | ||
269 | /// <returns></returns> | ||
270 | public static Dataserver GetDataserverPlugin(IScriptEngine engine) | ||
271 | { | ||
272 | if (m_Dataserver.ContainsKey(engine)) | ||
273 | return m_Dataserver[engine]; | ||
274 | else | ||
275 | return null; | ||
276 | } | ||
277 | |||
278 | /// <summary> | ||
279 | /// Get the timer plugin for this script engine. | ||
280 | /// </summary> | ||
281 | /// <param name="engine"></param> | ||
282 | /// <returns></returns> | ||
283 | public static Timer GetTimerPlugin(IScriptEngine engine) | ||
284 | { | ||
285 | if (m_Timer.ContainsKey(engine)) | ||
286 | return m_Timer[engine]; | ||
287 | else | ||
288 | return null; | ||
289 | } | ||
290 | |||
291 | /// <summary> | ||
292 | /// Get the listener plugin for this script engine. | ||
293 | /// </summary> | ||
294 | /// <param name="engine"></param> | ||
295 | /// <returns></returns> | ||
296 | public static Listener GetListenerPlugin(IScriptEngine engine) | ||
297 | { | ||
298 | if (m_Listener.ContainsKey(engine)) | ||
299 | return m_Listener[engine]; | ||
300 | else | ||
301 | return null; | ||
251 | } | 302 | } |
252 | 303 | ||
253 | public static Object[] GetSerializationData(IScriptEngine engine, UUID itemID) | 304 | public static Object[] GetSerializationData(IScriptEngine engine, UUID itemID) |
@@ -270,7 +321,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
270 | data.AddRange(timers); | 321 | data.AddRange(timers); |
271 | } | 322 | } |
272 | 323 | ||
273 | Object[] sensors=m_SensorRepeat[engine].GetSerializationData(itemID); | 324 | Object[] sensors = m_SensorRepeat[engine].GetSerializationData(itemID); |
274 | if (sensors.Length > 0) | 325 | if (sensors.Length > 0) |
275 | { | 326 | { |
276 | data.Add("sensor"); | 327 | data.Add("sensor"); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs index 7fa19b1..9f78a49 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs | |||
@@ -38,6 +38,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
38 | { | 38 | { |
39 | public AsyncCommandManager m_CmdManager; | 39 | public AsyncCommandManager m_CmdManager; |
40 | 40 | ||
41 | public int DataserverRequestsCount | ||
42 | { | ||
43 | get | ||
44 | { | ||
45 | lock (DataserverRequests) | ||
46 | return DataserverRequests.Count; | ||
47 | } | ||
48 | } | ||
49 | |||
41 | private Dictionary<string, DataserverRequest> DataserverRequests = | 50 | private Dictionary<string, DataserverRequest> DataserverRequests = |
42 | new Dictionary<string, DataserverRequest>(); | 51 | new Dictionary<string, DataserverRequest>(); |
43 | 52 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs index 740816f..93e0261 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs | |||
@@ -42,22 +42,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
42 | 42 | ||
43 | public AsyncCommandManager m_CmdManager; | 43 | public AsyncCommandManager m_CmdManager; |
44 | 44 | ||
45 | private IWorldComm m_commsPlugin; | ||
46 | |||
47 | public int ListenerCount | ||
48 | { | ||
49 | get { return m_commsPlugin.ListenerCount; } | ||
50 | } | ||
51 | |||
45 | public Listener(AsyncCommandManager CmdManager) | 52 | public Listener(AsyncCommandManager CmdManager) |
46 | { | 53 | { |
47 | m_CmdManager = CmdManager; | 54 | m_CmdManager = CmdManager; |
55 | m_commsPlugin = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | ||
48 | } | 56 | } |
49 | 57 | ||
50 | public void CheckListeners() | 58 | public void CheckListeners() |
51 | { | 59 | { |
52 | if (m_CmdManager.m_ScriptEngine.World == null) | 60 | if (m_CmdManager.m_ScriptEngine.World == null) |
53 | return; | 61 | return; |
54 | IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | ||
55 | 62 | ||
56 | if (comms != null) | 63 | if (m_commsPlugin != null) |
57 | { | 64 | { |
58 | while (comms.HasMessages()) | 65 | while (m_commsPlugin.HasMessages()) |
59 | { | 66 | { |
60 | ListenerInfo lInfo = (ListenerInfo)comms.GetNextMessage(); | 67 | ListenerInfo lInfo = (ListenerInfo)m_commsPlugin.GetNextMessage(); |
61 | 68 | ||
62 | //Deliver data to prim's listen handler | 69 | //Deliver data to prim's listen handler |
63 | object[] resobj = new object[] | 70 | object[] resobj = new object[] |
@@ -81,17 +88,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
81 | 88 | ||
82 | public Object[] GetSerializationData(UUID itemID) | 89 | public Object[] GetSerializationData(UUID itemID) |
83 | { | 90 | { |
84 | IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 91 | return m_commsPlugin.GetSerializationData(itemID); |
85 | |||
86 | return comms.GetSerializationData(itemID); | ||
87 | } | 92 | } |
88 | 93 | ||
89 | public void CreateFromData(uint localID, UUID itemID, UUID hostID, | 94 | public void CreateFromData(uint localID, UUID itemID, UUID hostID, |
90 | Object[] data) | 95 | Object[] data) |
91 | { | 96 | { |
92 | IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 97 | m_commsPlugin.CreateFromData(localID, itemID, hostID, data); |
93 | |||
94 | comms.CreateFromData(localID, itemID, hostID, data); | ||
95 | } | 98 | } |
96 | } | 99 | } |
97 | } | 100 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index fbb7c39..1c272f8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | |||
@@ -44,6 +44,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
44 | 44 | ||
45 | public AsyncCommandManager m_CmdManager; | 45 | public AsyncCommandManager m_CmdManager; |
46 | 46 | ||
47 | /// <summary> | ||
48 | /// Number of sensors active. | ||
49 | /// </summary> | ||
50 | public int SensorsCount | ||
51 | { | ||
52 | get | ||
53 | { | ||
54 | lock (SenseRepeatListLock) | ||
55 | return SenseRepeaters.Count; | ||
56 | } | ||
57 | } | ||
58 | |||
47 | public SensorRepeat(AsyncCommandManager CmdManager) | 59 | public SensorRepeat(AsyncCommandManager CmdManager) |
48 | { | 60 | { |
49 | m_CmdManager = CmdManager; | 61 | m_CmdManager = CmdManager; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs index eeb59d9..bc63030 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs | |||
@@ -37,6 +37,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
37 | { | 37 | { |
38 | public AsyncCommandManager m_CmdManager; | 38 | public AsyncCommandManager m_CmdManager; |
39 | 39 | ||
40 | public int TimersCount | ||
41 | { | ||
42 | get | ||
43 | { | ||
44 | lock (TimerListLock) | ||
45 | return Timers.Count; | ||
46 | } | ||
47 | } | ||
48 | |||
40 | public Timer(AsyncCommandManager CmdManager) | 49 | public Timer(AsyncCommandManager CmdManager) |
41 | { | 50 | { |
42 | m_CmdManager = CmdManager; | 51 | m_CmdManager = CmdManager; |