diff options
author | Jeff Ames | 2009-10-01 01:00:09 +0900 |
---|---|---|
committer | Jeff Ames | 2009-10-01 01:17:47 +0900 |
commit | ee205e7e812e170f670e690a4e0fa9caa652f226 (patch) | |
tree | df407e66d9aa47a884e39d5d86b877d6ef468a1a /OpenSim/Region/CoreModules/Avatar | |
parent | adding LandDataSerializer (not connected anywhere, work-in-progress) (diff) | |
download | opensim-SC-ee205e7e812e170f670e690a4e0fa9caa652f226.zip opensim-SC-ee205e7e812e170f670e690a4e0fa9caa652f226.tar.gz opensim-SC-ee205e7e812e170f670e690a4e0fa9caa652f226.tar.bz2 opensim-SC-ee205e7e812e170f670e690a4e0fa9caa652f226.tar.xz |
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
12 files changed, 93 insertions, 93 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 dd9b318..fc7d63a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -497,7 +497,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
497 | { | 497 | { |
498 | 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); |
499 | } | 499 | } |
500 | } | 500 | } |
501 | 501 | ||
502 | #region FriendRequestHandling | 502 | #region FriendRequestHandling |
503 | 503 | ||
@@ -508,7 +508,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
508 | 508 | ||
509 | if (im.dialog == (byte)InstantMessageDialog.FriendshipOffered) // 38 | 509 | if (im.dialog == (byte)InstantMessageDialog.FriendshipOffered) // 38 |
510 | { | 510 | { |
511 | // fromAgentName is the *destination* name (the friend we offer friendship to) | 511 | // fromAgentName is the *destination* name (the friend we offer friendship to) |
512 | ScenePresence initiator = GetAnyPresenceFromAgentID(new UUID(im.fromAgentID)); | 512 | ScenePresence initiator = GetAnyPresenceFromAgentID(new UUID(im.fromAgentID)); |
513 | im.fromAgentName = initiator != null ? initiator.Name : "(hippo)"; | 513 | im.fromAgentName = initiator != null ? initiator.Name : "(hippo)"; |
514 | 514 | ||
@@ -528,13 +528,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
528 | /// Invoked when a user offers a friendship. | 528 | /// Invoked when a user offers a friendship. |
529 | /// </summary> | 529 | /// </summary> |
530 | /// | 530 | /// |
531 | /// <param name="im"></param> | 531 | /// <param name="im"></param> |
532 | /// <param name="client"></param> | 532 | /// <param name="client"></param> |
533 | private void FriendshipOffered(GridInstantMessage im) | 533 | private void FriendshipOffered(GridInstantMessage im) |
534 | { | 534 | { |
535 | // this is triggered by the initiating agent: | 535 | // this is triggered by the initiating agent: |
536 | // A local agent offers friendship to some possibly remote friend. | 536 | // A local agent offers friendship to some possibly remote friend. |
537 | // 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). |
538 | 538 | ||
539 | 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}", |
540 | 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); |
@@ -559,7 +559,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
559 | m_log.DebugFormat("[FRIEND]: sending IM success = {0}", success); | 559 | m_log.DebugFormat("[FRIEND]: sending IM success = {0}", success); |
560 | } | 560 | } |
561 | ); | 561 | ); |
562 | } | 562 | } |
563 | } | 563 | } |
564 | 564 | ||
565 | /// <summary> | 565 | /// <summary> |
@@ -570,7 +570,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
570 | private void FriendshipAccepted(IClientAPI client, GridInstantMessage im) | 570 | private void FriendshipAccepted(IClientAPI client, GridInstantMessage im) |
571 | { | 571 | { |
572 | 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})", |
573 | 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); |
574 | } | 574 | } |
575 | 575 | ||
576 | /// <summary> | 576 | /// <summary> |
@@ -602,7 +602,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
602 | delegate(bool success) { | 602 | delegate(bool success) { |
603 | m_log.DebugFormat("[FRIEND]: sending IM success = {0}", success); | 603 | m_log.DebugFormat("[FRIEND]: sending IM success = {0}", success); |
604 | } | 604 | } |
605 | ); | 605 | ); |
606 | } | 606 | } |
607 | 607 | ||
608 | 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/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 c6ebb24..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 | ||
@@ -168,7 +168,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
168 | { | 168 | { |
169 | path += CreateArchiveFolderName(inventoryFolder); | 169 | path += CreateArchiveFolderName(inventoryFolder); |
170 | 170 | ||
171 | // We need to make sure that we record empty folders | 171 | // We need to make sure that we record empty folders |
172 | m_archiveWriter.WriteDir(path); | 172 | m_archiveWriter.WriteDir(path); |
173 | } | 173 | } |
174 | 174 | ||
@@ -262,7 +262,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
262 | if (maxComponentIndex >= 0 && components[maxComponentIndex] == STAR_WILDCARD) | 262 | if (maxComponentIndex >= 0 && components[maxComponentIndex] == STAR_WILDCARD) |
263 | { | 263 | { |
264 | foundStar = true; | 264 | foundStar = true; |
265 | maxComponentIndex--; | 265 | maxComponentIndex--; |
266 | } | 266 | } |
267 | 267 | ||
268 | m_invPath = String.Empty; | 268 | m_invPath = String.Empty; |
@@ -369,8 +369,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
369 | /// <returns></returns> | 369 | /// <returns></returns> |
370 | public static string CreateArchiveFolderName(InventoryFolderBase folder) | 370 | public static string CreateArchiveFolderName(InventoryFolderBase folder) |
371 | { | 371 | { |
372 | return CreateArchiveFolderName(folder.Name, folder.ID); | 372 | return CreateArchiveFolderName(folder.Name, folder.ID); |
373 | } | 373 | } |
374 | 374 | ||
375 | /// <summary> | 375 | /// <summary> |
376 | /// Create the archive name for a particular item. | 376 | /// Create the archive name for a particular item. |
@@ -383,7 +383,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
383 | /// <returns></returns> | 383 | /// <returns></returns> |
384 | public static string CreateArchiveItemName(InventoryItemBase item) | 384 | public static string CreateArchiveItemName(InventoryItemBase item) |
385 | { | 385 | { |
386 | return CreateArchiveItemName(item.Name, item.ID); | 386 | return CreateArchiveItemName(item.Name, item.ID); |
387 | } | 387 | } |
388 | 388 | ||
389 | /// <summary> | 389 | /// <summary> |
@@ -398,7 +398,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
398 | "{0}{1}{2}/", | 398 | "{0}{1}{2}/", |
399 | name, | 399 | name, |
400 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, | 400 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, |
401 | id); | 401 | id); |
402 | } | 402 | } |
403 | 403 | ||
404 | /// <summary> | 404 | /// <summary> |
@@ -406,14 +406,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
406 | /// </summary> | 406 | /// </summary> |
407 | /// <param name="name"></param> | 407 | /// <param name="name"></param> |
408 | /// <param name="id"></param> | 408 | /// <param name="id"></param> |
409 | /// <returns></returns> | 409 | /// <returns></returns> |
410 | public static string CreateArchiveItemName(string name, UUID id) | 410 | public static string CreateArchiveItemName(string name, UUID id) |
411 | { | 411 | { |
412 | return string.Format( | 412 | return string.Format( |
413 | "{0}{1}{2}.xml", | 413 | "{0}{1}{2}.xml", |
414 | name, | 414 | name, |
415 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, | 415 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, |
416 | id); | 416 | id); |
417 | } | 417 | } |
418 | 418 | ||
419 | /// <summary> | 419 | /// <summary> |
@@ -438,6 +438,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
438 | sw.Close(); | 438 | sw.Close(); |
439 | 439 | ||
440 | return s; | 440 | return s; |
441 | } | 441 | } |
442 | } | 442 | } |
443 | } \ 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 55dce05..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); |
@@ -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, |
@@ -322,7 +322,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
322 | /// <param name="pass">User password</param> | 322 | /// <param name="pass">User password</param> |
323 | /// <returns></returns> | 323 | /// <returns></returns> |
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 | //m_aScene.CommsManager.UserService.GetUserProfile(firstName, lastName); |
328 | if (null == userInfo) | 328 | if (null == userInfo) |
@@ -334,7 +334,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
334 | } | 334 | } |
335 | 335 | ||
336 | try | 336 | try |
337 | { | 337 | { |
338 | if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass)) | 338 | if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass)) |
339 | { | 339 | { |
340 | return userInfo; | 340 | return userInfo; |
@@ -343,7 +343,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
343 | { | 343 | { |
344 | m_log.ErrorFormat( | 344 | m_log.ErrorFormat( |
345 | "[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.", | 345 | "[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.", |
346 | firstName, lastName); | 346 | firstName, lastName); |
347 | return null; | 347 | return null; |
348 | } | 348 | } |
349 | } | 349 | } |
@@ -359,7 +359,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
359 | /// </summary> | 359 | /// </summary> |
360 | /// <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> |
361 | private void UpdateClientWithLoadedNodes(CachedUserInfo userInfo, List<InventoryNodeBase> loadedNodes) | 361 | private void UpdateClientWithLoadedNodes(CachedUserInfo userInfo, List<InventoryNodeBase> loadedNodes) |
362 | { | 362 | { |
363 | if (loadedNodes.Count == 0) | 363 | if (loadedNodes.Count == 0) |
364 | return; | 364 | return; |
365 | 365 | ||
@@ -368,7 +368,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
368 | ScenePresence user = scene.GetScenePresence(userInfo.UserProfile.ID); | 368 | ScenePresence user = scene.GetScenePresence(userInfo.UserProfile.ID); |
369 | 369 | ||
370 | if (user != null && !user.IsChildAgent) | 370 | if (user != null && !user.IsChildAgent) |
371 | { | 371 | { |
372 | foreach (InventoryNodeBase node in loadedNodes) | 372 | foreach (InventoryNodeBase node in loadedNodes) |
373 | { | 373 | { |
374 | // m_log.DebugFormat( | 374 | // m_log.DebugFormat( |
@@ -379,8 +379,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
379 | } | 379 | } |
380 | 380 | ||
381 | break; | 381 | break; |
382 | } | 382 | } |
383 | } | 383 | } |
384 | } | 384 | } |
385 | 385 | ||
386 | /// <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) |