From 33ea86374a19e9d74d673f363b7981b84afe177c Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 18 Sep 2009 22:22:00 +0100
Subject: provide intelligble warning of why load/save iar doesn't work on grid
mode, pending a fix
---
.../Avatar/Inventory/Archiver/InventoryArchiverModule.cs | 14 ++++++++++++++
1 file changed, 14 insertions(+)
(limited to 'OpenSim/Region/CoreModules/Avatar/Inventory')
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index 9f49da9..dc201e1 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -324,6 +324,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
protected CachedUserInfo GetUserInfo(string firstName, string lastName, string pass)
{
CachedUserInfo userInfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(firstName, lastName);
+ //m_aScene.CommsManager.UserService.GetUserProfile(firstName, lastName);
if (null == userInfo)
{
m_log.ErrorFormat(
@@ -333,6 +334,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
}
string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(pass) + ":" + userInfo.UserProfile.PasswordSalt);
+
+ if (userInfo.UserProfile.PasswordHash == null || userInfo.UserProfile.PasswordHash == String.Empty)
+ {
+ m_log.ErrorFormat(
+ "[INVENTORY ARCHIVER]: Sorry, the grid mode service is not providing password hash details for the check. This will be fixed in an OpenSim git revision soon");
+
+ return null;
+ }
+
+// m_log.DebugFormat(
+// "[INVENTORY ARCHIVER]: received salt {0}, hash {1}, supplied hash {2}",
+// userInfo.UserProfile.PasswordSalt, userInfo.UserProfile.PasswordHash, md5PasswdHash);
+
if (userInfo.UserProfile.PasswordHash != md5PasswdHash)
{
m_log.ErrorFormat(
--
cgit v1.1
From 967cbde055948f7ccbe1908a296a4d155e646009 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 18 Sep 2009 22:25:32 +0100
Subject: correct off-by-one error in save iar command handling
---
.../CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/CoreModules/Avatar/Inventory')
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index dc201e1..196205c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
///
protected void HandleSaveInvConsoleCommand(string module, string[] cmdparams)
{
- if (cmdparams.Length < 5)
+ if (cmdparams.Length < 6)
{
m_log.Error(
"[INVENTORY ARCHIVER]: usage is save iar []");
--
cgit v1.1
From 7870152d23db4cb6f5834d4921fac17feb717220 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 24 Sep 2009 14:54:12 +0100
Subject: Allow load/save iar password checks to be done in grid mode This
should allow load/save iar to work for grid mode as long as the grid user
service is later than this revision Grid services of earlier revisions will
always erroneously report incorrect password. This will be addressed
shortly.
---
.../Inventory/Archiver/InventoryArchiverModule.cs | 21 +++++----------------
1 file changed, 5 insertions(+), 16 deletions(-)
(limited to 'OpenSim/Region/CoreModules/Avatar/Inventory')
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index 196205c..b82b940 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -322,7 +322,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
/// User password
///
protected CachedUserInfo GetUserInfo(string firstName, string lastName, string pass)
- {
+ {
CachedUserInfo userInfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(firstName, lastName);
//m_aScene.CommsManager.UserService.GetUserProfile(firstName, lastName);
if (null == userInfo)
@@ -333,29 +333,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
return null;
}
- string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(pass) + ":" + userInfo.UserProfile.PasswordSalt);
-
- if (userInfo.UserProfile.PasswordHash == null || userInfo.UserProfile.PasswordHash == String.Empty)
+ if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass))
{
- m_log.ErrorFormat(
- "[INVENTORY ARCHIVER]: Sorry, the grid mode service is not providing password hash details for the check. This will be fixed in an OpenSim git revision soon");
-
- return null;
+ return userInfo;
}
-
-// m_log.DebugFormat(
-// "[INVENTORY ARCHIVER]: received salt {0}, hash {1}, supplied hash {2}",
-// userInfo.UserProfile.PasswordSalt, userInfo.UserProfile.PasswordHash, md5PasswdHash);
-
- if (userInfo.UserProfile.PasswordHash != md5PasswdHash)
+ else
{
m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
firstName, lastName);
+
return null;
}
-
- return userInfo;
}
///
--
cgit v1.1
From f62b5e6cec31fe496ec4b9f7dcd6ae1f4063bead Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 24 Sep 2009 15:19:47 +0100
Subject: Produce a different error message if the user service does not have
the authenticate method available
---
.../Inventory/Archiver/InventoryArchiverModule.cs | 29 ++++++++++++++--------
1 file changed, 18 insertions(+), 11 deletions(-)
(limited to 'OpenSim/Region/CoreModules/Avatar/Inventory')
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index b82b940..55dce05 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -333,16 +333,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
return null;
}
- if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass))
- {
- return userInfo;
+ try
+ {
+ if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass))
+ {
+ return userInfo;
+ }
+ else
+ {
+ m_log.ErrorFormat(
+ "[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
+ firstName, lastName);
+ return null;
+ }
}
- else
+ catch (Exception e)
{
- m_log.ErrorFormat(
- "[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
- firstName, lastName);
-
+ m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e.Message);
return null;
}
}
@@ -364,9 +371,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
foreach (InventoryNodeBase node in loadedNodes)
{
- m_log.DebugFormat(
- "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}",
- user.Name, node.Name);
+// m_log.DebugFormat(
+// "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}",
+// user.Name, node.Name);
user.ControllingClient.SendBulkUpdateInventory(node);
}
--
cgit v1.1
From 613cb417c01fbca0cc28c3ef0313bf46e8d7c586 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Sep 2009 14:52:53 +0100
Subject: add control files containing version info to iars
---
.../Archiver/InventoryArchiveWriteRequest.cs | 28 ++++++++++++++++++++++
1 file changed, 28 insertions(+)
(limited to 'OpenSim/Region/CoreModules/Avatar/Inventory')
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index 7b4a9eb..fd42586 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -118,6 +118,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
protected void ReceivedAllAssets(ICollection assetsFoundUuids, ICollection assetsNotFoundUuids)
{
+ // We're almost done. Just need to write out the control file now
+ m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile());
+ m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
+
Exception reportedException = null;
bool succeeded = true;
@@ -409,5 +413,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR,
id);
}
+
+ ///
+ /// Create the control file for a 0.1 version archive
+ ///
+ ///
+ public static string Create0p1ControlFile()
+ {
+ StringWriter sw = new StringWriter();
+ XmlTextWriter xtw = new XmlTextWriter(sw);
+ xtw.Formatting = Formatting.Indented;
+ xtw.WriteStartDocument();
+ xtw.WriteStartElement("archive");
+ xtw.WriteAttributeString("major_version", "0");
+ xtw.WriteAttributeString("minor_version", "1");
+ xtw.WriteEndElement();
+
+ xtw.Flush();
+ xtw.Close();
+
+ String s = sw.ToString();
+ sw.Close();
+
+ return s;
+ }
}
}
\ No newline at end of file
--
cgit v1.1
From 9249c026f25a0a24c62ca76fca37b1d23bcc3494 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Sep 2009 16:22:43 +0100
Subject: Don't preserve full user profile details within iars for now This
information was not being used in the load process
---
.../Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/CoreModules/Avatar/Inventory')
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index fd42586..c6ebb24 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -324,7 +324,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar);
}
- SaveUsers();
+ // Don't put all this profile information into the archive right now.
+ //SaveUsers();
+
new AssetsRequest(
new AssetsArchiver(m_archiveWriter), m_assetUuids.Keys,
m_scene.AssetService, ReceivedAllAssets).Execute();
--
cgit v1.1
From ee205e7e812e170f670e690a4e0fa9caa652f226 Mon Sep 17 00:00:00 2001
From: Jeff Ames
Date: Thu, 1 Oct 2009 01:00:09 +0900
Subject: Formatting cleanup.
---
.../Archiver/InventoryArchiveReadRequest.cs | 12 +++---
.../Inventory/Archiver/InventoryArchiveUtils.cs | 12 +++---
.../Archiver/InventoryArchiveWriteRequest.cs | 20 +++++-----
.../Inventory/Archiver/InventoryArchiverModule.cs | 46 +++++++++++-----------
.../Archiver/Tests/InventoryArchiverTests.cs | 36 ++++++++---------
.../Inventory/Transfer/InventoryTransferModule.cs | 12 +++---
6 files changed, 69 insertions(+), 69 deletions(-)
(limited to 'OpenSim/Region/CoreModules/Avatar/Inventory')
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
///
/// We only use this to request modules
///
- protected Scene m_scene;
+ protected Scene m_scene;
///
/// The stream from which the inventory archive will be loaded.
@@ -186,7 +186,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
item.Folder = foundFolder.ID;
//m_userInfo.AddItem(item);
- m_scene.InventoryService.AddItem(item);
+ m_scene.InventoryService.AddItem(item);
successfulItemRestores++;
// 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
= new InventoryFolderBase(
newFolderId, newFolderName, m_userInfo.UserProfile.ID,
(short)AssetType.Unknown, destFolder.ID, 1);
- m_scene.InventoryService.AddFolder(destFolder);
+ m_scene.InventoryService.AddFolder(destFolder);
// UUID newFolderId = UUID.Random();
// m_scene.InventoryService.AddFolder(
// m_userInfo.CreateFolder(
// folderName, newFolderId, (ushort)AssetType.Folder, foundFolder.ID);
-// m_log.DebugFormat("[INVENTORY ARCHIVER]: Retrieving newly created folder {0}", folderName);
+// m_log.DebugFormat("[INVENTORY ARCHIVER]: Retrieving newly created folder {0}", folderName);
// foundFolder = foundFolder.GetChildFolder(newFolderId);
// m_log.DebugFormat(
// "[INVENTORY ARCHIVER]: Retrieved newly created folder {0} with ID {1}",
@@ -321,7 +321,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
nodesLoaded.Add(destFolder);
i++;
- }
+ }
return destFolder;
@@ -357,7 +357,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
rawFolders[i++], newFolderId, (ushort)AssetType.Folder, foundFolder.ID);
foundFolder = foundFolder.GetChildFolder(newFolderId);
}
- */
+ */
}
///
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
///
/// Find a folder given a PATH_DELIMITER delimited path starting from a user's root folder
- ///
+ ///
///
/// This method does not handle paths that contain multiple delimitors
///
@@ -71,11 +71,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
return null;
return FindFolderByPath(inventoryService, rootFolder, path);
- }
+ }
///
/// Find a folder given a PATH_DELIMITER delimited path starting from this folder
- ///
+ ///
///
/// This method does not handle paths that contain multiple delimitors
///
@@ -154,7 +154,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
return null;
return FindItemByPath(inventoryService, rootFolder, path);
- }
+ }
///
/// Find an item given a PATH_DELIMITOR delimited path starting from this folder.
@@ -194,7 +194,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
}
else
{
- InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID);
+ InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID);
foreach (InventoryFolderBase folder in contents.Folders)
{
@@ -205,6 +205,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
// We didn't find an item or intermediate folder with the given name
return null;
- }
+ }
}
}
\ 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
private InventoryArchiverModule m_module;
private CachedUserInfo m_userInfo;
- private string m_invPath;
+ private string m_invPath;
protected TarArchiveWriter m_archiveWriter;
protected UuidGatherer m_assetGatherer;
@@ -168,7 +168,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
path += CreateArchiveFolderName(inventoryFolder);
- // We need to make sure that we record empty folders
+ // We need to make sure that we record empty folders
m_archiveWriter.WriteDir(path);
}
@@ -262,7 +262,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (maxComponentIndex >= 0 && components[maxComponentIndex] == STAR_WILDCARD)
{
foundStar = true;
- maxComponentIndex--;
+ maxComponentIndex--;
}
m_invPath = String.Empty;
@@ -369,8 +369,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
///
public static string CreateArchiveFolderName(InventoryFolderBase folder)
{
- return CreateArchiveFolderName(folder.Name, folder.ID);
- }
+ return CreateArchiveFolderName(folder.Name, folder.ID);
+ }
///
/// Create the archive name for a particular item.
@@ -383,7 +383,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
///
public static string CreateArchiveItemName(InventoryItemBase item)
{
- return CreateArchiveItemName(item.Name, item.ID);
+ return CreateArchiveItemName(item.Name, item.ID);
}
///
@@ -398,7 +398,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
"{0}{1}{2}/",
name,
ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR,
- id);
+ id);
}
///
@@ -406,14 +406,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
///
///
///
- ///
+ ///
public static string CreateArchiveItemName(string name, UUID id)
{
return string.Format(
"{0}{1}{2}.xml",
name,
ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR,
- id);
+ id);
}
///
@@ -438,6 +438,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
sw.Close();
return s;
- }
+ }
}
}
\ 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;
using OpenSim.Services.Interfaces;
namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
-{
+{
///
/// This module loads and saves OpenSimulator inventory archives
- ///
+ ///
public class InventoryArchiverModule : IRegionModule, IInventoryArchiverModule
- {
+ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public string Name { get { return "Inventory Archiver Module"; } }
@@ -57,7 +57,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
///
public bool DisablePresenceChecks { get; set; }
- public event InventoryArchiveSaved OnInventoryArchiveSaved;
+ public event InventoryArchiveSaved OnInventoryArchiveSaved;
///
/// The file to load and save inventory if no filename has been specified
@@ -83,7 +83,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
}
public void Initialise(Scene scene, IConfigSource source)
- {
+ {
if (m_scenes.Count == 0)
{
scene.RegisterModuleInterface(this);
@@ -102,7 +102,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
m_aScene = scene;
}
- m_scenes[scene.RegionInfo.RegionID] = scene;
+ m_scenes[scene.RegionInfo.RegionID] = scene;
}
public void PostInitialise() {}
@@ -119,7 +119,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
InventoryArchiveSaved handlerInventoryArchiveSaved = OnInventoryArchiveSaved;
if (handlerInventoryArchiveSaved != null)
handlerInventoryArchiveSaved(id, succeeded, userInfo, invPath, saveStream, reportedException);
- }
+ }
public bool ArchiveInventory(Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream)
{
@@ -174,7 +174,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
public bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, Stream loadStream)
{
if (m_scenes.Count > 0)
- {
+ {
CachedUserInfo userInfo = GetUserInfo(firstName, lastName, pass);
if (userInfo != null)
@@ -182,7 +182,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (CheckPresence(userInfo.UserProfile.ID))
{
InventoryArchiveReadRequest request =
- new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream);
+ new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream);
UpdateClientWithLoadedNodes(userInfo, request.Execute());
return true;
@@ -197,12 +197,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
}
return false;
- }
+ }
public bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, string loadPath)
{
if (m_scenes.Count > 0)
- {
+ {
CachedUserInfo userInfo = GetUserInfo(firstName, lastName, pass);
if (userInfo != null)
@@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (CheckPresence(userInfo.UserProfile.ID))
{
InventoryArchiveReadRequest request =
- new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath);
+ new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath);
UpdateClientWithLoadedNodes(userInfo, request.Execute());
return true;
@@ -221,11 +221,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
"[INVENTORY ARCHIVER]: User {0} {1} not logged in to this region simulator",
userInfo.UserProfile.Name, userInfo.UserProfile.ID);
}
- }
+ }
}
return false;
- }
+ }
///
/// Load inventory from an inventory file archive
@@ -252,7 +252,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
"[INVENTORY ARCHIVER]: Loading archive {0} to inventory path {1} for {2} {3}",
loadPath, invPath, firstName, lastName);
- if (DearchiveInventory(firstName, lastName, invPath, pass, loadPath))
+ if (DearchiveInventory(firstName, lastName, invPath, pass, loadPath))
m_log.InfoFormat(
"[INVENTORY ARCHIVER]: Loaded archive {0} for {1} {2}",
loadPath, firstName, lastName);
@@ -288,7 +288,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
lock (m_pendingConsoleSaves)
m_pendingConsoleSaves.Add(id);
- }
+ }
private void SaveInvConsoleCommandCompleted(
Guid id, bool succeeded, CachedUserInfo userInfo, string invPath, Stream saveStream,
@@ -322,7 +322,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
/// User password
///
protected CachedUserInfo GetUserInfo(string firstName, string lastName, string pass)
- {
+ {
CachedUserInfo userInfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(firstName, lastName);
//m_aScene.CommsManager.UserService.GetUserProfile(firstName, lastName);
if (null == userInfo)
@@ -334,7 +334,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
}
try
- {
+ {
if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass))
{
return userInfo;
@@ -343,7 +343,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
- firstName, lastName);
+ firstName, lastName);
return null;
}
}
@@ -359,7 +359,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
///
/// Can be empty. In which case, nothing happens
private void UpdateClientWithLoadedNodes(CachedUserInfo userInfo, List loadedNodes)
- {
+ {
if (loadedNodes.Count == 0)
return;
@@ -368,7 +368,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
ScenePresence user = scene.GetScenePresence(userInfo.UserProfile.ID);
if (user != null && !user.IsChildAgent)
- {
+ {
foreach (InventoryNodeBase node in loadedNodes)
{
// m_log.DebugFormat(
@@ -379,8 +379,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
}
break;
- }
- }
+ }
+ }
}
///
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;
using OpenSim.Data;
using OpenSim.Framework;
using OpenSim.Framework.Serialization;
-using OpenSim.Framework.Serialization.External;
+using OpenSim.Framework.Serialization.External;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Communications.Osp;
@@ -70,7 +70,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
Exception reportedException)
{
mre.Set();
- }
+ }
///
/// 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
string expectedObject1FilePath = string.Format(
"{0}{1}{2}",
ArchiveConstants.INVENTORY_PATH,
- InventoryArchiveWriteRequest.CreateArchiveFolderName(objsFolder),
+ InventoryArchiveWriteRequest.CreateArchiveFolderName(objsFolder),
expectedObject1FileName);
string filePath;
@@ -195,7 +195,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
Assert.That(gotObject1File, Is.True, "No item1 file in archive");
// Assert.That(gotObject2File, Is.True, "No object2 file in archive");
- // TODO: Test presence of more files and contents of files.
+ // TODO: Test presence of more files and contents of files.
}
///
@@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
/// This test also does some deeper probing of loading into nested inventory structures
[Test]
public void TestLoadIarV0_1ExistingUsers()
- {
+ {
TestHelper.InMethod();
//log4net.Config.XmlConfigurator.Configure();
@@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1));
tar.Close();
- MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
+ MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
SerialiserModule serialiserModule = new SerialiserModule();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
@@ -271,9 +271,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
Assert.That(foundItem1.Owner, Is.EqualTo(userUuid),
"Loaded item owner doesn't match inventory reciever");
- // Now try loading to a root child folder
+ // Now try loading to a root child folder
UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xA");
- archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
+ archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
archiverModule.DearchiveInventory(userFirstName, userLastName, "xA", "meowfood", archiveReadStream);
InventoryItemBase foundItem2
@@ -282,12 +282,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
// Now try loading to a more deeply nested folder
UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC");
- archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
+ archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
archiverModule.DearchiveInventory(userFirstName, userLastName, "xB/xC", "meowfood", archiveReadStream);
InventoryItemBase foundItem3
= InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC/" + itemName);
- Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3");
+ Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3");
}
///
@@ -299,7 +299,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
/// (as tested in the a later commented out test)
[Test]
public void TestLoadIarV0_1AbsentUsers()
- {
+ {
TestHelper.InMethod();
log4net.Config.XmlConfigurator.Configure();
@@ -331,7 +331,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1));
tar.Close();
- MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
+ MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
SerialiserModule serialiserModule = new SerialiserModule();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
@@ -357,8 +357,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
// "Loaded item non-uuid creator doesn't match that of the loading user");
Assert.That(
foundItem1.CreatorIdAsUuid, Is.EqualTo(userUuid),
- "Loaded item uuid creator doesn't match that of the loading user");
- }
+ "Loaded item uuid creator doesn't match that of the loading user");
+ }
///
/// 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
/// Disabled since temporary profiles have not yet been implemented.
//[Test]
public void TestLoadIarV0_1TempProfiles()
- {
+ {
TestHelper.InMethod();
log4net.Config.XmlConfigurator.Configure();
@@ -396,7 +396,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1));
tar.Close();
- MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
+ MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
SerialiserModule serialiserModule = new SerialiserModule();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
@@ -436,7 +436,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
Assert.That(foundItem.Owner, Is.EqualTo(userUuid));
Console.WriteLine("### Successfully completed {0} ###", MethodBase.GetCurrentMethod());
- }
+ }
///
/// Test replication of an archive path to the user's inventory.
@@ -474,7 +474,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
string itemArchivePath
= string.Format(
"{0}{1}{2}{3}",
- ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemArchiveName);
+ ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemArchiveName);
//Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder);
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
Array.Copy(copyIDBytes, 0, im.binaryBucket, 1, copyIDBytes.Length);
if (user != null && !user.IsChildAgent)
- {
+ {
user.ControllingClient.SendBulkUpdateInventory(folderCopy);
- }
+ }
}
else
{
@@ -199,10 +199,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
}
copyID = itemCopy.ID;
- Array.Copy(copyID.GetBytes(), 0, im.binaryBucket, 1, 16);
+ Array.Copy(copyID.GetBytes(), 0, im.binaryBucket, 1, 16);
if (user != null && !user.IsChildAgent)
- {
+ {
user.ControllingClient.SendBulkUpdateInventory(itemCopy);
}
}
@@ -241,7 +241,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
}
}
else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined)
- {
+ {
// Here, the recipient is local and we can assume that the
// inventory is loaded. Courtesy of the above bulk update,
// It will have been pushed to the client, too
@@ -284,7 +284,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
}
if ((null == item && null == folder) | null == trashFolder)
- {
+ {
string reason = String.Empty;
if (trashFolder == null)
--
cgit v1.1
From 606e831ff5337fb5e94dcebf9d6852bd4c434d4b Mon Sep 17 00:00:00 2001
From: Jeff Ames
Date: Thu, 1 Oct 2009 09:38:36 +0900
Subject: Formatting cleanup.
---
.../CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs | 4 ++--
.../CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/CoreModules/Avatar/Inventory')
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
index a73f868..a822d10 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
/// User id to search
///
///
- /// The path to the required folder.
+ /// The path to the required folder.
/// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned.
///
/// null if the folder is not found
@@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
/// The folder from which the path starts
///
///
- /// The path to the required folder.
+ /// The path to the required folder.
/// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned.
///
/// null if the folder is not found
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
index 734230c..d9a021f 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
@@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
byte[] copyIDBytes = copyID.GetBytes();
im.binaryBucket = new byte[1 + copyIDBytes.Length];
im.binaryBucket[0] = (byte)AssetType.Folder;
- Array.Copy(copyIDBytes, 0, im.binaryBucket, 1, copyIDBytes.Length);
+ Array.Copy(copyIDBytes, 0, im.binaryBucket, 1, copyIDBytes.Length);
if (user != null && !user.IsChildAgent)
{
--
cgit v1.1