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/Avatar/InstantMessage/InstantMessageModule.cs | |
parent | * minor: speculatively try a change to bamboo.build to see if this generates ... (diff) | |
download | opensim-SC-7d89e122930be39e84a6d174548fa2d12ac0484a.zip opensim-SC-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.gz opensim-SC-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.bz2 opensim-SC-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/Avatar/InstantMessage/InstantMessageModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs index bb3303f..6b2de80 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs | |||
@@ -30,7 +30,7 @@ using System.Collections.Generic; | |||
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Net; | 31 | using System.Net; |
32 | using System.Threading; | 32 | using System.Threading; |
33 | using libsecondlife; | 33 | using OpenMetaverse; |
34 | using log4net; | 34 | using log4net; |
35 | using Nini.Config; | 35 | using Nini.Config; |
36 | using Nwc.XmlRpc; | 36 | using Nwc.XmlRpc; |
@@ -45,7 +45,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | private readonly List<Scene> m_scenes = new List<Scene>(); | 47 | private readonly List<Scene> m_scenes = new List<Scene>(); |
48 | private Dictionary<LLUUID, ulong> m_userRegionMap = new Dictionary<LLUUID, ulong>(); | 48 | private Dictionary<UUID, ulong> m_userRegionMap = new Dictionary<UUID, ulong>(); |
49 | 49 | ||
50 | #region IRegionModule Members | 50 | #region IRegionModule Members |
51 | 51 | ||
@@ -106,11 +106,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
106 | client.OnInstantMessage += OnInstantMessage; | 106 | client.OnInstantMessage += OnInstantMessage; |
107 | } | 107 | } |
108 | 108 | ||
109 | private void OnInstantMessage(IClientAPI client, LLUUID fromAgentID, | 109 | private void OnInstantMessage(IClientAPI client, UUID fromAgentID, |
110 | LLUUID fromAgentSession, LLUUID toAgentID, | 110 | UUID fromAgentSession, UUID toAgentID, |
111 | LLUUID imSessionID, uint timestamp, string fromAgentName, | 111 | UUID imSessionID, uint timestamp, string fromAgentName, |
112 | string message, byte dialog, bool fromGroup, byte offline, | 112 | string message, byte dialog, bool fromGroup, byte offline, |
113 | uint ParentEstateID, LLVector3 Position, LLUUID RegionID, | 113 | uint ParentEstateID, Vector3 Position, UUID RegionID, |
114 | byte[] binaryBucket) | 114 | byte[] binaryBucket) |
115 | { | 115 | { |
116 | bool dialogHandledElsewhere | 116 | bool dialogHandledElsewhere |
@@ -122,8 +122,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
122 | // IM dialogs need to be pre-processed and have their sessionID filled by the server | 122 | // IM dialogs need to be pre-processed and have their sessionID filled by the server |
123 | // so the sim can match the transaction on the return packet. | 123 | // so the sim can match the transaction on the return packet. |
124 | 124 | ||
125 | // Don't send a Friend Dialog IM with a LLUUID.Zero session. | 125 | // Don't send a Friend Dialog IM with a UUID.Zero session. |
126 | if (!(dialogHandledElsewhere && imSessionID == LLUUID.Zero)) | 126 | if (!(dialogHandledElsewhere && imSessionID == UUID.Zero)) |
127 | { | 127 | { |
128 | // Try root avatar only first | 128 | // Try root avatar only first |
129 | foreach (Scene scene in m_scenes) | 129 | foreach (Scene scene in m_scenes) |
@@ -195,10 +195,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
195 | private void OnGridInstantMessage(GridInstantMessage msg) | 195 | private void OnGridInstantMessage(GridInstantMessage msg) |
196 | { | 196 | { |
197 | // Trigger the above event handler | 197 | // Trigger the above event handler |
198 | OnInstantMessage(null, new LLUUID(msg.fromAgentID), new LLUUID(msg.fromAgentSession), | 198 | OnInstantMessage(null, new UUID(msg.fromAgentID), new UUID(msg.fromAgentSession), |
199 | new LLUUID(msg.toAgentID), new LLUUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, | 199 | new UUID(msg.toAgentID), new UUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, |
200 | msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID, | 200 | msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID, |
201 | new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID), | 201 | new Vector3(msg.Position.X, msg.Position.Y, msg.Position.Z), new UUID(msg.RegionID), |
202 | msg.binaryBucket); | 202 | msg.binaryBucket); |
203 | } | 203 | } |
204 | 204 | ||
@@ -214,10 +214,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
214 | { | 214 | { |
215 | bool successful = false; | 215 | bool successful = false; |
216 | // various rational defaults | 216 | // various rational defaults |
217 | LLUUID fromAgentID = LLUUID.Zero; | 217 | UUID fromAgentID = UUID.Zero; |
218 | LLUUID fromAgentSession = LLUUID.Zero; | 218 | UUID fromAgentSession = UUID.Zero; |
219 | LLUUID toAgentID = LLUUID.Zero; | 219 | UUID toAgentID = UUID.Zero; |
220 | LLUUID imSessionID = LLUUID.Zero; | 220 | UUID imSessionID = UUID.Zero; |
221 | uint timestamp = 0; | 221 | uint timestamp = 0; |
222 | string fromAgentName = ""; | 222 | string fromAgentName = ""; |
223 | string message = ""; | 223 | string message = ""; |
@@ -225,8 +225,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
225 | bool fromGroup = false; | 225 | bool fromGroup = false; |
226 | byte offline = (byte)0; | 226 | byte offline = (byte)0; |
227 | uint ParentEstateID=0; | 227 | uint ParentEstateID=0; |
228 | LLVector3 Position = LLVector3.Zero; | 228 | Vector3 Position = Vector3.Zero; |
229 | LLUUID RegionID = LLUUID.Zero ; | 229 | UUID RegionID = UUID.Zero ; |
230 | byte[] binaryBucket = new byte[0]; | 230 | byte[] binaryBucket = new byte[0]; |
231 | 231 | ||
232 | float pos_x = 0; | 232 | float pos_x = 0; |
@@ -248,11 +248,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
248 | && requestData.ContainsKey("binary_bucket") && requestData.ContainsKey("region_handle")) | 248 | && requestData.ContainsKey("binary_bucket") && requestData.ContainsKey("region_handle")) |
249 | { | 249 | { |
250 | // Do the easy way of validating the UUIDs | 250 | // Do the easy way of validating the UUIDs |
251 | Helpers.TryParse((string)requestData["from_agent_id"], out fromAgentID); | 251 | UUID.TryParse((string)requestData["from_agent_id"], out fromAgentID); |
252 | Helpers.TryParse((string)requestData["from_agent_session"], out fromAgentSession); | 252 | UUID.TryParse((string)requestData["from_agent_session"], out fromAgentSession); |
253 | Helpers.TryParse((string)requestData["to_agent_id"], out toAgentID); | 253 | UUID.TryParse((string)requestData["to_agent_id"], out toAgentID); |
254 | Helpers.TryParse((string)requestData["im_session_id"], out imSessionID); | 254 | UUID.TryParse((string)requestData["im_session_id"], out imSessionID); |
255 | Helpers.TryParse((string)requestData["region_id"], out RegionID); | 255 | UUID.TryParse((string)requestData["region_id"], out RegionID); |
256 | 256 | ||
257 | # region timestamp | 257 | # region timestamp |
258 | try | 258 | try |
@@ -345,24 +345,24 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
345 | } | 345 | } |
346 | # endregion | 346 | # endregion |
347 | 347 | ||
348 | Position = new LLVector3(pos_x, pos_y, pos_z); | 348 | Position = new Vector3(pos_x, pos_y, pos_z); |
349 | binaryBucket = Convert.FromBase64String((string)requestData["binary_bucket"]); | 349 | binaryBucket = Convert.FromBase64String((string)requestData["binary_bucket"]); |
350 | 350 | ||
351 | // Create a New GridInstantMessageObject the the data | 351 | // Create a New GridInstantMessageObject the the data |
352 | GridInstantMessage gim = new GridInstantMessage(); | 352 | GridInstantMessage gim = new GridInstantMessage(); |
353 | gim.fromAgentID = fromAgentID.UUID; | 353 | gim.fromAgentID = fromAgentID.Guid; |
354 | gim.fromAgentName = fromAgentName; | 354 | gim.fromAgentName = fromAgentName; |
355 | gim.fromAgentSession = fromAgentSession.UUID; | 355 | gim.fromAgentSession = fromAgentSession.Guid; |
356 | gim.fromGroup = fromGroup; | 356 | gim.fromGroup = fromGroup; |
357 | gim.imSessionID = imSessionID.UUID; | 357 | gim.imSessionID = imSessionID.Guid; |
358 | gim.RegionID = RegionID.UUID; | 358 | gim.RegionID = RegionID.Guid; |
359 | gim.timestamp = timestamp; | 359 | gim.timestamp = timestamp; |
360 | gim.toAgentID = toAgentID.UUID; | 360 | gim.toAgentID = toAgentID.Guid; |
361 | gim.message = message; | 361 | gim.message = message; |
362 | gim.dialog = dialog; | 362 | gim.dialog = dialog; |
363 | gim.offline = offline; | 363 | gim.offline = offline; |
364 | gim.ParentEstateID = ParentEstateID; | 364 | gim.ParentEstateID = ParentEstateID; |
365 | gim.Position = new sLLVector3(Position); | 365 | gim.Position = Position; |
366 | gim.binaryBucket = binaryBucket; | 366 | gim.binaryBucket = binaryBucket; |
367 | 367 | ||
368 | 368 | ||
@@ -418,11 +418,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
418 | /// <param name="binaryBucket"></param> | 418 | /// <param name="binaryBucket"></param> |
419 | /// <param name="regionhandle"></param> | 419 | /// <param name="regionhandle"></param> |
420 | /// <param name="prevRegionHandle"></param> | 420 | /// <param name="prevRegionHandle"></param> |
421 | public delegate void GridInstantMessageDelegate(IClientAPI client, LLUUID fromAgentID, | 421 | public delegate void GridInstantMessageDelegate(IClientAPI client, UUID fromAgentID, |
422 | LLUUID fromAgentSession, LLUUID toAgentID, | 422 | UUID fromAgentSession, UUID toAgentID, |
423 | LLUUID imSessionID, uint timestamp, string fromAgentName, | 423 | UUID imSessionID, uint timestamp, string fromAgentName, |
424 | string message, byte dialog, bool fromGroup, byte offline, | 424 | string message, byte dialog, bool fromGroup, byte offline, |
425 | uint ParentEstateID, LLVector3 Position, LLUUID RegionID, | 425 | uint ParentEstateID, Vector3 Position, UUID RegionID, |
426 | byte[] binaryBucket, ulong regionhandle, ulong prevRegionHandle); | 426 | byte[] binaryBucket, ulong regionhandle, ulong prevRegionHandle); |
427 | 427 | ||
428 | private void GridInstantMessageCompleted(IAsyncResult iar) | 428 | private void GridInstantMessageCompleted(IAsyncResult iar) |
@@ -432,11 +432,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
432 | } | 432 | } |
433 | 433 | ||
434 | 434 | ||
435 | protected virtual void SendGridInstantMessageViaXMLRPC(IClientAPI client, LLUUID fromAgentID, | 435 | protected virtual void SendGridInstantMessageViaXMLRPC(IClientAPI client, UUID fromAgentID, |
436 | LLUUID fromAgentSession, LLUUID toAgentID, | 436 | UUID fromAgentSession, UUID toAgentID, |
437 | LLUUID imSessionID, uint timestamp, string fromAgentName, | 437 | UUID imSessionID, uint timestamp, string fromAgentName, |
438 | string message, byte dialog, bool fromGroup, byte offline, | 438 | string message, byte dialog, bool fromGroup, byte offline, |
439 | uint ParentEstateID, LLVector3 Position, LLUUID RegionID, | 439 | uint ParentEstateID, Vector3 Position, UUID RegionID, |
440 | byte[] binaryBucket, ulong regionhandle, ulong prevRegionHandle) | 440 | byte[] binaryBucket, ulong regionhandle, ulong prevRegionHandle) |
441 | { | 441 | { |
442 | GridInstantMessageDelegate d = SendGridInstantMessageViaXMLRPCAsync; | 442 | GridInstantMessageDelegate d = SendGridInstantMessageViaXMLRPCAsync; |
@@ -459,11 +459,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
459 | /// if it's the same as the user's looked up region handle, then we end the recursive loop | 459 | /// if it's the same as the user's looked up region handle, then we end the recursive loop |
460 | /// </summary> | 460 | /// </summary> |
461 | /// <param name="prevRegionHandle"></param> | 461 | /// <param name="prevRegionHandle"></param> |
462 | protected virtual void SendGridInstantMessageViaXMLRPCAsync(IClientAPI client, LLUUID fromAgentID, | 462 | protected virtual void SendGridInstantMessageViaXMLRPCAsync(IClientAPI client, UUID fromAgentID, |
463 | LLUUID fromAgentSession, LLUUID toAgentID, | 463 | UUID fromAgentSession, UUID toAgentID, |
464 | LLUUID imSessionID, uint timestamp, string fromAgentName, | 464 | UUID imSessionID, uint timestamp, string fromAgentName, |
465 | string message, byte dialog, bool fromGroup, byte offline, | 465 | string message, byte dialog, bool fromGroup, byte offline, |
466 | uint ParentEstateID, LLVector3 Position, LLUUID RegionID, | 466 | uint ParentEstateID, Vector3 Position, UUID RegionID, |
467 | byte[] binaryBucket, ulong regionhandle, ulong prevRegionHandle) | 467 | byte[] binaryBucket, ulong regionhandle, ulong prevRegionHandle) |
468 | { | 468 | { |
469 | UserAgentData upd = null; | 469 | UserAgentData upd = null; |
@@ -527,10 +527,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
527 | if (reginfo != null) | 527 | if (reginfo != null) |
528 | { | 528 | { |
529 | GridInstantMessage msg = new GridInstantMessage(); | 529 | GridInstantMessage msg = new GridInstantMessage(); |
530 | msg.fromAgentID = fromAgentID.UUID; | 530 | msg.fromAgentID = fromAgentID.Guid; |
531 | msg.fromAgentSession = fromAgentSession.UUID; | 531 | msg.fromAgentSession = fromAgentSession.Guid; |
532 | msg.toAgentID = toAgentID.UUID; | 532 | msg.toAgentID = toAgentID.Guid; |
533 | msg.imSessionID = imSessionID.UUID; | 533 | msg.imSessionID = imSessionID.Guid; |
534 | msg.timestamp = timestamp; | 534 | msg.timestamp = timestamp; |
535 | msg.fromAgentName = fromAgentName; | 535 | msg.fromAgentName = fromAgentName; |
536 | msg.message = message; | 536 | msg.message = message; |
@@ -538,8 +538,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
538 | msg.fromGroup = fromGroup; | 538 | msg.fromGroup = fromGroup; |
539 | msg.offline = offline; | 539 | msg.offline = offline; |
540 | msg.ParentEstateID = ParentEstateID; | 540 | msg.ParentEstateID = ParentEstateID; |
541 | msg.Position = new sLLVector3(Position); | 541 | msg.Position = Position; |
542 | msg.RegionID = RegionID.UUID; | 542 | msg.RegionID = RegionID.Guid; |
543 | msg.binaryBucket = binaryBucket; | 543 | msg.binaryBucket = binaryBucket; |
544 | 544 | ||
545 | Hashtable msgdata = ConvertGridInstantMessageToXMLRPC(msg); | 545 | Hashtable msgdata = ConvertGridInstantMessageToXMLRPC(msg); |
@@ -649,7 +649,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
649 | /// </summary> | 649 | /// </summary> |
650 | /// <param name="regionID">UUID of region to get the region handle for</param> | 650 | /// <param name="regionID">UUID of region to get the region handle for</param> |
651 | /// <returns></returns> | 651 | /// <returns></returns> |
652 | private ulong getLocalRegionHandleFromUUID(LLUUID regionID) | 652 | private ulong getLocalRegionHandleFromUUID(UUID regionID) |
653 | { | 653 | { |
654 | ulong returnhandle = 0; | 654 | ulong returnhandle = 0; |
655 | 655 | ||
@@ -692,13 +692,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage | |||
692 | byte[] offlinedata = new byte[1]; offlinedata[0] = msg.offline; | 692 | byte[] offlinedata = new byte[1]; offlinedata[0] = msg.offline; |
693 | gim["offline"] = Convert.ToBase64String(offlinedata, Base64FormattingOptions.None); | 693 | gim["offline"] = Convert.ToBase64String(offlinedata, Base64FormattingOptions.None); |
694 | gim["parent_estate_id"] = msg.ParentEstateID.ToString(); | 694 | gim["parent_estate_id"] = msg.ParentEstateID.ToString(); |
695 | gim["position_x"] = msg.Position.x.ToString(); | 695 | gim["position_x"] = msg.Position.X.ToString(); |
696 | gim["position_y"] = msg.Position.y.ToString(); | 696 | gim["position_y"] = msg.Position.Y.ToString(); |
697 | gim["position_z"] = msg.Position.z.ToString(); | 697 | gim["position_z"] = msg.Position.Z.ToString(); |
698 | gim["region_id"] = msg.RegionID.ToString(); | 698 | gim["region_id"] = msg.RegionID.ToString(); |
699 | gim["binary_bucket"] = Convert.ToBase64String(msg.binaryBucket,Base64FormattingOptions.None); | 699 | gim["binary_bucket"] = Convert.ToBase64String(msg.binaryBucket,Base64FormattingOptions.None); |
700 | return gim; | 700 | return gim; |
701 | } | 701 | } |
702 | 702 | ||
703 | } | 703 | } |
704 | } \ No newline at end of file | 704 | } |