* Make it possible to load and save inventory archives while a user is not logged in on standalone mode but not on grid mode

* No user functionality yet
0.6.3-post-fixes
Justin Clarke Casey 2009-02-12 19:54:19 +00:00
parent 5959e42683
commit 9177f28710
3 changed files with 58 additions and 33 deletions

View File

@ -172,6 +172,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
List<InventoryNodeBase> nodesLoaded = new List<InventoryNodeBase>(); List<InventoryNodeBase> nodesLoaded = new List<InventoryNodeBase>();
if (!m_userInfo.HasReceivedInventory) if (!m_userInfo.HasReceivedInventory)
{
// If the region server has access to the user admin service (by which users are created),
// then we'll assume that it's okay to fiddle with the user's inventory even if they are not on the
// server.
//
// FIXME: FetchInventory should probably be assumed to by async anyway, since even standalones might
// use a remote inventory service, though this is vanishingly rare at the moment.
if (null == commsManager.UserAdminService)
{ {
m_log.ErrorFormat( m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: Have not yet received inventory info for user {0} {1}", "[INVENTORY ARCHIVER]: Have not yet received inventory info for user {0} {1}",
@ -179,6 +187,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
return nodesLoaded; return nodesLoaded;
} }
else
{
m_userInfo.FetchInventory();
}
}
InventoryFolderImpl inventoryFolder = m_userInfo.RootFolder.FindFolderByPath(m_invPath); InventoryFolderImpl inventoryFolder = m_userInfo.RootFolder.FindFolderByPath(m_invPath);

View File

@ -183,8 +183,28 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
InventoryFolderImpl inventoryFolder = null; InventoryFolderImpl inventoryFolder = null;
InventoryItemBase inventoryItem = null; InventoryItemBase inventoryItem = null;
if (m_userInfo.HasReceivedInventory) if (!m_userInfo.HasReceivedInventory)
{ {
// If the region server has access to the user admin service (by which users are created),
// then we'll assume that it's okay to fiddle with the user's inventory even if they are not on the
// server.
//
// FIXME: FetchInventory should probably be assumed to by async anyway, since even standalones might
// use a remote inventory service, though this is vanishingly rare at the moment.
if (null == commsManager.UserAdminService)
{
m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: Have not yet received inventory info for user {0} {1}",
m_userInfo.UserProfile.Name, m_userInfo.UserProfile.ID);
return;
}
else
{
m_userInfo.FetchInventory();
}
}
// Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl
// itself (possibly at a small loss in efficiency). // itself (possibly at a small loss in efficiency).
string[] components string[] components
@ -212,14 +232,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{ {
inventoryItem = m_userInfo.RootFolder.FindItemByPath(m_invPath); inventoryItem = m_userInfo.RootFolder.FindItemByPath(m_invPath);
} }
}
else
{
m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: Have not yet received inventory info for user {0} {1}",
m_userInfo.UserProfile.Name, m_userInfo.UserProfile.ID);
return;
}
if (null == inventoryFolder) if (null == inventoryFolder)
{ {