aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-02-11 20:24:41 +0000
committerJustin Clarke Casey2009-02-11 20:24:41 +0000
commit9b6035c2a6fec0817f6e751ec8827489f8bcb697 (patch)
tree5bea97f28cea9bfeb3fe647bed326abaf1fecc8a /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
parent* Change SendBulkUpdateInventory from two methods to one which accepts an Inv... (diff)
downloadopensim-SC_OLD-9b6035c2a6fec0817f6e751ec8827489f8bcb697.zip
opensim-SC_OLD-9b6035c2a6fec0817f6e751ec8827489f8bcb697.tar.gz
opensim-SC_OLD-9b6035c2a6fec0817f6e751ec8827489f8bcb697.tar.bz2
opensim-SC_OLD-9b6035c2a6fec0817f6e751ec8827489f8bcb697.tar.xz
* When an inventory archive is loaded, immediately update the client's inventory if that client is online at that region server
* Not useable yet
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs62
1 files changed, 46 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index ab914c4..a684b69 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -31,6 +31,7 @@ using System.Reflection;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenMetaverse; 33using OpenMetaverse;
34using OpenSim.Framework;
34using OpenSim.Framework.Communications; 35using OpenSim.Framework.Communications;
35using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
36using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
@@ -96,7 +97,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
96 { 97 {
97 if (m_scenes.Count > 0) 98 if (m_scenes.Count > 0)
98 { 99 {
99 new InventoryArchiveReadRequest(firstName, lastName, invPath, loadStream, m_commsManager).Execute(); 100 InventoryArchiveReadRequest request =
101 new InventoryArchiveReadRequest(firstName, lastName, invPath, loadStream, m_commsManager);
102
103 UpdateClientWithLoadedNodes(firstName, lastName, request.Execute());
100 } 104 }
101 } 105 }
102 106
@@ -111,20 +115,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
111 public void DearchiveInventory(string firstName, string lastName, string invPath, string loadPath) 115 public void DearchiveInventory(string firstName, string lastName, string invPath, string loadPath)
112 { 116 {
113 if (m_scenes.Count > 0) 117 if (m_scenes.Count > 0)
114 { 118 {
115 new InventoryArchiveReadRequest(firstName, lastName, invPath, loadPath, m_commsManager).Execute(); 119 InventoryArchiveReadRequest request =
116 } 120 new InventoryArchiveReadRequest(firstName, lastName, invPath, loadPath, m_commsManager);
117 121
118 /* 122 UpdateClientWithLoadedNodes(firstName, lastName, request.Execute());
119 foreach (Scene scene in m_scenes.Values) 123 }
120 {
121 ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
122 if (user != null && !user.IsChildAgent)
123 {
124 user.ControllingClient.SendBulkUpdateInventory(folderCopy);
125 }
126 }
127 */
128 } 124 }
129 125
130 public void ArchiveInventory(string firstName, string lastName, string invPath, string savePath) 126 public void ArchiveInventory(string firstName, string lastName, string invPath, string savePath)
@@ -175,6 +171,40 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
175 string savePath = (cmdparams.Length > 5 ? cmdparams[5] : DEFAULT_INV_BACKUP_FILENAME); 171 string savePath = (cmdparams.Length > 5 ? cmdparams[5] : DEFAULT_INV_BACKUP_FILENAME);
176 172
177 ArchiveInventory(firstName, lastName, invPath, savePath); 173 ArchiveInventory(firstName, lastName, invPath, savePath);
178 } 174 }
175
176 /// <summary>
177 /// Notify the client of loaded nodes if they are logged in
178 /// </summary>
179 /// <param name="loadedNodes">Can be empty. In which case, nothing happens</param>
180 private void UpdateClientWithLoadedNodes(string firstName, string lastName, List<InventoryNodeBase> loadedNodes)
181 {
182 if (loadedNodes.Count == 0)
183 return;
184
185 UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(firstName, lastName);
186
187 if (null == userProfile)
188 return;
189
190 foreach (Scene scene in m_scenes.Values)
191 {
192 ScenePresence user = scene.GetScenePresence(userProfile.ID);
193
194 if (user != null && !user.IsChildAgent)
195 {
196 foreach (InventoryNodeBase node in loadedNodes)
197 {
198 m_log.DebugFormat(
199 "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}",
200 user.Name, node.Name);
201
202 user.ControllingClient.SendBulkUpdateInventory(node);
203 }
204
205 break;
206 }
207 }
208 }
179 } 209 }
180} 210}