diff options
author | Diva Canto | 2009-08-12 09:31:33 -0700 |
---|---|---|
committer | Diva Canto | 2009-08-12 09:31:33 -0700 |
commit | b3b506cba24f5c60afc2f4ed7a92e7a51e11eb4c (patch) | |
tree | 6756bb08ea58cdb42946f875dad8d58cce3bed00 /OpenSim | |
parent | change 535cb0efc so that the default LLSD serialization format is (diff) | |
download | opensim-SC_OLD-b3b506cba24f5c60afc2f4ed7a92e7a51e11eb4c.zip opensim-SC_OLD-b3b506cba24f5c60afc2f4ed7a92e7a51e11eb4c.tar.gz opensim-SC_OLD-b3b506cba24f5c60afc2f4ed7a92e7a51e11eb4c.tar.bz2 opensim-SC_OLD-b3b506cba24f5c60afc2f4ed7a92e7a51e11eb4c.tar.xz |
Better test for dropping inventory cache and writing out debug messages.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs index b4785f4..3afaba5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs | |||
@@ -60,8 +60,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
60 | 60 | ||
61 | // If not, go get them and place them in the cache | 61 | // If not, go get them and place them in the cache |
62 | Dictionary<AssetType, InventoryFolderBase> folders = GetSystemFolders(presence.UUID); | 62 | Dictionary<AssetType, InventoryFolderBase> folders = GetSystemFolders(presence.UUID); |
63 | m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent, fetched system folders for {0} {1}: count {2}", | 63 | m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent in {0}, fetched system folders for {1} {2}: count {3}", |
64 | presence.Firstname, presence.Lastname, folders.Count); | 64 | presence.Scene.RegionInfo.RegionName, presence.Firstname, presence.Lastname, folders.Count); |
65 | if (folders.Count > 0) | 65 | if (folders.Count > 0) |
66 | lock (m_InventoryCache) | 66 | lock (m_InventoryCache) |
67 | m_InventoryCache.Add(presence.UUID, folders); | 67 | m_InventoryCache.Add(presence.UUID, folders); |
@@ -69,25 +69,30 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
69 | 69 | ||
70 | void OnClientClosed(UUID clientID, Scene scene) | 70 | void OnClientClosed(UUID clientID, Scene scene) |
71 | { | 71 | { |
72 | ScenePresence sp = null; | 72 | if (m_InventoryCache.ContainsKey(clientID)) // if it's still in cache |
73 | foreach (Scene s in m_Scenes) | ||
74 | { | 73 | { |
75 | s.TryGetAvatar(clientID, out sp); | 74 | ScenePresence sp = null; |
76 | if ((sp != null) && !sp.IsChildAgent) | 75 | foreach (Scene s in m_Scenes) |
77 | { | 76 | { |
78 | m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping system folders in cache", | 77 | s.TryGetAvatar(clientID, out sp); |
79 | scene.RegionInfo.RegionName, clientID); | 78 | if ((sp != null) && !sp.IsChildAgent && (s != scene)) |
80 | return; | 79 | { |
80 | m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping system folders in cache", | ||
81 | scene.RegionInfo.RegionName, clientID); | ||
82 | return; | ||
83 | } | ||
81 | } | 84 | } |
82 | } | ||
83 | 85 | ||
84 | m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, user {1} out of sim. Dropping system folders", | 86 | // Drop system folders |
85 | scene.RegionInfo.RegionName, clientID); | 87 | lock (m_InventoryCache) |
86 | // Drop system folders | 88 | if (m_InventoryCache.ContainsKey(clientID)) |
87 | lock (m_InventoryCache) | 89 | { |
88 | if (m_InventoryCache.ContainsKey(clientID)) | 90 | m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, user {1} out of sim. Dropping system folders", |
89 | m_InventoryCache.Remove(clientID); | 91 | scene.RegionInfo.RegionName, clientID); |
90 | 92 | ||
93 | m_InventoryCache.Remove(clientID); | ||
94 | } | ||
95 | } | ||
91 | } | 96 | } |
92 | 97 | ||
93 | public abstract Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID); | 98 | public abstract Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID); |