aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
diff options
context:
space:
mode:
authorJeff Ames2009-10-01 01:00:09 +0900
committerJeff Ames2009-10-01 01:17:47 +0900
commitee205e7e812e170f670e690a4e0fa9caa652f226 (patch)
treedf407e66d9aa47a884e39d5d86b877d6ef468a1a /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
parentadding LandDataSerializer (not connected anywhere, work-in-progress) (diff)
downloadopensim-SC_OLD-ee205e7e812e170f670e690a4e0fa9caa652f226.zip
opensim-SC_OLD-ee205e7e812e170f670e690a4e0fa9caa652f226.tar.gz
opensim-SC_OLD-ee205e7e812e170f670e690a4e0fa9caa652f226.tar.bz2
opensim-SC_OLD-ee205e7e812e170f670e690a4e0fa9caa652f226.tar.xz
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs46
1 files changed, 23 insertions, 23 deletions
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;
40using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
41 41
42namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver 42namespace 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>