From ac77c32453fdeffc03a5abbb6cbb037dfc1e7c0d Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 2 Dec 2007 20:43:21 +0000 Subject: Attempt to fix mantis issue #82, taking prims into inventory and then rezzing them in another region. --- .../Framework/Communications/Cache/CachedUserInfo.cs | 20 ++++++++++++++++---- .../Communications/Cache/UserProfileCacheService.cs | 9 +++++++++ OpenSim/Framework/Servers/BaseHttpServer.cs | 2 +- 3 files changed, 26 insertions(+), 5 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 8fbc3fd..81ee29b 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -55,14 +55,20 @@ namespace OpenSim.Framework.Communications.Cache } else if (RootFolder.folderID == folderInfo.parentID) { - RootFolder.SubFolders.Add(folderInfo.folderID, folderInfo); + if (!RootFolder.SubFolders.ContainsKey(folderInfo.folderID)) + { + RootFolder.SubFolders.Add(folderInfo.folderID, folderInfo); + } } else { InventoryFolderImpl folder = RootFolder.HasSubFolder(folderInfo.parentID); if (folder != null) { - folder.SubFolders.Add(folderInfo.folderID, folderInfo); + if (!folder.SubFolders.ContainsKey(folderInfo.folderID)) + { + folder.SubFolders.Add(folderInfo.folderID, folderInfo); + } } } } @@ -74,14 +80,20 @@ namespace OpenSim.Framework.Communications.Cache { if (itemInfo.parentFolderID == RootFolder.folderID) { - RootFolder.Items.Add(itemInfo.inventoryID, itemInfo); + if (!RootFolder.Items.ContainsKey(itemInfo.inventoryID)) + { + RootFolder.Items.Add(itemInfo.inventoryID, itemInfo); + } } else { InventoryFolderImpl folder = RootFolder.HasSubFolder(itemInfo.parentFolderID); if (folder != null) { - folder.Items.Add(itemInfo.inventoryID, itemInfo); + if (!folder.Items.ContainsKey(itemInfo.inventoryID)) + { + folder.Items.Add(itemInfo.inventoryID, itemInfo); + } } } } diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index b24d763..fb4c3a6 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -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) { if (m_userProfiles.ContainsKey(userID)) diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index baf5add..aa6d315 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs @@ -211,7 +211,7 @@ namespace OpenSim.Framework.Servers else { System.Console.WriteLine("Handler not found for http request " +request.RawUrl); - responseString = "Error"; + responseString = "Error"; } } -- cgit v1.1