diff options
author | Justin Clarke Casey | 2008-04-22 17:24:13 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-04-22 17:24:13 +0000 |
commit | 269a2e4b887b9841309d4472508b19324a91d80d (patch) | |
tree | 46b73fce787b9e296c06265a66baba2caa92b8d4 /OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | |
parent | * ODE Update! If you roll your own, make sure to download the lib source ag... (diff) | |
download | opensim-SC-269a2e4b887b9841309d4472508b19324a91d80d.zip opensim-SC-269a2e4b887b9841309d4472508b19324a91d80d.tar.gz opensim-SC-269a2e4b887b9841309d4472508b19324a91d80d.tar.bz2 opensim-SC-269a2e4b887b9841309d4472508b19324a91d80d.tar.xz |
* Allow folder renaming to complete after an agent inventory has been received by a region from the inventory service
* This replaces the old behaviour of failing straight away, which could cause lost updates if the inventory service was slow in responding
* This is the first baby step to making all inventory requests behave this way, to reduce inventory lossage
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index bf8ff40..cbf2ded 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | |||
@@ -201,6 +201,9 @@ namespace OpenSim.Framework.Communications.Cache | |||
201 | public void HandleUpdateInventoryFolder(IClientAPI remoteClient, LLUUID folderID, ushort type, string name, | 201 | public void HandleUpdateInventoryFolder(IClientAPI remoteClient, LLUUID folderID, ushort type, string name, |
202 | LLUUID parentID) | 202 | LLUUID parentID) |
203 | { | 203 | { |
204 | // m_log.DebugFormat( | ||
205 | // "[AGENT INVENTORY] Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId); | ||
206 | |||
204 | CachedUserInfo userProfile; | 207 | CachedUserInfo userProfile; |
205 | 208 | ||
206 | if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) | 209 | if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) |
@@ -216,6 +219,10 @@ namespace OpenSim.Framework.Communications.Cache | |||
216 | baseFolder.Version = userProfile.RootFolder.Version; | 219 | baseFolder.Version = userProfile.RootFolder.Version; |
217 | m_commsManager.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, baseFolder); | 220 | m_commsManager.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, baseFolder); |
218 | } | 221 | } |
222 | else | ||
223 | { | ||
224 | userProfile.AddRequest(new UpdateFolderRequest(this, remoteClient, folderID, type, name, parentID)); | ||
225 | } | ||
219 | } | 226 | } |
220 | } | 227 | } |
221 | 228 | ||
@@ -492,4 +499,33 @@ namespace OpenSim.Framework.Communications.Cache | |||
492 | } | 499 | } |
493 | } | 500 | } |
494 | } | 501 | } |
502 | |||
503 | /// <summary> | ||
504 | /// Used to create an update folder request if we haven't yet received the user's inventory | ||
505 | /// </summary> | ||
506 | internal class UpdateFolderRequest : IInventoryRequest | ||
507 | { | ||
508 | private UserProfileCacheService m_userProfileCacheService; | ||
509 | private IClientAPI m_client; | ||
510 | private LLUUID m_folderID; | ||
511 | private ushort m_type; | ||
512 | private string m_name; | ||
513 | private LLUUID m_parentID; | ||
514 | |||
515 | internal UpdateFolderRequest( | ||
516 | UserProfileCacheService cacheService, IClientAPI client, LLUUID folderID, ushort type, string name, LLUUID parentID) | ||
517 | { | ||
518 | m_userProfileCacheService = cacheService; | ||
519 | m_client = client; | ||
520 | m_folderID = folderID; | ||
521 | m_type = type; | ||
522 | m_name = name; | ||
523 | m_parentID = parentID; | ||
524 | } | ||
525 | |||
526 | public void Execute() | ||
527 | { | ||
528 | m_userProfileCacheService.HandleUpdateInventoryFolder(m_client, m_folderID, m_type, m_name, m_parentID); | ||
529 | } | ||
530 | } | ||
495 | } | 531 | } |