diff options
author | Teravus Ovares | 2008-09-06 07:52:41 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-09-06 07:52:41 +0000 |
commit | 7d89e122930be39e84a6d174548fa2d12ac0484a (patch) | |
tree | e5aa5752f988a9aba2a969f49e5e208985eda80c /OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs | |
parent | * minor: speculatively try a change to bamboo.build to see if this generates ... (diff) | |
download | opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.zip opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.gz opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.bz2 opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.xz |
* This is the fabled LibOMV update with all of the libOMV types from JHurliman
* This is a HUGE OMG update and will definitely have unknown side effects.. so this is really only for the strong hearted at this point. Regular people should let the dust settle.
* This has been tested to work with most basic functions. However.. make sure you back up 'everything' before using this. It's that big!
* Essentially we're back at square 1 in the testing phase.. so lets identify things that broke.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs index bde90bc..85aa344 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs | |||
@@ -31,7 +31,7 @@ using System.Collections.Generic; | |||
31 | using System.Net; | 31 | using System.Net; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Threading; | 33 | using System.Threading; |
34 | using libsecondlife; | 34 | using OpenMetaverse; |
35 | using log4net; | 35 | using log4net; |
36 | using Nini.Config; | 36 | using Nini.Config; |
37 | using Nwc.XmlRpc; | 37 | using Nwc.XmlRpc; |
@@ -82,12 +82,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
82 | private string m_name = "XMLRPCModule"; | 82 | private string m_name = "XMLRPCModule"; |
83 | 83 | ||
84 | // <channel id, RPCChannelInfo> | 84 | // <channel id, RPCChannelInfo> |
85 | private Dictionary<LLUUID, RPCChannelInfo> m_openChannels; | 85 | private Dictionary<UUID, RPCChannelInfo> m_openChannels; |
86 | private Dictionary<LLUUID, SendRemoteDataRequest> m_pendingSRDResponses; | 86 | private Dictionary<UUID, SendRemoteDataRequest> m_pendingSRDResponses; |
87 | private int m_remoteDataPort = 0; | 87 | private int m_remoteDataPort = 0; |
88 | 88 | ||
89 | private Dictionary<LLUUID, RPCRequestInfo> m_rpcPending; | 89 | private Dictionary<UUID, RPCRequestInfo> m_rpcPending; |
90 | private Dictionary<LLUUID, RPCRequestInfo> m_rpcPendingResponses; | 90 | private Dictionary<UUID, RPCRequestInfo> m_rpcPendingResponses; |
91 | private List<Scene> m_scenes = new List<Scene>(); | 91 | private List<Scene> m_scenes = new List<Scene>(); |
92 | private int RemoteReplyScriptTimeout = 9000; | 92 | private int RemoteReplyScriptTimeout = 9000; |
93 | private int RemoteReplyScriptWait = 300; | 93 | private int RemoteReplyScriptWait = 300; |
@@ -102,10 +102,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
102 | // get called only one time (or we lose any open channels) | 102 | // get called only one time (or we lose any open channels) |
103 | if (null == m_openChannels) | 103 | if (null == m_openChannels) |
104 | { | 104 | { |
105 | m_openChannels = new Dictionary<LLUUID, RPCChannelInfo>(); | 105 | m_openChannels = new Dictionary<UUID, RPCChannelInfo>(); |
106 | m_rpcPending = new Dictionary<LLUUID, RPCRequestInfo>(); | 106 | m_rpcPending = new Dictionary<UUID, RPCRequestInfo>(); |
107 | m_rpcPendingResponses = new Dictionary<LLUUID, RPCRequestInfo>(); | 107 | m_rpcPendingResponses = new Dictionary<UUID, RPCRequestInfo>(); |
108 | m_pendingSRDResponses = new Dictionary<LLUUID, SendRemoteDataRequest>(); | 108 | m_pendingSRDResponses = new Dictionary<UUID, SendRemoteDataRequest>(); |
109 | 109 | ||
110 | try | 110 | try |
111 | { | 111 | { |
@@ -164,11 +164,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
164 | /********************************************** | 164 | /********************************************** |
165 | * OpenXMLRPCChannel | 165 | * OpenXMLRPCChannel |
166 | * | 166 | * |
167 | * Generate a LLUUID channel key and add it and | 167 | * Generate a UUID channel key and add it and |
168 | * the prim id to dictionary <channelUUID, primUUID> | 168 | * the prim id to dictionary <channelUUID, primUUID> |
169 | * | 169 | * |
170 | * A custom channel key can be proposed. | 170 | * A custom channel key can be proposed. |
171 | * Otherwise, passing LLUUID.Zero will generate | 171 | * Otherwise, passing UUID.Zero will generate |
172 | * and return a random channel | 172 | * and return a random channel |
173 | * | 173 | * |
174 | * First check if there is a channel assigned for | 174 | * First check if there is a channel assigned for |
@@ -179,9 +179,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
179 | * | 179 | * |
180 | * ********************************************/ | 180 | * ********************************************/ |
181 | 181 | ||
182 | public LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID, LLUUID channelID) | 182 | public UUID OpenXMLRPCChannel(uint localID, UUID itemID, UUID channelID) |
183 | { | 183 | { |
184 | LLUUID newChannel = LLUUID.Zero; | 184 | UUID newChannel = UUID.Zero; |
185 | 185 | ||
186 | // This should no longer happen, but the check is reasonable anyway | 186 | // This should no longer happen, but the check is reasonable anyway |
187 | if (null == m_openChannels) | 187 | if (null == m_openChannels) |
@@ -201,9 +201,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
201 | } | 201 | } |
202 | } | 202 | } |
203 | 203 | ||
204 | if (newChannel == LLUUID.Zero) | 204 | if (newChannel == UUID.Zero) |
205 | { | 205 | { |
206 | newChannel = (channelID == LLUUID.Zero) ? LLUUID.Random() : channelID; | 206 | newChannel = (channelID == UUID.Zero) ? UUID.Random() : channelID; |
207 | RPCChannelInfo rpcChanInfo = new RPCChannelInfo(localID, itemID, newChannel); | 207 | RPCChannelInfo rpcChanInfo = new RPCChannelInfo(localID, itemID, newChannel); |
208 | lock (XMLRPCListLock) | 208 | lock (XMLRPCListLock) |
209 | { | 209 | { |
@@ -216,7 +216,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
216 | 216 | ||
217 | // Delete channels based on itemID | 217 | // Delete channels based on itemID |
218 | // for when a script is deleted | 218 | // for when a script is deleted |
219 | public void DeleteChannels(LLUUID itemID) | 219 | public void DeleteChannels(UUID itemID) |
220 | { | 220 | { |
221 | if (m_openChannels != null) | 221 | if (m_openChannels != null) |
222 | { | 222 | { |
@@ -234,7 +234,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
234 | 234 | ||
235 | IEnumerator tmpEnumerator = tmp.GetEnumerator(); | 235 | IEnumerator tmpEnumerator = tmp.GetEnumerator(); |
236 | while (tmpEnumerator.MoveNext()) | 236 | while (tmpEnumerator.MoveNext()) |
237 | m_openChannels.Remove((LLUUID) tmpEnumerator.Current); | 237 | m_openChannels.Remove((UUID) tmpEnumerator.Current); |
238 | } | 238 | } |
239 | } | 239 | } |
240 | } | 240 | } |
@@ -248,12 +248,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
248 | 248 | ||
249 | public void RemoteDataReply(string channel, string message_id, string sdata, int idata) | 249 | public void RemoteDataReply(string channel, string message_id, string sdata, int idata) |
250 | { | 250 | { |
251 | LLUUID message_key = new LLUUID(message_id); | 251 | UUID message_key = new UUID(message_id); |
252 | LLUUID channel_key = new LLUUID(channel); | 252 | UUID channel_key = new UUID(channel); |
253 | 253 | ||
254 | RPCRequestInfo rpcInfo = null; | 254 | RPCRequestInfo rpcInfo = null; |
255 | 255 | ||
256 | if (message_key == LLUUID.Zero) | 256 | if (message_key == UUID.Zero) |
257 | { | 257 | { |
258 | foreach (RPCRequestInfo oneRpcInfo in m_rpcPendingResponses.Values) | 258 | foreach (RPCRequestInfo oneRpcInfo in m_rpcPendingResponses.Values) |
259 | if (oneRpcInfo.GetChannelKey() == channel_key) | 259 | if (oneRpcInfo.GetChannelKey() == channel_key) |
@@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
284 | * | 284 | * |
285 | *********************************************/ | 285 | *********************************************/ |
286 | 286 | ||
287 | public void CloseXMLRPCChannel(LLUUID channelKey) | 287 | public void CloseXMLRPCChannel(UUID channelKey) |
288 | { | 288 | { |
289 | if (m_openChannels.ContainsKey(channelKey)) | 289 | if (m_openChannels.ContainsKey(channelKey)) |
290 | m_openChannels.Remove(channelKey); | 290 | m_openChannels.Remove(channelKey); |
@@ -308,7 +308,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
308 | { | 308 | { |
309 | lock (XMLRPCListLock) | 309 | lock (XMLRPCListLock) |
310 | { | 310 | { |
311 | foreach (LLUUID luid in m_rpcPending.Keys) | 311 | foreach (UUID luid in m_rpcPending.Keys) |
312 | { | 312 | { |
313 | RPCRequestInfo tmpReq; | 313 | RPCRequestInfo tmpReq; |
314 | 314 | ||
@@ -322,7 +322,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
322 | return null; | 322 | return null; |
323 | } | 323 | } |
324 | 324 | ||
325 | public void RemoveCompletedRequest(LLUUID id) | 325 | public void RemoveCompletedRequest(UUID id) |
326 | { | 326 | { |
327 | lock (XMLRPCListLock) | 327 | lock (XMLRPCListLock) |
328 | { | 328 | { |
@@ -339,7 +339,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
339 | } | 339 | } |
340 | } | 340 | } |
341 | 341 | ||
342 | public LLUUID SendRemoteData(uint localID, LLUUID itemID, string channel, string dest, int idata, string sdata) | 342 | public UUID SendRemoteData(uint localID, UUID itemID, string channel, string dest, int idata, string sdata) |
343 | { | 343 | { |
344 | SendRemoteDataRequest req = new SendRemoteDataRequest( | 344 | SendRemoteDataRequest req = new SendRemoteDataRequest( |
345 | localID, itemID, channel, dest, idata, sdata | 345 | localID, itemID, channel, dest, idata, sdata |
@@ -354,7 +354,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
354 | { | 354 | { |
355 | lock (XMLRPCListLock) | 355 | lock (XMLRPCListLock) |
356 | { | 356 | { |
357 | foreach (LLUUID luid in m_pendingSRDResponses.Keys) | 357 | foreach (UUID luid in m_pendingSRDResponses.Keys) |
358 | { | 358 | { |
359 | SendRemoteDataRequest tmpReq; | 359 | SendRemoteDataRequest tmpReq; |
360 | 360 | ||
@@ -369,7 +369,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
369 | return null; | 369 | return null; |
370 | } | 370 | } |
371 | 371 | ||
372 | public void RemoveCompletedSRDRequest(LLUUID id) | 372 | public void RemoveCompletedSRDRequest(UUID id) |
373 | { | 373 | { |
374 | lock (XMLRPCListLock) | 374 | lock (XMLRPCListLock) |
375 | { | 375 | { |
@@ -381,7 +381,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
381 | } | 381 | } |
382 | } | 382 | } |
383 | 383 | ||
384 | public void CancelSRDRequests(LLUUID itemID) | 384 | public void CancelSRDRequests(UUID itemID) |
385 | { | 385 | { |
386 | if (m_pendingSRDResponses != null) | 386 | if (m_pendingSRDResponses != null) |
387 | { | 387 | { |
@@ -408,7 +408,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
408 | 408 | ||
409 | if (GoodXML) | 409 | if (GoodXML) |
410 | { | 410 | { |
411 | LLUUID channel = new LLUUID((string) requestData["Channel"]); | 411 | UUID channel = new UUID((string) requestData["Channel"]); |
412 | RPCChannelInfo rpcChanInfo; | 412 | RPCChannelInfo rpcChanInfo; |
413 | if (m_openChannels.TryGetValue(channel, out rpcChanInfo)) | 413 | if (m_openChannels.TryGetValue(channel, out rpcChanInfo)) |
414 | { | 414 | { |
@@ -462,24 +462,24 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
462 | 462 | ||
463 | public class RPCRequestInfo | 463 | public class RPCRequestInfo |
464 | { | 464 | { |
465 | private LLUUID m_ChannelKey; | 465 | private UUID m_ChannelKey; |
466 | private string m_IntVal; | 466 | private string m_IntVal; |
467 | private LLUUID m_ItemID; | 467 | private UUID m_ItemID; |
468 | private uint m_localID; | 468 | private uint m_localID; |
469 | private LLUUID m_MessageID; | 469 | private UUID m_MessageID; |
470 | private bool m_processed; | 470 | private bool m_processed; |
471 | private int m_respInt; | 471 | private int m_respInt; |
472 | private string m_respStr; | 472 | private string m_respStr; |
473 | private string m_StrVal; | 473 | private string m_StrVal; |
474 | 474 | ||
475 | public RPCRequestInfo(uint localID, LLUUID itemID, LLUUID channelKey, string strVal, string intVal) | 475 | public RPCRequestInfo(uint localID, UUID itemID, UUID channelKey, string strVal, string intVal) |
476 | { | 476 | { |
477 | m_localID = localID; | 477 | m_localID = localID; |
478 | m_StrVal = strVal; | 478 | m_StrVal = strVal; |
479 | m_IntVal = intVal; | 479 | m_IntVal = intVal; |
480 | m_ItemID = itemID; | 480 | m_ItemID = itemID; |
481 | m_ChannelKey = channelKey; | 481 | m_ChannelKey = channelKey; |
482 | m_MessageID = LLUUID.Random(); | 482 | m_MessageID = UUID.Random(); |
483 | m_processed = false; | 483 | m_processed = false; |
484 | m_respStr = String.Empty; | 484 | m_respStr = String.Empty; |
485 | m_respInt = 0; | 485 | m_respInt = 0; |
@@ -490,7 +490,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
490 | return m_processed; | 490 | return m_processed; |
491 | } | 491 | } |
492 | 492 | ||
493 | public LLUUID GetChannelKey() | 493 | public UUID GetChannelKey() |
494 | { | 494 | { |
495 | return m_ChannelKey; | 495 | return m_ChannelKey; |
496 | } | 496 | } |
@@ -525,7 +525,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
525 | return m_localID; | 525 | return m_localID; |
526 | } | 526 | } |
527 | 527 | ||
528 | public LLUUID GetItemID() | 528 | public UUID GetItemID() |
529 | { | 529 | { |
530 | return m_ItemID; | 530 | return m_ItemID; |
531 | } | 531 | } |
@@ -540,7 +540,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
540 | return int.Parse(m_IntVal); | 540 | return int.Parse(m_IntVal); |
541 | } | 541 | } |
542 | 542 | ||
543 | public LLUUID GetMessageID() | 543 | public UUID GetMessageID() |
544 | { | 544 | { |
545 | return m_MessageID; | 545 | return m_MessageID; |
546 | } | 546 | } |
@@ -548,23 +548,23 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
548 | 548 | ||
549 | public class RPCChannelInfo | 549 | public class RPCChannelInfo |
550 | { | 550 | { |
551 | private LLUUID m_ChannelKey; | 551 | private UUID m_ChannelKey; |
552 | private LLUUID m_itemID; | 552 | private UUID m_itemID; |
553 | private uint m_localID; | 553 | private uint m_localID; |
554 | 554 | ||
555 | public RPCChannelInfo(uint localID, LLUUID itemID, LLUUID channelID) | 555 | public RPCChannelInfo(uint localID, UUID itemID, UUID channelID) |
556 | { | 556 | { |
557 | m_ChannelKey = channelID; | 557 | m_ChannelKey = channelID; |
558 | m_localID = localID; | 558 | m_localID = localID; |
559 | m_itemID = itemID; | 559 | m_itemID = itemID; |
560 | } | 560 | } |
561 | 561 | ||
562 | public LLUUID GetItemID() | 562 | public UUID GetItemID() |
563 | { | 563 | { |
564 | return m_itemID; | 564 | return m_itemID; |
565 | } | 565 | } |
566 | 566 | ||
567 | public LLUUID GetChannelID() | 567 | public UUID GetChannelID() |
568 | { | 568 | { |
569 | return m_ChannelKey; | 569 | return m_ChannelKey; |
570 | } | 570 | } |
@@ -583,15 +583,15 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
583 | public bool finished; | 583 | public bool finished; |
584 | private Thread httpThread; | 584 | private Thread httpThread; |
585 | public int idata; | 585 | public int idata; |
586 | public LLUUID m_itemID; | 586 | public UUID m_itemID; |
587 | public uint m_localID; | 587 | public uint m_localID; |
588 | public LLUUID reqID; | 588 | public UUID reqID; |
589 | public XmlRpcRequest request; | 589 | public XmlRpcRequest request; |
590 | public int response_idata; | 590 | public int response_idata; |
591 | public string response_sdata; | 591 | public string response_sdata; |
592 | public string sdata; | 592 | public string sdata; |
593 | 593 | ||
594 | public SendRemoteDataRequest(uint localID, LLUUID itemID, string channel, string dest, int idata, string sdata) | 594 | public SendRemoteDataRequest(uint localID, UUID itemID, string channel, string dest, int idata, string sdata) |
595 | { | 595 | { |
596 | this.channel = channel; | 596 | this.channel = channel; |
597 | destURL = dest; | 597 | destURL = dest; |
@@ -600,10 +600,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
600 | m_itemID = itemID; | 600 | m_itemID = itemID; |
601 | m_localID = localID; | 601 | m_localID = localID; |
602 | 602 | ||
603 | reqID = LLUUID.Random(); | 603 | reqID = UUID.Random(); |
604 | } | 604 | } |
605 | 605 | ||
606 | public LLUUID process() | 606 | public UUID process() |
607 | { | 607 | { |
608 | httpThread = new Thread(SendRequest); | 608 | httpThread = new Thread(SendRequest); |
609 | httpThread.Name = "HttpRequestThread"; | 609 | httpThread.Name = "HttpRequestThread"; |
@@ -625,12 +625,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
625 | { | 625 | { |
626 | Hashtable param = new Hashtable(); | 626 | Hashtable param = new Hashtable(); |
627 | 627 | ||
628 | // Check if channel is an LLUUID | 628 | // Check if channel is an UUID |
629 | // if not, use as method name | 629 | // if not, use as method name |
630 | LLUUID parseUID; | 630 | UUID parseUID; |
631 | string mName = "llRemoteData"; | 631 | string mName = "llRemoteData"; |
632 | if ((channel != null) && (channel != "")) | 632 | if ((channel != null) && (channel != "")) |
633 | if (!LLUUID.TryParse(channel, out parseUID)) | 633 | if (!UUID.TryParse(channel, out parseUID)) |
634 | mName = channel; | 634 | mName = channel; |
635 | else | 635 | else |
636 | param["Channel"] = channel; | 636 | param["Channel"] = channel; |
@@ -698,7 +698,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
698 | } | 698 | } |
699 | } | 699 | } |
700 | 700 | ||
701 | public LLUUID GetReqID() | 701 | public UUID GetReqID() |
702 | { | 702 | { |
703 | return reqID; | 703 | return reqID; |
704 | } | 704 | } |