diff options
author | Sean Dague | 2008-02-19 19:16:21 +0000 |
---|---|---|
committer | Sean Dague | 2008-02-19 19:16:21 +0000 |
commit | 530cc2488461a4ef68a06eaba42698fcdc09f459 (patch) | |
tree | d2db34a2dcdb10b3b85aaeb200334ee9a27cae91 /OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncLSLCommandManager.cs | |
parent | Added to OpenSim.ini.example: (diff) | |
download | opensim-SC_OLD-530cc2488461a4ef68a06eaba42698fcdc09f459.zip opensim-SC_OLD-530cc2488461a4ef68a06eaba42698fcdc09f459.tar.gz opensim-SC_OLD-530cc2488461a4ef68a06eaba42698fcdc09f459.tar.bz2 opensim-SC_OLD-530cc2488461a4ef68a06eaba42698fcdc09f459.tar.xz |
From: Michael Osias <mosias@us.ibm.com>
This patch implements the llSendRemoteData command and fixes mantis 552,
and possibly 586.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncLSLCommandManager.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncLSLCommandManager.cs | 104 |
1 files changed, 80 insertions, 24 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncLSLCommandManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncLSLCommandManager.cs index 1afe71c..0491612 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncLSLCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncLSLCommandManager.cs | |||
@@ -125,8 +125,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
125 | comms.DeleteListener(itemID); | 125 | comms.DeleteListener(itemID); |
126 | 126 | ||
127 | IXMLRPC xmlrpc = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); | 127 | IXMLRPC xmlrpc = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); |
128 | xmlrpc.DeleteChannel(itemID); | 128 | xmlrpc.DeleteChannels(itemID); |
129 | 129 | ||
130 | xmlrpc.CancelSRDRequests(itemID); | ||
131 | |||
130 | } | 132 | } |
131 | 133 | ||
132 | #region TIMER | 134 | #region TIMER |
@@ -238,24 +240,29 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
238 | // implemented here yet anyway. Should be fixed if/when maxsize | 240 | // implemented here yet anyway. Should be fixed if/when maxsize |
239 | // is supported | 241 | // is supported |
240 | 242 | ||
241 | object[] resobj = new object[] | 243 | if (m_ScriptEngine.m_ScriptManager.GetScript(httpInfo.localID, httpInfo.itemID) != null) |
244 | { | ||
245 | iHttpReq.RemoveCompletedRequest(httpInfo.reqID); | ||
246 | object[] resobj = new object[] | ||
242 | { | 247 | { |
243 | httpInfo.reqID.ToString(), httpInfo.status, null, httpInfo.response_body | 248 | httpInfo.reqID.ToString(), httpInfo.status, null, httpInfo.response_body |
244 | }; | 249 | }; |
245 | 250 | ||
246 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 251 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
247 | httpInfo.localID, httpInfo.itemID, "http_response", EventQueueManager.llDetectNull, resobj | 252 | httpInfo.localID, httpInfo.itemID, "http_response", EventQueueManager.llDetectNull, resobj |
248 | ); | 253 | ); |
249 | 254 | ||
250 | httpInfo.Stop(); | 255 | } |
251 | httpInfo = null; | ||
252 | 256 | ||
253 | httpInfo = iHttpReq.GetNextCompletedRequest(); | 257 | httpInfo = iHttpReq.GetNextCompletedRequest(); |
258 | |||
254 | } | 259 | } |
255 | } | 260 | } |
256 | 261 | ||
257 | #endregion | 262 | #endregion |
258 | 263 | ||
264 | #region Check llRemoteData channels | ||
265 | |||
259 | public void CheckXMLRPCRequests() | 266 | public void CheckXMLRPCRequests() |
260 | { | 267 | { |
261 | if (m_ScriptEngine.World == null) | 268 | if (m_ScriptEngine.World == null) |
@@ -265,47 +272,96 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
265 | 272 | ||
266 | if (xmlrpc != null) | 273 | if (xmlrpc != null) |
267 | { | 274 | { |
268 | while (xmlrpc.hasRequests()) | 275 | RPCRequestInfo rInfo = xmlrpc.GetNextCompletedRequest(); |
276 | |||
277 | while (rInfo != null) | ||
269 | { | 278 | { |
270 | RPCRequestInfo rInfo = xmlrpc.GetNextRequest(); | 279 | if (m_ScriptEngine.m_ScriptManager.GetScript(rInfo.GetLocalID(), rInfo.GetItemID()) != null) |
271 | //Console.WriteLine("PICKED REQUEST"); | 280 | { |
281 | xmlrpc.RemoveCompletedRequest(rInfo.GetMessageID()); | ||
272 | 282 | ||
273 | //Deliver data to prim's remote_data handler | 283 | //Deliver data to prim's remote_data handler |
274 | object[] resobj = new object[] | 284 | object[] resobj = new object[] |
275 | { | 285 | { |
276 | 2, rInfo.GetChannelKey().ToString(), rInfo.GetMessageID().ToString(), String.Empty, | 286 | 2, rInfo.GetChannelKey().ToString(), rInfo.GetMessageID().ToString(), String.Empty, |
277 | rInfo.GetIntValue(), | 287 | rInfo.GetIntValue(), |
278 | rInfo.GetStrVal() | 288 | rInfo.GetStrVal() |
279 | }; | 289 | }; |
280 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 290 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
281 | rInfo.GetLocalID(), rInfo.GetItemID(), "remote_data", EventQueueManager.llDetectNull, resobj | 291 | rInfo.GetLocalID(), rInfo.GetItemID(), "remote_data", EventQueueManager.llDetectNull, resobj |
282 | ); | 292 | ); |
293 | |||
294 | } | ||
295 | |||
296 | rInfo = xmlrpc.GetNextCompletedRequest(); | ||
297 | |||
283 | } | 298 | } |
299 | |||
300 | SendRemoteDataRequest srdInfo = xmlrpc.GetNextCompletedSRDRequest(); | ||
301 | |||
302 | while (srdInfo != null) | ||
303 | { | ||
304 | if (m_ScriptEngine.m_ScriptManager.GetScript(srdInfo.m_localID, srdInfo.m_itemID) != null) | ||
305 | { | ||
306 | xmlrpc.RemoveCompletedSRDRequest(srdInfo.GetReqID()); | ||
307 | |||
308 | //Deliver data to prim's remote_data handler | ||
309 | object[] resobj = new object[] | ||
310 | { | ||
311 | 3, srdInfo.channel.ToString(), srdInfo.GetReqID().ToString(), String.Empty, | ||
312 | srdInfo.idata, | ||
313 | srdInfo.sdata | ||
314 | }; | ||
315 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | ||
316 | srdInfo.m_localID, srdInfo.m_itemID, "remote_data", EventQueueManager.llDetectNull, resobj | ||
317 | ); | ||
318 | |||
319 | } | ||
320 | |||
321 | srdInfo = xmlrpc.GetNextCompletedSRDRequest(); | ||
322 | |||
323 | } | ||
324 | |||
325 | |||
284 | } | 326 | } |
285 | } | 327 | } |
286 | 328 | ||
329 | #endregion | ||
330 | |||
331 | #region Check llListeners | ||
332 | |||
287 | public void CheckListeners() | 333 | public void CheckListeners() |
288 | { | 334 | { |
289 | if (m_ScriptEngine.World == null) | 335 | if (m_ScriptEngine.World == null) |
290 | return; | 336 | return; |
291 | IWorldComm comms = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 337 | IWorldComm comms = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
292 | 338 | ||
293 | while (comms.HasMessages()) | 339 | if (comms != null) |
294 | { | 340 | { |
295 | ListenerInfo lInfo = comms.GetNextMessage(); | 341 | while (comms.HasMessages()) |
296 | 342 | { | |
297 | //Deliver data to prim's listen handler | 343 | if (m_ScriptEngine.m_ScriptManager.GetScript( |
298 | object[] resobj = new object[] | 344 | comms.PeekNextMessageLocalID(), comms.PeekNextMessageItemID()) != null) |
299 | { | 345 | { |
300 | lInfo.GetChannel(), lInfo.GetName(), lInfo.GetID().ToString(), lInfo.GetMessage() | 346 | ListenerInfo lInfo = comms.GetNextMessage(); |
301 | }; | ||
302 | 347 | ||
303 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 348 | //Deliver data to prim's listen handler |
304 | lInfo.GetLocalID(), lInfo.GetItemID(), "listen", EventQueueManager.llDetectNull, resobj | 349 | object[] resobj = new object[] |
305 | ); | 350 | { |
351 | lInfo.GetChannel(), lInfo.GetName(), lInfo.GetID().ToString(), lInfo.GetMessage() | ||
352 | }; | ||
353 | |||
354 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | ||
355 | lInfo.GetLocalID(), lInfo.GetItemID(), "listen", EventQueueManager.llDetectNull, resobj | ||
356 | ); | ||
357 | } | ||
358 | |||
359 | } | ||
306 | } | 360 | } |
307 | } | 361 | } |
308 | 362 | ||
363 | #endregion | ||
364 | |||
309 | /// <summary> | 365 | /// <summary> |
310 | /// If set to true then threads and stuff should try to make a graceful exit | 366 | /// If set to true then threads and stuff should try to make a graceful exit |
311 | /// </summary> | 367 | /// </summary> |
@@ -317,4 +373,4 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
317 | private bool _PleaseShutdown = false; | 373 | private bool _PleaseShutdown = false; |
318 | 374 | ||
319 | } | 375 | } |
320 | } \ No newline at end of file | 376 | } |