diff options
author | John Hurliman | 2009-09-30 15:28:23 -0700 |
---|---|---|
committer | John Hurliman | 2009-09-30 15:28:23 -0700 |
commit | acfe2d9f4e5a55d38b16cac7d0d0a25b64b6b009 (patch) | |
tree | 305349e1bd0a5849fd7f96483e24d5e07b24b8f4 /OpenSim/Region/CoreModules/Avatar | |
parent | * Adding Scale to EntityBase * Fixing the incorrect initialization of EntityB... (diff) | |
parent | Formatting cleanup. (diff) | |
download | opensim-SC_OLD-acfe2d9f4e5a55d38b16cac7d0d0a25b64b6b009.zip opensim-SC_OLD-acfe2d9f4e5a55d38b16cac7d0d0a25b64b6b009.tar.gz opensim-SC_OLD-acfe2d9f4e5a55d38b16cac7d0d0a25b64b6b009.tar.bz2 opensim-SC_OLD-acfe2d9f4e5a55d38b16cac7d0d0a25b64b6b009.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
14 files changed, 170 insertions, 108 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index fcc2673..66a9b5a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -114,7 +114,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
114 | scene.EventManager.OnChatBroadcast -= OnChatBroadcast; | 114 | scene.EventManager.OnChatBroadcast -= OnChatBroadcast; |
115 | m_scenes.Remove(scene); | 115 | m_scenes.Remove(scene); |
116 | } | 116 | } |
117 | } | 117 | } |
118 | } | 118 | } |
119 | 119 | ||
120 | public virtual void Close() | 120 | public virtual void Close() |
diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index 046fc4a..413c6e8 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs | |||
@@ -52,7 +52,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
52 | this, "alert", "alert <first> <last> <message>", "Send an alert to a user", HandleAlertConsoleCommand); | 52 | this, "alert", "alert <first> <last> <message>", "Send an alert to a user", HandleAlertConsoleCommand); |
53 | 53 | ||
54 | m_scene.AddCommand( | 54 | m_scene.AddCommand( |
55 | this, "alert general", "alert general <message>", "Send an alert to everyone", HandleAlertConsoleCommand); | 55 | this, "alert general", "alert general <message>", "Send an alert to everyone", HandleAlertConsoleCommand); |
56 | } | 56 | } |
57 | 57 | ||
58 | public void PostInitialise() {} | 58 | public void PostInitialise() {} |
@@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
63 | public void SendAlertToUser(IClientAPI client, string message) | 63 | public void SendAlertToUser(IClientAPI client, string message) |
64 | { | 64 | { |
65 | SendAlertToUser(client, message, false); | 65 | SendAlertToUser(client, message, false); |
66 | } | 66 | } |
67 | 67 | ||
68 | public void SendAlertToUser(IClientAPI client, string message, bool modal) | 68 | public void SendAlertToUser(IClientAPI client, string message, bool modal) |
69 | { | 69 | { |
@@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
73 | public void SendAlertToUser(UUID agentID, string message) | 73 | public void SendAlertToUser(UUID agentID, string message) |
74 | { | 74 | { |
75 | SendAlertToUser(agentID, message, false); | 75 | SendAlertToUser(agentID, message, false); |
76 | } | 76 | } |
77 | 77 | ||
78 | public void SendAlertToUser(UUID agentID, string message, bool modal) | 78 | public void SendAlertToUser(UUID agentID, string message, bool modal) |
79 | { | 79 | { |
@@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
81 | 81 | ||
82 | if (sp != null) | 82 | if (sp != null) |
83 | sp.ControllingClient.SendAgentAlertMessage(message, modal); | 83 | sp.ControllingClient.SendAgentAlertMessage(message, modal); |
84 | } | 84 | } |
85 | 85 | ||
86 | public void SendAlertToUser(string firstName, string lastName, string message, bool modal) | 86 | public void SendAlertToUser(string firstName, string lastName, string message, bool modal) |
87 | { | 87 | { |
@@ -95,7 +95,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
95 | break; | 95 | break; |
96 | } | 96 | } |
97 | } | 97 | } |
98 | } | 98 | } |
99 | 99 | ||
100 | public void SendGeneralAlert(string message) | 100 | public void SendGeneralAlert(string message) |
101 | { | 101 | { |
@@ -106,7 +106,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
106 | if (!presence.IsChildAgent) | 106 | if (!presence.IsChildAgent) |
107 | presence.ControllingClient.SendAlertMessage(message); | 107 | presence.ControllingClient.SendAlertMessage(message); |
108 | } | 108 | } |
109 | } | 109 | } |
110 | 110 | ||
111 | public void SendDialogToUser( | 111 | public void SendDialogToUser( |
112 | UUID avatarID, string objectName, UUID objectID, UUID ownerID, | 112 | UUID avatarID, string objectName, UUID objectID, UUID ownerID, |
@@ -135,9 +135,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
135 | { | 135 | { |
136 | ScenePresence sp = m_scene.GetScenePresence(avatarID); | 136 | ScenePresence sp = m_scene.GetScenePresence(avatarID); |
137 | 137 | ||
138 | if (sp != null) | 138 | if (sp != null) |
139 | sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url); | 139 | sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url); |
140 | } | 140 | } |
141 | 141 | ||
142 | public void SendNotificationToUsersInEstate( | 142 | public void SendNotificationToUsersInEstate( |
143 | UUID fromAvatarID, string fromAvatarName, string message) | 143 | UUID fromAvatarID, string fromAvatarName, string message) |
@@ -145,11 +145,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
145 | // TODO: This does not yet do what it says on the tin - it only sends the message to users in the same | 145 | // TODO: This does not yet do what it says on the tin - it only sends the message to users in the same |
146 | // region as the sending avatar. | 146 | // region as the sending avatar. |
147 | SendNotificationToUsersInRegion(fromAvatarID, fromAvatarName, message); | 147 | SendNotificationToUsersInRegion(fromAvatarID, fromAvatarName, message); |
148 | } | 148 | } |
149 | 149 | ||
150 | public void SendNotificationToUsersInRegion( | 150 | public void SendNotificationToUsersInRegion( |
151 | UUID fromAvatarID, string fromAvatarName, string message) | 151 | UUID fromAvatarID, string fromAvatarName, string message) |
152 | { | 152 | { |
153 | List<ScenePresence> presenceList = m_scene.GetScenePresences(); | 153 | List<ScenePresence> presenceList = m_scene.GetScenePresences(); |
154 | 154 | ||
155 | foreach (ScenePresence presence in presenceList) | 155 | foreach (ScenePresence presence in presenceList) |
@@ -199,6 +199,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
199 | } | 199 | } |
200 | 200 | ||
201 | return result; | 201 | return result; |
202 | } | 202 | } |
203 | } | 203 | } |
204 | } | 204 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 49b2b5c..fc7d63a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -40,6 +40,7 @@ using OpenSim.Framework.Communications.Cache; | |||
40 | using OpenSim.Region.Framework.Interfaces; | 40 | using OpenSim.Region.Framework.Interfaces; |
41 | using OpenSim.Region.Framework.Scenes; | 41 | using OpenSim.Region.Framework.Scenes; |
42 | using OpenSim.Services.Interfaces; | 42 | using OpenSim.Services.Interfaces; |
43 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
43 | 44 | ||
44 | namespace OpenSim.Region.CoreModules.Avatar.Friends | 45 | namespace OpenSim.Region.CoreModules.Avatar.Friends |
45 | { | 46 | { |
@@ -108,7 +109,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
108 | private Dictionary<ulong, Scene> m_scenes = new Dictionary<ulong,Scene>(); | 109 | private Dictionary<ulong, Scene> m_scenes = new Dictionary<ulong,Scene>(); |
109 | private IMessageTransferModule m_TransferModule = null; | 110 | private IMessageTransferModule m_TransferModule = null; |
110 | 111 | ||
111 | private IGridServices m_gridServices = null; | 112 | private IGridService m_gridServices = null; |
112 | 113 | ||
113 | #region IRegionModule Members | 114 | #region IRegionModule Members |
114 | 115 | ||
@@ -142,7 +143,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
142 | if (m_scenes.Count > 0) | 143 | if (m_scenes.Count > 0) |
143 | { | 144 | { |
144 | m_TransferModule = m_initialScene.RequestModuleInterface<IMessageTransferModule>(); | 145 | m_TransferModule = m_initialScene.RequestModuleInterface<IMessageTransferModule>(); |
145 | m_gridServices = m_initialScene.CommsManager.GridService; | 146 | m_gridServices = m_initialScene.GridService; |
146 | } | 147 | } |
147 | if (m_TransferModule == null) | 148 | if (m_TransferModule == null) |
148 | m_log.Error("[FRIENDS]: Unable to find a message transfer module, friendship offers will not work"); | 149 | m_log.Error("[FRIENDS]: Unable to find a message transfer module, friendship offers will not work"); |
@@ -171,7 +172,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
171 | List<UUID> tpdAway = new List<UUID>(); | 172 | List<UUID> tpdAway = new List<UUID>(); |
172 | 173 | ||
173 | // destRegionHandle is a region on another server | 174 | // destRegionHandle is a region on another server |
174 | RegionInfo info = m_gridServices.RequestNeighbourInfo(destRegionHandle); | 175 | uint x = 0, y = 0; |
176 | Utils.LongToUInts(destRegionHandle, out x, out y); | ||
177 | GridRegion info = m_gridServices.GetRegionByPosition(m_initialScene.RegionInfo.ScopeID, (int)x, (int)y); | ||
175 | if (info != null) | 178 | if (info != null) |
176 | { | 179 | { |
177 | string httpServer = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/presence_update_bulk"; | 180 | string httpServer = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/presence_update_bulk"; |
@@ -223,7 +226,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
223 | public bool TriggerTerminateFriend(ulong destRegionHandle, UUID agentID, UUID exFriendID) | 226 | public bool TriggerTerminateFriend(ulong destRegionHandle, UUID agentID, UUID exFriendID) |
224 | { | 227 | { |
225 | // destRegionHandle is a region on another server | 228 | // destRegionHandle is a region on another server |
226 | RegionInfo info = m_gridServices.RequestNeighbourInfo(destRegionHandle); | 229 | uint x = 0, y = 0; |
230 | Utils.LongToUInts(destRegionHandle, out x, out y); | ||
231 | GridRegion info = m_gridServices.GetRegionByPosition(m_initialScene.RegionInfo.ScopeID, (int)x, (int)y); | ||
227 | if (info == null) | 232 | if (info == null) |
228 | { | 233 | { |
229 | m_log.WarnFormat("[OGS1 GRID SERVICES]: Couldn't find region {0}", destRegionHandle); | 234 | m_log.WarnFormat("[OGS1 GRID SERVICES]: Couldn't find region {0}", destRegionHandle); |
@@ -492,7 +497,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
492 | { | 497 | { |
493 | m_log.ErrorFormat("[FRIENDS]: No user found for id {0} in OfferFriendship()", fromUserId); | 498 | m_log.ErrorFormat("[FRIENDS]: No user found for id {0} in OfferFriendship()", fromUserId); |
494 | } | 499 | } |
495 | } | 500 | } |
496 | 501 | ||
497 | #region FriendRequestHandling | 502 | #region FriendRequestHandling |
498 | 503 | ||
@@ -503,7 +508,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
503 | 508 | ||
504 | if (im.dialog == (byte)InstantMessageDialog.FriendshipOffered) // 38 | 509 | if (im.dialog == (byte)InstantMessageDialog.FriendshipOffered) // 38 |
505 | { | 510 | { |
506 | // fromAgentName is the *destination* name (the friend we offer friendship to) | 511 | // fromAgentName is the *destination* name (the friend we offer friendship to) |
507 | ScenePresence initiator = GetAnyPresenceFromAgentID(new UUID(im.fromAgentID)); | 512 | ScenePresence initiator = GetAnyPresenceFromAgentID(new UUID(im.fromAgentID)); |
508 | im.fromAgentName = initiator != null ? initiator.Name : "(hippo)"; | 513 | im.fromAgentName = initiator != null ? initiator.Name : "(hippo)"; |
509 | 514 | ||
@@ -523,13 +528,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
523 | /// Invoked when a user offers a friendship. | 528 | /// Invoked when a user offers a friendship. |
524 | /// </summary> | 529 | /// </summary> |
525 | /// | 530 | /// |
526 | /// <param name="im"></param> | 531 | /// <param name="im"></param> |
527 | /// <param name="client"></param> | 532 | /// <param name="client"></param> |
528 | private void FriendshipOffered(GridInstantMessage im) | 533 | private void FriendshipOffered(GridInstantMessage im) |
529 | { | 534 | { |
530 | // this is triggered by the initiating agent: | 535 | // this is triggered by the initiating agent: |
531 | // A local agent offers friendship to some possibly remote friend. | 536 | // A local agent offers friendship to some possibly remote friend. |
532 | // A IM is triggered, processed here and sent to the friend (possibly in a remote region). | 537 | // A IM is triggered, processed here and sent to the friend (possibly in a remote region). |
533 | 538 | ||
534 | m_log.DebugFormat("[FRIEND]: Offer(38) - From: {0}, FromName: {1} To: {2}, Session: {3}, Message: {4}, Offline {5}", | 539 | m_log.DebugFormat("[FRIEND]: Offer(38) - From: {0}, FromName: {1} To: {2}, Session: {3}, Message: {4}, Offline {5}", |
535 | im.fromAgentID, im.fromAgentName, im.toAgentID, im.imSessionID, im.message, im.offline); | 540 | im.fromAgentID, im.fromAgentName, im.toAgentID, im.imSessionID, im.message, im.offline); |
@@ -554,7 +559,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
554 | m_log.DebugFormat("[FRIEND]: sending IM success = {0}", success); | 559 | m_log.DebugFormat("[FRIEND]: sending IM success = {0}", success); |
555 | } | 560 | } |
556 | ); | 561 | ); |
557 | } | 562 | } |
558 | } | 563 | } |
559 | 564 | ||
560 | /// <summary> | 565 | /// <summary> |
@@ -565,7 +570,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
565 | private void FriendshipAccepted(IClientAPI client, GridInstantMessage im) | 570 | private void FriendshipAccepted(IClientAPI client, GridInstantMessage im) |
566 | { | 571 | { |
567 | m_log.DebugFormat("[FRIEND]: 39 - from client {0}, agent {2} {3}, imsession {4} to {5}: {6} (dialog {7})", | 572 | m_log.DebugFormat("[FRIEND]: 39 - from client {0}, agent {2} {3}, imsession {4} to {5}: {6} (dialog {7})", |
568 | client.AgentId, im.fromAgentID, im.fromAgentName, im.imSessionID, im.toAgentID, im.message, im.dialog); | 573 | client.AgentId, im.fromAgentID, im.fromAgentName, im.imSessionID, im.toAgentID, im.message, im.dialog); |
569 | } | 574 | } |
570 | 575 | ||
571 | /// <summary> | 576 | /// <summary> |
@@ -597,7 +602,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
597 | delegate(bool success) { | 602 | delegate(bool success) { |
598 | m_log.DebugFormat("[FRIEND]: sending IM success = {0}", success); | 603 | m_log.DebugFormat("[FRIEND]: sending IM success = {0}", success); |
599 | } | 604 | } |
600 | ); | 605 | ); |
601 | } | 606 | } |
602 | 607 | ||
603 | private void OnGridInstantMessage(GridInstantMessage msg) | 608 | private void OnGridInstantMessage(GridInstantMessage msg) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index ff12361..8ce5092 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | |||
@@ -91,6 +91,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
91 | else | 91 | else |
92 | m_log.ErrorFormat( | 92 | m_log.ErrorFormat( |
93 | "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name); | 93 | "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name); |
94 | } | 94 | } |
95 | } | 95 | } |
96 | } \ No newline at end of file | 96 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 8926527..f941728 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
43 | { | 43 | { |
44 | m_scene = scene; | 44 | m_scene = scene; |
45 | m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>(); | 45 | m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>(); |
46 | m_scene.RegisterModuleInterface<IGodsModule>(this); | 46 | m_scene.RegisterModuleInterface<IGodsModule>(this); |
47 | } | 47 | } |
48 | 48 | ||
49 | public void PostInitialise() {} | 49 | public void PostInitialise() {} |
@@ -84,7 +84,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
84 | m_dialogModule.SendAlertToUser(agentID, "Request for god powers denied"); | 84 | m_dialogModule.SendAlertToUser(agentID, "Request for god powers denied"); |
85 | } | 85 | } |
86 | } | 86 | } |
87 | } | 87 | } |
88 | 88 | ||
89 | /// <summary> | 89 | /// <summary> |
90 | /// Kicks User specified from the simulator. This logs them off of the grid | 90 | /// Kicks User specified from the simulator. This logs them off of the grid |
@@ -142,7 +142,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
142 | } | 142 | } |
143 | } | 143 | } |
144 | else | 144 | else |
145 | { | 145 | { |
146 | m_dialogModule.SendAlertToUser(godID, "Kick request denied"); | 146 | m_dialogModule.SendAlertToUser(godID, "Kick request denied"); |
147 | } | 147 | } |
148 | } | 148 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index 66f1e14..9a68749 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs | |||
@@ -38,7 +38,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
38 | { | 38 | { |
39 | public class InstantMessageModule : IRegionModule | 39 | public class InstantMessageModule : IRegionModule |
40 | { | 40 | { |
41 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 41 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
42 | 42 | ||
43 | /// <value> | 43 | /// <value> |
44 | /// Is this module enabled? | 44 | /// Is this module enabled? |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 4495303..e5159b3 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | |||
@@ -36,6 +36,7 @@ using OpenMetaverse; | |||
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
39 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | 41 | namespace OpenSim.Region.CoreModules.Avatar.InstantMessage |
41 | { | 42 | { |
@@ -497,7 +498,10 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
497 | { | 498 | { |
498 | if (upd.AgentOnline) | 499 | if (upd.AgentOnline) |
499 | { | 500 | { |
500 | RegionInfo reginfo = m_Scenes[0].SceneGridService.RequestNeighbouringRegionInfo(upd.Handle); | 501 | uint x = 0, y = 0; |
502 | Utils.LongToUInts(upd.Handle, out x, out y); | ||
503 | GridRegion reginfo = m_Scenes[0].GridService.GetRegionByPosition(m_Scenes[0].RegionInfo.ScopeID, | ||
504 | (int)x, (int)y); | ||
501 | if (reginfo != null) | 505 | if (reginfo != null) |
502 | { | 506 | { |
503 | Hashtable msgdata = ConvertGridInstantMessageToXMLRPC(im); | 507 | Hashtable msgdata = ConvertGridInstantMessageToXMLRPC(im); |
@@ -559,7 +563,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
559 | /// <param name="reginfo">RegionInfo we pull the data out of to send the request to</param> | 563 | /// <param name="reginfo">RegionInfo we pull the data out of to send the request to</param> |
560 | /// <param name="xmlrpcdata">The Instant Message data Hashtable</param> | 564 | /// <param name="xmlrpcdata">The Instant Message data Hashtable</param> |
561 | /// <returns>Bool if the message was successfully delivered at the other side.</returns> | 565 | /// <returns>Bool if the message was successfully delivered at the other side.</returns> |
562 | protected virtual bool doIMSending(RegionInfo reginfo, Hashtable xmlrpcdata) | 566 | protected virtual bool doIMSending(GridRegion reginfo, Hashtable xmlrpcdata) |
563 | { | 567 | { |
564 | 568 | ||
565 | ArrayList SendParams = new ArrayList(); | 569 | ArrayList SendParams = new ArrayList(); |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs index ebd9a72..ad05bab 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs | |||
@@ -35,6 +35,7 @@ using OpenMetaverse; | |||
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
37 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
38 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
38 | 39 | ||
39 | namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | 40 | namespace OpenSim.Region.CoreModules.Avatar.InstantMessage |
40 | { | 41 | { |
@@ -171,7 +172,10 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
171 | { | 172 | { |
172 | // TODO this is the old messaging-server protocol; only the regionHandle is available. | 173 | // TODO this is the old messaging-server protocol; only the regionHandle is available. |
173 | // Fetch region-info to get the id | 174 | // Fetch region-info to get the id |
174 | RegionInfo regionInfo = m_initialScene.RequestNeighbouringRegionInfo(info.regionHandle); | 175 | uint x = 0, y = 0; |
176 | Utils.LongToUInts(info.regionHandle, out x, out y); | ||
177 | GridRegion regionInfo = m_initialScene.GridService.GetRegionByPosition(m_initialScene.RegionInfo.ScopeID, | ||
178 | (int)x, (int)y); | ||
175 | regionID = regionInfo.RegionID; | 179 | regionID = regionInfo.RegionID; |
176 | } | 180 | } |
177 | result[indices[i]] = new PresenceInfo(uuids[i], regionID); | 181 | result[indices[i]] = new PresenceInfo(uuids[i], regionID); |
@@ -349,6 +353,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
349 | 353 | ||
350 | private void NotifyMessageServerOfShutdown(Scene scene) | 354 | private void NotifyMessageServerOfShutdown(Scene scene) |
351 | { | 355 | { |
356 | if (m_Scenes[0].CommsManager.NetworkServersInfo.MessagingURL == string.Empty) | ||
357 | return; | ||
358 | |||
352 | Hashtable xmlrpcdata = new Hashtable(); | 359 | Hashtable xmlrpcdata = new Hashtable(); |
353 | xmlrpcdata["RegionUUID"] = scene.RegionInfo.RegionID.ToString(); | 360 | xmlrpcdata["RegionUUID"] = scene.RegionInfo.RegionID.ToString(); |
354 | ArrayList SendParams = new ArrayList(); | 361 | ArrayList SendParams = new ArrayList(); |
@@ -372,6 +379,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
372 | 379 | ||
373 | private void NotifyMessageServerOfAgentLocation(UUID agentID, UUID region, ulong regionHandle) | 380 | private void NotifyMessageServerOfAgentLocation(UUID agentID, UUID region, ulong regionHandle) |
374 | { | 381 | { |
382 | if (m_Scenes[0].CommsManager.NetworkServersInfo.MessagingURL == string.Empty) | ||
383 | return; | ||
384 | |||
375 | Hashtable xmlrpcdata = new Hashtable(); | 385 | Hashtable xmlrpcdata = new Hashtable(); |
376 | xmlrpcdata["AgentID"] = agentID.ToString(); | 386 | xmlrpcdata["AgentID"] = agentID.ToString(); |
377 | xmlrpcdata["RegionUUID"] = region.ToString(); | 387 | xmlrpcdata["RegionUUID"] = region.ToString(); |
@@ -397,6 +407,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
397 | 407 | ||
398 | private void NotifyMessageServerOfAgentLeaving(UUID agentID, UUID region, ulong regionHandle) | 408 | private void NotifyMessageServerOfAgentLeaving(UUID agentID, UUID region, ulong regionHandle) |
399 | { | 409 | { |
410 | if (m_Scenes[0].CommsManager.NetworkServersInfo.MessagingURL == string.Empty) | ||
411 | return; | ||
412 | |||
400 | Hashtable xmlrpcdata = new Hashtable(); | 413 | Hashtable xmlrpcdata = new Hashtable(); |
401 | xmlrpcdata["AgentID"] = agentID.ToString(); | 414 | xmlrpcdata["AgentID"] = agentID.ToString(); |
402 | xmlrpcdata["RegionUUID"] = region.ToString(); | 415 | xmlrpcdata["RegionUUID"] = region.ToString(); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 907e2d4..f761bf0 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -59,7 +59,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
59 | /// <value> | 59 | /// <value> |
60 | /// We only use this to request modules | 60 | /// We only use this to request modules |
61 | /// </value> | 61 | /// </value> |
62 | protected Scene m_scene; | 62 | protected Scene m_scene; |
63 | 63 | ||
64 | /// <value> | 64 | /// <value> |
65 | /// The stream from which the inventory archive will be loaded. | 65 | /// The stream from which the inventory archive will be loaded. |
@@ -186,7 +186,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
186 | item.Folder = foundFolder.ID; | 186 | item.Folder = foundFolder.ID; |
187 | 187 | ||
188 | //m_userInfo.AddItem(item); | 188 | //m_userInfo.AddItem(item); |
189 | m_scene.InventoryService.AddItem(item); | 189 | m_scene.InventoryService.AddItem(item); |
190 | successfulItemRestores++; | 190 | successfulItemRestores++; |
191 | 191 | ||
192 | // If we're loading an item directly into the given destination folder then we need to record | 192 | // If we're loading an item directly into the given destination folder then we need to record |
@@ -299,14 +299,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
299 | = new InventoryFolderBase( | 299 | = new InventoryFolderBase( |
300 | newFolderId, newFolderName, m_userInfo.UserProfile.ID, | 300 | newFolderId, newFolderName, m_userInfo.UserProfile.ID, |
301 | (short)AssetType.Unknown, destFolder.ID, 1); | 301 | (short)AssetType.Unknown, destFolder.ID, 1); |
302 | m_scene.InventoryService.AddFolder(destFolder); | 302 | m_scene.InventoryService.AddFolder(destFolder); |
303 | 303 | ||
304 | // UUID newFolderId = UUID.Random(); | 304 | // UUID newFolderId = UUID.Random(); |
305 | // m_scene.InventoryService.AddFolder( | 305 | // m_scene.InventoryService.AddFolder( |
306 | // m_userInfo.CreateFolder( | 306 | // m_userInfo.CreateFolder( |
307 | // folderName, newFolderId, (ushort)AssetType.Folder, foundFolder.ID); | 307 | // folderName, newFolderId, (ushort)AssetType.Folder, foundFolder.ID); |
308 | 308 | ||
309 | // m_log.DebugFormat("[INVENTORY ARCHIVER]: Retrieving newly created folder {0}", folderName); | 309 | // m_log.DebugFormat("[INVENTORY ARCHIVER]: Retrieving newly created folder {0}", folderName); |
310 | // foundFolder = foundFolder.GetChildFolder(newFolderId); | 310 | // foundFolder = foundFolder.GetChildFolder(newFolderId); |
311 | // m_log.DebugFormat( | 311 | // m_log.DebugFormat( |
312 | // "[INVENTORY ARCHIVER]: Retrieved newly created folder {0} with ID {1}", | 312 | // "[INVENTORY ARCHIVER]: Retrieved newly created folder {0} with ID {1}", |
@@ -321,7 +321,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
321 | nodesLoaded.Add(destFolder); | 321 | nodesLoaded.Add(destFolder); |
322 | 322 | ||
323 | i++; | 323 | i++; |
324 | } | 324 | } |
325 | 325 | ||
326 | return destFolder; | 326 | return destFolder; |
327 | 327 | ||
@@ -357,7 +357,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
357 | rawFolders[i++], newFolderId, (ushort)AssetType.Folder, foundFolder.ID); | 357 | rawFolders[i++], newFolderId, (ushort)AssetType.Folder, foundFolder.ID); |
358 | foundFolder = foundFolder.GetChildFolder(newFolderId); | 358 | foundFolder = foundFolder.GetChildFolder(newFolderId); |
359 | } | 359 | } |
360 | */ | 360 | */ |
361 | } | 361 | } |
362 | 362 | ||
363 | /// <summary> | 363 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs index 5ebf2fa..a73f868 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs | |||
@@ -42,7 +42,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
42 | 42 | ||
43 | /// <summary> | 43 | /// <summary> |
44 | /// Find a folder given a PATH_DELIMITER delimited path starting from a user's root folder | 44 | /// Find a folder given a PATH_DELIMITER delimited path starting from a user's root folder |
45 | /// </summary> | 45 | /// </summary> |
46 | /// | 46 | /// |
47 | /// This method does not handle paths that contain multiple delimitors | 47 | /// This method does not handle paths that contain multiple delimitors |
48 | /// | 48 | /// |
@@ -71,11 +71,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
71 | return null; | 71 | return null; |
72 | 72 | ||
73 | return FindFolderByPath(inventoryService, rootFolder, path); | 73 | return FindFolderByPath(inventoryService, rootFolder, path); |
74 | } | 74 | } |
75 | 75 | ||
76 | /// <summary> | 76 | /// <summary> |
77 | /// Find a folder given a PATH_DELIMITER delimited path starting from this folder | 77 | /// Find a folder given a PATH_DELIMITER delimited path starting from this folder |
78 | /// </summary> | 78 | /// </summary> |
79 | /// | 79 | /// |
80 | /// This method does not handle paths that contain multiple delimitors | 80 | /// This method does not handle paths that contain multiple delimitors |
81 | /// | 81 | /// |
@@ -154,7 +154,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
154 | return null; | 154 | return null; |
155 | 155 | ||
156 | return FindItemByPath(inventoryService, rootFolder, path); | 156 | return FindItemByPath(inventoryService, rootFolder, path); |
157 | } | 157 | } |
158 | 158 | ||
159 | /// <summary> | 159 | /// <summary> |
160 | /// Find an item given a PATH_DELIMITOR delimited path starting from this folder. | 160 | /// Find an item given a PATH_DELIMITOR delimited path starting from this folder. |
@@ -194,7 +194,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
194 | } | 194 | } |
195 | else | 195 | else |
196 | { | 196 | { |
197 | InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); | 197 | InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); |
198 | 198 | ||
199 | foreach (InventoryFolderBase folder in contents.Folders) | 199 | foreach (InventoryFolderBase folder in contents.Folders) |
200 | { | 200 | { |
@@ -205,6 +205,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
205 | 205 | ||
206 | // We didn't find an item or intermediate folder with the given name | 206 | // We didn't find an item or intermediate folder with the given name |
207 | return null; | 207 | return null; |
208 | } | 208 | } |
209 | } | 209 | } |
210 | } \ No newline at end of file | 210 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index 7b4a9eb..499c552 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
55 | 55 | ||
56 | private InventoryArchiverModule m_module; | 56 | private InventoryArchiverModule m_module; |
57 | private CachedUserInfo m_userInfo; | 57 | private CachedUserInfo m_userInfo; |
58 | private string m_invPath; | 58 | private string m_invPath; |
59 | protected TarArchiveWriter m_archiveWriter; | 59 | protected TarArchiveWriter m_archiveWriter; |
60 | protected UuidGatherer m_assetGatherer; | 60 | protected UuidGatherer m_assetGatherer; |
61 | 61 | ||
@@ -118,6 +118,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
118 | 118 | ||
119 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) | 119 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) |
120 | { | 120 | { |
121 | // We're almost done. Just need to write out the control file now | ||
122 | m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile()); | ||
123 | m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); | ||
124 | |||
121 | Exception reportedException = null; | 125 | Exception reportedException = null; |
122 | bool succeeded = true; | 126 | bool succeeded = true; |
123 | 127 | ||
@@ -164,7 +168,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
164 | { | 168 | { |
165 | path += CreateArchiveFolderName(inventoryFolder); | 169 | path += CreateArchiveFolderName(inventoryFolder); |
166 | 170 | ||
167 | // We need to make sure that we record empty folders | 171 | // We need to make sure that we record empty folders |
168 | m_archiveWriter.WriteDir(path); | 172 | m_archiveWriter.WriteDir(path); |
169 | } | 173 | } |
170 | 174 | ||
@@ -258,7 +262,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
258 | if (maxComponentIndex >= 0 && components[maxComponentIndex] == STAR_WILDCARD) | 262 | if (maxComponentIndex >= 0 && components[maxComponentIndex] == STAR_WILDCARD) |
259 | { | 263 | { |
260 | foundStar = true; | 264 | foundStar = true; |
261 | maxComponentIndex--; | 265 | maxComponentIndex--; |
262 | } | 266 | } |
263 | 267 | ||
264 | m_invPath = String.Empty; | 268 | m_invPath = String.Empty; |
@@ -320,7 +324,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
320 | SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar); | 324 | SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar); |
321 | } | 325 | } |
322 | 326 | ||
323 | SaveUsers(); | 327 | // Don't put all this profile information into the archive right now. |
328 | //SaveUsers(); | ||
329 | |||
324 | new AssetsRequest( | 330 | new AssetsRequest( |
325 | new AssetsArchiver(m_archiveWriter), m_assetUuids.Keys, | 331 | new AssetsArchiver(m_archiveWriter), m_assetUuids.Keys, |
326 | m_scene.AssetService, ReceivedAllAssets).Execute(); | 332 | m_scene.AssetService, ReceivedAllAssets).Execute(); |
@@ -363,8 +369,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
363 | /// <returns></returns> | 369 | /// <returns></returns> |
364 | public static string CreateArchiveFolderName(InventoryFolderBase folder) | 370 | public static string CreateArchiveFolderName(InventoryFolderBase folder) |
365 | { | 371 | { |
366 | return CreateArchiveFolderName(folder.Name, folder.ID); | 372 | return CreateArchiveFolderName(folder.Name, folder.ID); |
367 | } | 373 | } |
368 | 374 | ||
369 | /// <summary> | 375 | /// <summary> |
370 | /// Create the archive name for a particular item. | 376 | /// Create the archive name for a particular item. |
@@ -377,7 +383,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
377 | /// <returns></returns> | 383 | /// <returns></returns> |
378 | public static string CreateArchiveItemName(InventoryItemBase item) | 384 | public static string CreateArchiveItemName(InventoryItemBase item) |
379 | { | 385 | { |
380 | return CreateArchiveItemName(item.Name, item.ID); | 386 | return CreateArchiveItemName(item.Name, item.ID); |
381 | } | 387 | } |
382 | 388 | ||
383 | /// <summary> | 389 | /// <summary> |
@@ -392,7 +398,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
392 | "{0}{1}{2}/", | 398 | "{0}{1}{2}/", |
393 | name, | 399 | name, |
394 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, | 400 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, |
395 | id); | 401 | id); |
396 | } | 402 | } |
397 | 403 | ||
398 | /// <summary> | 404 | /// <summary> |
@@ -400,14 +406,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
400 | /// </summary> | 406 | /// </summary> |
401 | /// <param name="name"></param> | 407 | /// <param name="name"></param> |
402 | /// <param name="id"></param> | 408 | /// <param name="id"></param> |
403 | /// <returns></returns> | 409 | /// <returns></returns> |
404 | public static string CreateArchiveItemName(string name, UUID id) | 410 | public static string CreateArchiveItemName(string name, UUID id) |
405 | { | 411 | { |
406 | return string.Format( | 412 | return string.Format( |
407 | "{0}{1}{2}.xml", | 413 | "{0}{1}{2}.xml", |
408 | name, | 414 | name, |
409 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, | 415 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, |
410 | id); | 416 | id); |
417 | } | ||
418 | |||
419 | /// <summary> | ||
420 | /// Create the control file for a 0.1 version archive | ||
421 | /// </summary> | ||
422 | /// <returns></returns> | ||
423 | public static string Create0p1ControlFile() | ||
424 | { | ||
425 | StringWriter sw = new StringWriter(); | ||
426 | XmlTextWriter xtw = new XmlTextWriter(sw); | ||
427 | xtw.Formatting = Formatting.Indented; | ||
428 | xtw.WriteStartDocument(); | ||
429 | xtw.WriteStartElement("archive"); | ||
430 | xtw.WriteAttributeString("major_version", "0"); | ||
431 | xtw.WriteAttributeString("minor_version", "1"); | ||
432 | xtw.WriteEndElement(); | ||
433 | |||
434 | xtw.Flush(); | ||
435 | xtw.Close(); | ||
436 | |||
437 | String s = sw.ToString(); | ||
438 | sw.Close(); | ||
439 | |||
440 | return s; | ||
411 | } | 441 | } |
412 | } | 442 | } |
413 | } \ No newline at end of file | 443 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index 9f49da9..1228eb1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | |||
@@ -40,12 +40,12 @@ using OpenSim.Region.Framework.Scenes; | |||
40 | using OpenSim.Services.Interfaces; | 40 | using OpenSim.Services.Interfaces; |
41 | 41 | ||
42 | namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | 42 | namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver |
43 | { | 43 | { |
44 | /// <summary> | 44 | /// <summary> |
45 | /// This module loads and saves OpenSimulator inventory archives | 45 | /// This module loads and saves OpenSimulator inventory archives |
46 | /// </summary> | 46 | /// </summary> |
47 | public class InventoryArchiverModule : IRegionModule, IInventoryArchiverModule | 47 | public class InventoryArchiverModule : IRegionModule, IInventoryArchiverModule |
48 | { | 48 | { |
49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | 50 | ||
51 | public string Name { get { return "Inventory Archiver Module"; } } | 51 | public string Name { get { return "Inventory Archiver Module"; } } |
@@ -57,7 +57,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
57 | /// </value> | 57 | /// </value> |
58 | public bool DisablePresenceChecks { get; set; } | 58 | public bool DisablePresenceChecks { get; set; } |
59 | 59 | ||
60 | public event InventoryArchiveSaved OnInventoryArchiveSaved; | 60 | public event InventoryArchiveSaved OnInventoryArchiveSaved; |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// The file to load and save inventory if no filename has been specified | 63 | /// The file to load and save inventory if no filename has been specified |
@@ -83,7 +83,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
83 | } | 83 | } |
84 | 84 | ||
85 | public void Initialise(Scene scene, IConfigSource source) | 85 | public void Initialise(Scene scene, IConfigSource source) |
86 | { | 86 | { |
87 | if (m_scenes.Count == 0) | 87 | if (m_scenes.Count == 0) |
88 | { | 88 | { |
89 | scene.RegisterModuleInterface<IInventoryArchiverModule>(this); | 89 | scene.RegisterModuleInterface<IInventoryArchiverModule>(this); |
@@ -102,7 +102,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
102 | m_aScene = scene; | 102 | m_aScene = scene; |
103 | } | 103 | } |
104 | 104 | ||
105 | m_scenes[scene.RegionInfo.RegionID] = scene; | 105 | m_scenes[scene.RegionInfo.RegionID] = scene; |
106 | } | 106 | } |
107 | 107 | ||
108 | public void PostInitialise() {} | 108 | public void PostInitialise() {} |
@@ -119,7 +119,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
119 | InventoryArchiveSaved handlerInventoryArchiveSaved = OnInventoryArchiveSaved; | 119 | InventoryArchiveSaved handlerInventoryArchiveSaved = OnInventoryArchiveSaved; |
120 | if (handlerInventoryArchiveSaved != null) | 120 | if (handlerInventoryArchiveSaved != null) |
121 | handlerInventoryArchiveSaved(id, succeeded, userInfo, invPath, saveStream, reportedException); | 121 | handlerInventoryArchiveSaved(id, succeeded, userInfo, invPath, saveStream, reportedException); |
122 | } | 122 | } |
123 | 123 | ||
124 | public bool ArchiveInventory(Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream) | 124 | public bool ArchiveInventory(Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream) |
125 | { | 125 | { |
@@ -174,7 +174,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
174 | public bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, Stream loadStream) | 174 | public bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, Stream loadStream) |
175 | { | 175 | { |
176 | if (m_scenes.Count > 0) | 176 | if (m_scenes.Count > 0) |
177 | { | 177 | { |
178 | CachedUserInfo userInfo = GetUserInfo(firstName, lastName, pass); | 178 | CachedUserInfo userInfo = GetUserInfo(firstName, lastName, pass); |
179 | 179 | ||
180 | if (userInfo != null) | 180 | if (userInfo != null) |
@@ -182,7 +182,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
182 | if (CheckPresence(userInfo.UserProfile.ID)) | 182 | if (CheckPresence(userInfo.UserProfile.ID)) |
183 | { | 183 | { |
184 | InventoryArchiveReadRequest request = | 184 | InventoryArchiveReadRequest request = |
185 | new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream); | 185 | new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream); |
186 | UpdateClientWithLoadedNodes(userInfo, request.Execute()); | 186 | UpdateClientWithLoadedNodes(userInfo, request.Execute()); |
187 | 187 | ||
188 | return true; | 188 | return true; |
@@ -197,12 +197,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
197 | } | 197 | } |
198 | 198 | ||
199 | return false; | 199 | return false; |
200 | } | 200 | } |
201 | 201 | ||
202 | public bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, string loadPath) | 202 | public bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, string loadPath) |
203 | { | 203 | { |
204 | if (m_scenes.Count > 0) | 204 | if (m_scenes.Count > 0) |
205 | { | 205 | { |
206 | CachedUserInfo userInfo = GetUserInfo(firstName, lastName, pass); | 206 | CachedUserInfo userInfo = GetUserInfo(firstName, lastName, pass); |
207 | 207 | ||
208 | if (userInfo != null) | 208 | if (userInfo != null) |
@@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
210 | if (CheckPresence(userInfo.UserProfile.ID)) | 210 | if (CheckPresence(userInfo.UserProfile.ID)) |
211 | { | 211 | { |
212 | InventoryArchiveReadRequest request = | 212 | InventoryArchiveReadRequest request = |
213 | new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath); | 213 | new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath); |
214 | UpdateClientWithLoadedNodes(userInfo, request.Execute()); | 214 | UpdateClientWithLoadedNodes(userInfo, request.Execute()); |
215 | 215 | ||
216 | return true; | 216 | return true; |
@@ -221,11 +221,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
221 | "[INVENTORY ARCHIVER]: User {0} {1} not logged in to this region simulator", | 221 | "[INVENTORY ARCHIVER]: User {0} {1} not logged in to this region simulator", |
222 | userInfo.UserProfile.Name, userInfo.UserProfile.ID); | 222 | userInfo.UserProfile.Name, userInfo.UserProfile.ID); |
223 | } | 223 | } |
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
227 | return false; | 227 | return false; |
228 | } | 228 | } |
229 | 229 | ||
230 | /// <summary> | 230 | /// <summary> |
231 | /// Load inventory from an inventory file archive | 231 | /// Load inventory from an inventory file archive |
@@ -252,7 +252,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
252 | "[INVENTORY ARCHIVER]: Loading archive {0} to inventory path {1} for {2} {3}", | 252 | "[INVENTORY ARCHIVER]: Loading archive {0} to inventory path {1} for {2} {3}", |
253 | loadPath, invPath, firstName, lastName); | 253 | loadPath, invPath, firstName, lastName); |
254 | 254 | ||
255 | if (DearchiveInventory(firstName, lastName, invPath, pass, loadPath)) | 255 | if (DearchiveInventory(firstName, lastName, invPath, pass, loadPath)) |
256 | m_log.InfoFormat( | 256 | m_log.InfoFormat( |
257 | "[INVENTORY ARCHIVER]: Loaded archive {0} for {1} {2}", | 257 | "[INVENTORY ARCHIVER]: Loaded archive {0} for {1} {2}", |
258 | loadPath, firstName, lastName); | 258 | loadPath, firstName, lastName); |
@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
264 | /// <param name="cmdparams"></param> | 264 | /// <param name="cmdparams"></param> |
265 | protected void HandleSaveInvConsoleCommand(string module, string[] cmdparams) | 265 | protected void HandleSaveInvConsoleCommand(string module, string[] cmdparams) |
266 | { | 266 | { |
267 | if (cmdparams.Length < 5) | 267 | if (cmdparams.Length < 6) |
268 | { | 268 | { |
269 | m_log.Error( | 269 | m_log.Error( |
270 | "[INVENTORY ARCHIVER]: usage is save iar <first name> <last name> <inventory path> <user password> [<save file path>]"); | 270 | "[INVENTORY ARCHIVER]: usage is save iar <first name> <last name> <inventory path> <user password> [<save file path>]"); |
@@ -288,7 +288,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
288 | 288 | ||
289 | lock (m_pendingConsoleSaves) | 289 | lock (m_pendingConsoleSaves) |
290 | m_pendingConsoleSaves.Add(id); | 290 | m_pendingConsoleSaves.Add(id); |
291 | } | 291 | } |
292 | 292 | ||
293 | private void SaveInvConsoleCommandCompleted( | 293 | private void SaveInvConsoleCommandCompleted( |
294 | Guid id, bool succeeded, CachedUserInfo userInfo, string invPath, Stream saveStream, | 294 | Guid id, bool succeeded, CachedUserInfo userInfo, string invPath, Stream saveStream, |
@@ -324,6 +324,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
324 | protected CachedUserInfo GetUserInfo(string firstName, string lastName, string pass) | 324 | protected CachedUserInfo GetUserInfo(string firstName, string lastName, string pass) |
325 | { | 325 | { |
326 | CachedUserInfo userInfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(firstName, lastName); | 326 | CachedUserInfo userInfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(firstName, lastName); |
327 | //m_aScene.CommsManager.UserService.GetUserProfile(firstName, lastName); | ||
327 | if (null == userInfo) | 328 | if (null == userInfo) |
328 | { | 329 | { |
329 | m_log.ErrorFormat( | 330 | m_log.ErrorFormat( |
@@ -332,16 +333,25 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
332 | return null; | 333 | return null; |
333 | } | 334 | } |
334 | 335 | ||
335 | string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(pass) + ":" + userInfo.UserProfile.PasswordSalt); | 336 | try |
336 | if (userInfo.UserProfile.PasswordHash != md5PasswdHash) | ||
337 | { | 337 | { |
338 | m_log.ErrorFormat( | 338 | if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass)) |
339 | "[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.", | 339 | { |
340 | firstName, lastName); | 340 | return userInfo; |
341 | } | ||
342 | else | ||
343 | { | ||
344 | m_log.ErrorFormat( | ||
345 | "[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.", | ||
346 | firstName, lastName); | ||
347 | return null; | ||
348 | } | ||
349 | } | ||
350 | catch (Exception e) | ||
351 | { | ||
352 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e.Message); | ||
341 | return null; | 353 | return null; |
342 | } | 354 | } |
343 | |||
344 | return userInfo; | ||
345 | } | 355 | } |
346 | 356 | ||
347 | /// <summary> | 357 | /// <summary> |
@@ -349,7 +359,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
349 | /// </summary> | 359 | /// </summary> |
350 | /// <param name="loadedNodes">Can be empty. In which case, nothing happens</param> | 360 | /// <param name="loadedNodes">Can be empty. In which case, nothing happens</param> |
351 | private void UpdateClientWithLoadedNodes(CachedUserInfo userInfo, List<InventoryNodeBase> loadedNodes) | 361 | private void UpdateClientWithLoadedNodes(CachedUserInfo userInfo, List<InventoryNodeBase> loadedNodes) |
352 | { | 362 | { |
353 | if (loadedNodes.Count == 0) | 363 | if (loadedNodes.Count == 0) |
354 | return; | 364 | return; |
355 | 365 | ||
@@ -358,19 +368,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
358 | ScenePresence user = scene.GetScenePresence(userInfo.UserProfile.ID); | 368 | ScenePresence user = scene.GetScenePresence(userInfo.UserProfile.ID); |
359 | 369 | ||
360 | if (user != null && !user.IsChildAgent) | 370 | if (user != null && !user.IsChildAgent) |
361 | { | 371 | { |
362 | foreach (InventoryNodeBase node in loadedNodes) | 372 | foreach (InventoryNodeBase node in loadedNodes) |
363 | { | 373 | { |
364 | m_log.DebugFormat( | 374 | // m_log.DebugFormat( |
365 | "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}", | 375 | // "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}", |
366 | user.Name, node.Name); | 376 | // user.Name, node.Name); |
367 | 377 | ||
368 | user.ControllingClient.SendBulkUpdateInventory(node); | 378 | user.ControllingClient.SendBulkUpdateInventory(node); |
369 | } | 379 | } |
370 | 380 | ||
371 | break; | 381 | break; |
372 | } | 382 | } |
373 | } | 383 | } |
374 | } | 384 | } |
375 | 385 | ||
376 | /// <summary> | 386 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index ed293cd..b0fdcd6 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -37,7 +37,7 @@ using OpenMetaverse; | |||
37 | using OpenSim.Data; | 37 | using OpenSim.Data; |
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Serialization; | 39 | using OpenSim.Framework.Serialization; |
40 | using OpenSim.Framework.Serialization.External; | 40 | using OpenSim.Framework.Serialization.External; |
41 | using OpenSim.Framework.Communications; | 41 | using OpenSim.Framework.Communications; |
42 | using OpenSim.Framework.Communications.Cache; | 42 | using OpenSim.Framework.Communications.Cache; |
43 | using OpenSim.Framework.Communications.Osp; | 43 | using OpenSim.Framework.Communications.Osp; |
@@ -70,7 +70,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
70 | Exception reportedException) | 70 | Exception reportedException) |
71 | { | 71 | { |
72 | mre.Set(); | 72 | mre.Set(); |
73 | } | 73 | } |
74 | 74 | ||
75 | /// <summary> | 75 | /// <summary> |
76 | /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). | 76 | /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). |
@@ -157,7 +157,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
157 | string expectedObject1FilePath = string.Format( | 157 | string expectedObject1FilePath = string.Format( |
158 | "{0}{1}{2}", | 158 | "{0}{1}{2}", |
159 | ArchiveConstants.INVENTORY_PATH, | 159 | ArchiveConstants.INVENTORY_PATH, |
160 | InventoryArchiveWriteRequest.CreateArchiveFolderName(objsFolder), | 160 | InventoryArchiveWriteRequest.CreateArchiveFolderName(objsFolder), |
161 | expectedObject1FileName); | 161 | expectedObject1FileName); |
162 | 162 | ||
163 | string filePath; | 163 | string filePath; |
@@ -195,7 +195,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
195 | Assert.That(gotObject1File, Is.True, "No item1 file in archive"); | 195 | Assert.That(gotObject1File, Is.True, "No item1 file in archive"); |
196 | // Assert.That(gotObject2File, Is.True, "No object2 file in archive"); | 196 | // Assert.That(gotObject2File, Is.True, "No object2 file in archive"); |
197 | 197 | ||
198 | // TODO: Test presence of more files and contents of files. | 198 | // TODO: Test presence of more files and contents of files. |
199 | } | 199 | } |
200 | 200 | ||
201 | /// <summary> | 201 | /// <summary> |
@@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
206 | /// This test also does some deeper probing of loading into nested inventory structures | 206 | /// This test also does some deeper probing of loading into nested inventory structures |
207 | [Test] | 207 | [Test] |
208 | public void TestLoadIarV0_1ExistingUsers() | 208 | public void TestLoadIarV0_1ExistingUsers() |
209 | { | 209 | { |
210 | TestHelper.InMethod(); | 210 | TestHelper.InMethod(); |
211 | 211 | ||
212 | //log4net.Config.XmlConfigurator.Configure(); | 212 | //log4net.Config.XmlConfigurator.Configure(); |
@@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
238 | tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); | 238 | tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); |
239 | tar.Close(); | 239 | tar.Close(); |
240 | 240 | ||
241 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); | 241 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); |
242 | SerialiserModule serialiserModule = new SerialiserModule(); | 242 | SerialiserModule serialiserModule = new SerialiserModule(); |
243 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); | 243 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); |
244 | 244 | ||
@@ -271,9 +271,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
271 | Assert.That(foundItem1.Owner, Is.EqualTo(userUuid), | 271 | Assert.That(foundItem1.Owner, Is.EqualTo(userUuid), |
272 | "Loaded item owner doesn't match inventory reciever"); | 272 | "Loaded item owner doesn't match inventory reciever"); |
273 | 273 | ||
274 | // Now try loading to a root child folder | 274 | // Now try loading to a root child folder |
275 | UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xA"); | 275 | UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xA"); |
276 | archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); | 276 | archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); |
277 | archiverModule.DearchiveInventory(userFirstName, userLastName, "xA", "meowfood", archiveReadStream); | 277 | archiverModule.DearchiveInventory(userFirstName, userLastName, "xA", "meowfood", archiveReadStream); |
278 | 278 | ||
279 | InventoryItemBase foundItem2 | 279 | InventoryItemBase foundItem2 |
@@ -282,12 +282,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
282 | 282 | ||
283 | // Now try loading to a more deeply nested folder | 283 | // Now try loading to a more deeply nested folder |
284 | UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC"); | 284 | UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC"); |
285 | archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); | 285 | archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); |
286 | archiverModule.DearchiveInventory(userFirstName, userLastName, "xB/xC", "meowfood", archiveReadStream); | 286 | archiverModule.DearchiveInventory(userFirstName, userLastName, "xB/xC", "meowfood", archiveReadStream); |
287 | 287 | ||
288 | InventoryItemBase foundItem3 | 288 | InventoryItemBase foundItem3 |
289 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC/" + itemName); | 289 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC/" + itemName); |
290 | Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); | 290 | Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); |
291 | } | 291 | } |
292 | 292 | ||
293 | /// <summary> | 293 | /// <summary> |
@@ -299,7 +299,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
299 | /// (as tested in the a later commented out test) | 299 | /// (as tested in the a later commented out test) |
300 | [Test] | 300 | [Test] |
301 | public void TestLoadIarV0_1AbsentUsers() | 301 | public void TestLoadIarV0_1AbsentUsers() |
302 | { | 302 | { |
303 | TestHelper.InMethod(); | 303 | TestHelper.InMethod(); |
304 | 304 | ||
305 | log4net.Config.XmlConfigurator.Configure(); | 305 | log4net.Config.XmlConfigurator.Configure(); |
@@ -331,7 +331,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
331 | tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); | 331 | tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); |
332 | tar.Close(); | 332 | tar.Close(); |
333 | 333 | ||
334 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); | 334 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); |
335 | SerialiserModule serialiserModule = new SerialiserModule(); | 335 | SerialiserModule serialiserModule = new SerialiserModule(); |
336 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); | 336 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); |
337 | 337 | ||
@@ -357,8 +357,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
357 | // "Loaded item non-uuid creator doesn't match that of the loading user"); | 357 | // "Loaded item non-uuid creator doesn't match that of the loading user"); |
358 | Assert.That( | 358 | Assert.That( |
359 | foundItem1.CreatorIdAsUuid, Is.EqualTo(userUuid), | 359 | foundItem1.CreatorIdAsUuid, Is.EqualTo(userUuid), |
360 | "Loaded item uuid creator doesn't match that of the loading user"); | 360 | "Loaded item uuid creator doesn't match that of the loading user"); |
361 | } | 361 | } |
362 | 362 | ||
363 | /// <summary> | 363 | /// <summary> |
364 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where | 364 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where |
@@ -367,7 +367,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
367 | /// Disabled since temporary profiles have not yet been implemented. | 367 | /// Disabled since temporary profiles have not yet been implemented. |
368 | //[Test] | 368 | //[Test] |
369 | public void TestLoadIarV0_1TempProfiles() | 369 | public void TestLoadIarV0_1TempProfiles() |
370 | { | 370 | { |
371 | TestHelper.InMethod(); | 371 | TestHelper.InMethod(); |
372 | 372 | ||
373 | log4net.Config.XmlConfigurator.Configure(); | 373 | log4net.Config.XmlConfigurator.Configure(); |
@@ -396,7 +396,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
396 | tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); | 396 | tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); |
397 | tar.Close(); | 397 | tar.Close(); |
398 | 398 | ||
399 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); | 399 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); |
400 | SerialiserModule serialiserModule = new SerialiserModule(); | 400 | SerialiserModule serialiserModule = new SerialiserModule(); |
401 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); | 401 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); |
402 | 402 | ||
@@ -436,7 +436,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
436 | Assert.That(foundItem.Owner, Is.EqualTo(userUuid)); | 436 | Assert.That(foundItem.Owner, Is.EqualTo(userUuid)); |
437 | 437 | ||
438 | Console.WriteLine("### Successfully completed {0} ###", MethodBase.GetCurrentMethod()); | 438 | Console.WriteLine("### Successfully completed {0} ###", MethodBase.GetCurrentMethod()); |
439 | } | 439 | } |
440 | 440 | ||
441 | /// <summary> | 441 | /// <summary> |
442 | /// Test replication of an archive path to the user's inventory. | 442 | /// Test replication of an archive path to the user's inventory. |
@@ -474,7 +474,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
474 | string itemArchivePath | 474 | string itemArchivePath |
475 | = string.Format( | 475 | = string.Format( |
476 | "{0}{1}{2}{3}", | 476 | "{0}{1}{2}{3}", |
477 | ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemArchiveName); | 477 | ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemArchiveName); |
478 | 478 | ||
479 | //Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder); | 479 | //Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder); |
480 | 480 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 75976e2..734230c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -172,9 +172,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
172 | Array.Copy(copyIDBytes, 0, im.binaryBucket, 1, copyIDBytes.Length); | 172 | Array.Copy(copyIDBytes, 0, im.binaryBucket, 1, copyIDBytes.Length); |
173 | 173 | ||
174 | if (user != null && !user.IsChildAgent) | 174 | if (user != null && !user.IsChildAgent) |
175 | { | 175 | { |
176 | user.ControllingClient.SendBulkUpdateInventory(folderCopy); | 176 | user.ControllingClient.SendBulkUpdateInventory(folderCopy); |
177 | } | 177 | } |
178 | } | 178 | } |
179 | else | 179 | else |
180 | { | 180 | { |
@@ -199,10 +199,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
199 | } | 199 | } |
200 | 200 | ||
201 | copyID = itemCopy.ID; | 201 | copyID = itemCopy.ID; |
202 | Array.Copy(copyID.GetBytes(), 0, im.binaryBucket, 1, 16); | 202 | Array.Copy(copyID.GetBytes(), 0, im.binaryBucket, 1, 16); |
203 | 203 | ||
204 | if (user != null && !user.IsChildAgent) | 204 | if (user != null && !user.IsChildAgent) |
205 | { | 205 | { |
206 | user.ControllingClient.SendBulkUpdateInventory(itemCopy); | 206 | user.ControllingClient.SendBulkUpdateInventory(itemCopy); |
207 | } | 207 | } |
208 | } | 208 | } |
@@ -241,7 +241,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
241 | } | 241 | } |
242 | } | 242 | } |
243 | else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined) | 243 | else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined) |
244 | { | 244 | { |
245 | // Here, the recipient is local and we can assume that the | 245 | // Here, the recipient is local and we can assume that the |
246 | // inventory is loaded. Courtesy of the above bulk update, | 246 | // inventory is loaded. Courtesy of the above bulk update, |
247 | // It will have been pushed to the client, too | 247 | // It will have been pushed to the client, too |
@@ -284,7 +284,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
284 | } | 284 | } |
285 | 285 | ||
286 | if ((null == item && null == folder) | null == trashFolder) | 286 | if ((null == item && null == folder) | null == trashFolder) |
287 | { | 287 | { |
288 | string reason = String.Empty; | 288 | string reason = String.Empty; |
289 | 289 | ||
290 | if (trashFolder == null) | 290 | if (trashFolder == null) |