From 8fffdac7fa724c651935acb46725bc101cf8dfee Mon Sep 17 00:00:00 2001 From: diva Date: Mon, 15 Dec 2008 20:45:40 +0000 Subject: Attempt at restoring inventory access after TPs/crossings. RemoveClient in Scene was being too aggressive at nixing the user out of the cache. We're now relying on NeedSceneCacheClear to decide whether to nix it or not. All other mods in other files are for better debugging messages. --- OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | 1 + .../Modules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | 9 +++++++++ OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 6 +++++- OpenSim/Region/Environment/Scenes/Scene.cs | 6 +++++- 4 files changed, 20 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index a1b658f..99a982b 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -194,6 +194,7 @@ namespace OpenSim.Framework.Communications.Cache /// public void DropInventory() { + m_log.Debug("[INVENTORY CACHE]: DropInventory called"); // Make sure there aren't pending requests around when we do this // FIXME: There is still a race condition where an inventory operation can be requested (since these aren't being locked). // Will have to extend locking to exclude this very soon. diff --git a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 0e3634c..20ea030 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -350,11 +350,18 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Transfer // are we even doing here?? // if (s == scene) + { + //m_log.Debug("[INVTRANSFERMOD]: s == scene. Returning true in " + scene.RegionInfo.RegionName); return true; + } else + { + //m_log.Debug("[INVTRANSFERMOD]: s != scene. Returning false in " + scene.RegionInfo.RegionName); return false; + } } } + //m_log.Debug("[INVTRANSFERMOD]: agent not in scene. Returning true in " + scene.RegionInfo.RegionName); return true; } @@ -363,12 +370,14 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Transfer // if (m_AgentRegions[agentID] == scene) { + //m_log.Debug("[INVTRANSFERMOD]: m_AgentRegions[agentID] == scene. Returning true in " + scene.RegionInfo.RegionName); m_AgentRegions.Remove(agentID); return true; } // Another region has claimed the agent // + //m_log.Debug("[INVTRANSFERMOD]: last resort. Returning false in " + scene.RegionInfo.RegionName); return false; } diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index c98c4f3..7c518c4 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -2106,7 +2106,7 @@ namespace OpenSim.Region.Environment.Scenes string xmlData = Utils.BytesToString(rezAsset.Data); SceneObjectGroup group = new SceneObjectGroup(xmlData, true); if (!Permissions.CanRezObject( - group.Children.Count, remoteClient.AgentId, pos) + group.Children.Count, remoteClient.AgentId, pos) && !attachment) { return null; @@ -2226,7 +2226,11 @@ namespace OpenSim.Region.Environment.Scenes } } } + else + m_log.WarnFormat("[AGENT INVENTORY]: Root folder not found in {0}", RegionInfo.RegionName); } + else + m_log.WarnFormat("[AGENT INVENTORY]: User profile not found in {0}", RegionInfo.RegionName); return null; } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 873662e..f6d82c4 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2709,7 +2709,11 @@ namespace OpenSim.Region.Environment.Scenes m_sceneGraph.removeUserCount(!childagentYN); RemoveCapsHandler(agentID); - CommsManager.UserProfileCacheService.RemoveUser(agentID); + if (avatar.Scene.NeedSceneCacheClear(avatar.UUID)) + { + m_log.InfoFormat("[SCENE]: User {0} is going to another region, profile cache removed in {1}", avatar.UUID, RegionInfo.RegionName); + CommsManager.UserProfileCacheService.RemoveUser(agentID); + } if (!avatar.IsChildAgent) { -- cgit v1.1