Attempt to fix mantis issue #82, taking prims into inventory and then rezzing them in another region.

afrisby
MW 2007-12-02 20:43:21 +00:00
parent 5ae8759de1
commit ac77c32453
5 changed files with 29 additions and 5 deletions

View File

@ -54,38 +54,50 @@ namespace OpenSim.Framework.Communications.Cache
} }
} }
else if (RootFolder.folderID == folderInfo.parentID) else if (RootFolder.folderID == folderInfo.parentID)
{
if (!RootFolder.SubFolders.ContainsKey(folderInfo.folderID))
{ {
RootFolder.SubFolders.Add(folderInfo.folderID, folderInfo); RootFolder.SubFolders.Add(folderInfo.folderID, folderInfo);
} }
}
else else
{ {
InventoryFolderImpl folder = RootFolder.HasSubFolder(folderInfo.parentID); InventoryFolderImpl folder = RootFolder.HasSubFolder(folderInfo.parentID);
if (folder != null) if (folder != null)
{
if (!folder.SubFolders.ContainsKey(folderInfo.folderID))
{ {
folder.SubFolders.Add(folderInfo.folderID, folderInfo); folder.SubFolders.Add(folderInfo.folderID, folderInfo);
} }
} }
} }
} }
}
public void ItemReceive(LLUUID userID, InventoryItemBase itemInfo) public void ItemReceive(LLUUID userID, InventoryItemBase itemInfo)
{ {
if ((userID == UserProfile.UUID) && (RootFolder != null)) if ((userID == UserProfile.UUID) && (RootFolder != null))
{ {
if (itemInfo.parentFolderID == RootFolder.folderID) if (itemInfo.parentFolderID == RootFolder.folderID)
{
if (!RootFolder.Items.ContainsKey(itemInfo.inventoryID))
{ {
RootFolder.Items.Add(itemInfo.inventoryID, itemInfo); RootFolder.Items.Add(itemInfo.inventoryID, itemInfo);
} }
}
else else
{ {
InventoryFolderImpl folder = RootFolder.HasSubFolder(itemInfo.parentFolderID); InventoryFolderImpl folder = RootFolder.HasSubFolder(itemInfo.parentFolderID);
if (folder != null) if (folder != null)
{
if (!folder.Items.ContainsKey(itemInfo.inventoryID))
{ {
folder.Items.Add(itemInfo.inventoryID, itemInfo); folder.Items.Add(itemInfo.inventoryID, itemInfo);
} }
} }
} }
} }
}
public void AddItem(LLUUID userID, InventoryItemBase itemInfo) public void AddItem(LLUUID userID, InventoryItemBase itemInfo)
{ {

View File

@ -72,6 +72,15 @@ namespace OpenSim.Framework.Communications.Cache
} }
} }
public void UpdateUserInventory(LLUUID userID)
{
CachedUserInfo userInfo = GetUserDetails(userID);
if (userInfo != null)
{
RequestInventoryForUser(userID, userInfo);
}
}
public CachedUserInfo GetUserDetails(LLUUID userID) public CachedUserInfo GetUserDetails(LLUUID userID)
{ {
if (m_userProfiles.ContainsKey(userID)) if (m_userProfiles.ContainsKey(userID))

View File

@ -106,6 +106,7 @@ namespace OpenSim.Region.Communications.OGS1
request.ItemCallBack(userID, item); request.ItemCallBack(userID, item);
} }
} }
m_RequestingInventory.Remove(userID);
} }
} }

View File

@ -425,6 +425,7 @@ namespace OpenSim.Region.Environment.Scenes
public void MakeRootAgent(LLVector3 pos, bool isFlying) public void MakeRootAgent(LLVector3 pos, bool isFlying)
{ {
m_newAvatar = true; m_newAvatar = true;
m_isChildAgent = false; m_isChildAgent = false;
@ -433,6 +434,7 @@ namespace OpenSim.Region.Environment.Scenes
AddToPhysicalScene(); AddToPhysicalScene();
m_physicsActor.Flying = isFlying; m_physicsActor.Flying = isFlying;
m_scene.CommsManager.UserProfileCacheService.UpdateUserInventory(m_uuid);
//if (!m_gotAllObjectsInScene) //if (!m_gotAllObjectsInScene)
//{ //{
//m_scene.SendAllSceneObjectsToClient(this); //m_scene.SendAllSceneObjectsToClient(this);