diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs index 8ab0c30..5b92ff0 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs | |||
@@ -4,6 +4,8 @@ using System.Text; | |||
4 | using System.Threading; | 4 | using System.Threading; |
5 | using libsecondlife; | 5 | using libsecondlife; |
6 | using OpenSim.Region.ScriptEngine.Common; | 6 | using OpenSim.Region.ScriptEngine.Common; |
7 | using OpenSim.Region.Environment.Modules; | ||
8 | using OpenSim.Region.Environment.Interfaces; | ||
7 | 9 | ||
8 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | 10 | namespace OpenSim.Region.ScriptEngine.DotNetEngine |
9 | { | 11 | { |
@@ -26,6 +28,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
26 | cmdHandlerThread.Priority = ThreadPriority.BelowNormal; | 28 | cmdHandlerThread.Priority = ThreadPriority.BelowNormal; |
27 | cmdHandlerThread.IsBackground = true; | 29 | cmdHandlerThread.IsBackground = true; |
28 | cmdHandlerThread.Start(); | 30 | cmdHandlerThread.Start(); |
31 | |||
29 | } | 32 | } |
30 | ~LSLLongCmdHandler() | 33 | ~LSLLongCmdHandler() |
31 | { | 34 | { |
@@ -50,11 +53,19 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
50 | { | 53 | { |
51 | // Check timers | 54 | // Check timers |
52 | CheckTimerEvents(); | 55 | CheckTimerEvents(); |
56 | Thread.Sleep(25); | ||
53 | // Check HttpRequests | 57 | // Check HttpRequests |
54 | CheckHttpRequests(); | 58 | CheckHttpRequests(); |
59 | Thread.Sleep(25); | ||
60 | // Check XMLRPCRequests | ||
61 | CheckXMLRPCRequests(); | ||
62 | Thread.Sleep(25); | ||
63 | // Check Listeners | ||
64 | CheckListeners(); | ||
65 | Thread.Sleep(25); | ||
55 | 66 | ||
56 | // Sleep before next cycle | 67 | // Sleep before next cycle |
57 | Thread.Sleep(cmdHandlerThreadCycleSleepms); | 68 | //Thread.Sleep(cmdHandlerThreadCycleSleepms); |
58 | } | 69 | } |
59 | } | 70 | } |
60 | 71 | ||
@@ -258,5 +269,53 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
258 | } | 269 | } |
259 | #endregion | 270 | #endregion |
260 | 271 | ||
272 | public void CheckXMLRPCRequests() | ||
273 | { | ||
274 | |||
275 | IXMLRPC xmlrpc = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); | ||
276 | |||
277 | while (xmlrpc.hasRequests()) | ||
278 | { | ||
279 | RPCRequestInfo rInfo = xmlrpc.GetNextRequest(); | ||
280 | System.Console.WriteLine("PICKED REQUEST"); | ||
281 | |||
282 | //Deliver data to prim's remote_data handler | ||
283 | object[] resobj = new object[] { | ||
284 | 2, rInfo.GetChannelKey().ToString(), rInfo.GetMessageID().ToString(), "", rInfo.GetIntValue(), rInfo.GetStrVal() | ||
285 | }; | ||
286 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | ||
287 | rInfo.GetLocalID(), rInfo.GetItemID(), "remote_data", resobj | ||
288 | ); | ||
289 | |||
290 | } | ||
291 | |||
292 | } | ||
293 | |||
294 | public void CheckListeners() | ||
295 | { | ||
296 | |||
297 | IWorldComm comms = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | ||
298 | |||
299 | while (comms.HasMessages()) | ||
300 | { | ||
301 | ListenerInfo lInfo = comms.GetNextMessage(); | ||
302 | System.Console.WriteLine("PICKED LISTENER"); | ||
303 | |||
304 | //Deliver data to prim's listen handler | ||
305 | object[] resobj = new object[] { | ||
306 | lInfo.GetChannel(), lInfo.GetName(), lInfo.GetID().ToString(), lInfo.GetMessage() | ||
307 | }; | ||
308 | |||
309 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | ||
310 | lInfo.GetLocalID(), lInfo.GetItemID(), "listen", resobj | ||
311 | ); | ||
312 | |||
313 | } | ||
314 | |||
315 | } | ||
316 | |||
317 | |||
318 | |||
319 | |||
261 | } | 320 | } |
262 | } | 321 | } |