aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-05-14 00:10:27 +0100
committerJustin Clark-Casey (justincc)2011-05-14 00:10:27 +0100
commit5573fcfa933bb9c594fb10d9b15477ab7e316b79 (patch)
tree9a2a24a60c69b3e31bf1aa6642ef5002ad81600a /OpenSim/Region/Framework/Scenes
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC-5573fcfa933bb9c594fb10d9b15477ab7e316b79.zip
opensim-SC-5573fcfa933bb9c594fb10d9b15477ab7e316b79.tar.gz
opensim-SC-5573fcfa933bb9c594fb10d9b15477ab7e316b79.tar.bz2
opensim-SC-5573fcfa933bb9c594fb10d9b15477ab7e316b79.tar.xz
Fix adding/removing/replacing outfits in viewer 2
To get this to work, I had to disable the dupe link check I put in a couple of commits ago. When the viewer adds wearables to an existing outfit, it first requests deletes of all the existing links before creating a new set. Since these messages are async, the creates were being received before the deletes had a chance to complete, resulting in missing current outfit links. However, the dupe check shouldn't be as important now that broken links have been fixed - it was the broken links that were causing the client to create dupes. Tested on kokua 0.1.0 WIP and SL 2.6.3. I now have no problems managing outfits on my standalone.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs45
1 files changed, 27 insertions, 18 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 3bf2c2b..e2420101 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -924,9 +924,9 @@ namespace OpenSim.Region.Framework.Scenes
924 uint callbackID, string description, string name, 924 uint callbackID, string description, string name,
925 sbyte invType, sbyte type, UUID olditemID) 925 sbyte invType, sbyte type, UUID olditemID)
926 { 926 {
927 m_log.DebugFormat( 927// m_log.DebugFormat(
928 "[AGENT INVENTORY]: Received request from {0} to create inventory item link {1} in folder {2} pointing to {3}", 928// "[AGENT INVENTORY]: Received request from {0} to create inventory item link {1} in folder {2} pointing to {3}",
929 remoteClient.Name, name, folderID, olditemID); 929// remoteClient.Name, name, folderID, olditemID);
930 930
931 if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) 931 if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
932 return; 932 return;
@@ -934,20 +934,25 @@ namespace OpenSim.Region.Framework.Scenes
934 ScenePresence presence; 934 ScenePresence presence;
935 if (TryGetScenePresence(remoteClient.AgentId, out presence)) 935 if (TryGetScenePresence(remoteClient.AgentId, out presence))
936 { 936 {
937 bool linkAlreadyExists = false; 937 // Disabled the check for duplicate links.
938 List<InventoryItemBase> existingItems = InventoryService.GetFolderItems(remoteClient.AgentId, folderID); 938 //
939 foreach (InventoryItemBase item in existingItems) 939 // When outfits are being adjusted, the viewer rapidly sends delete link messages followed by
940 if (item.AssetID == olditemID) 940 // create links. However, since these are handled asynchronously, the deletes do not complete before
941 linkAlreadyExists = true; 941 // the creates are handled. Therefore, we cannot enforce a duplicate link check.
942 942// InventoryItemBase existingLink = null;
943 if (linkAlreadyExists) 943// List<InventoryItemBase> existingItems = InventoryService.GetFolderItems(remoteClient.AgentId, folderID);
944 { 944// foreach (InventoryItemBase item in existingItems)
945 m_log.WarnFormat( 945// if (item.AssetID == olditemID)
946 "[AGENT INVENTORY]: Ignoring request from {0} to create item link {1} in folder {2} pointing to {3} since a link already exists", 946// existingLink = item;
947 remoteClient.Name, name, folderID, olditemID); 947//
948 948// if (existingLink != null)
949 return; 949// {
950 } 950// m_log.WarnFormat(
951// "[AGENT INVENTORY]: Ignoring request from {0} to create item link {1} in folder {2} pointing to {3} since a link named {4} with id {5} already exists",
952// remoteClient.Name, name, folderID, olditemID, existingLink.Name, existingLink.ID);
953//
954// return;
955// }
951 956
952 AssetBase asset = new AssetBase(); 957 AssetBase asset = new AssetBase();
953 asset.FullID = olditemID; 958 asset.FullID = olditemID;
@@ -975,7 +980,11 @@ namespace OpenSim.Region.Framework.Scenes
975 /// <param name="itemID"></param> 980 /// <param name="itemID"></param>
976 private void RemoveInventoryItem(IClientAPI remoteClient, List<UUID> itemIDs) 981 private void RemoveInventoryItem(IClientAPI remoteClient, List<UUID> itemIDs)
977 { 982 {
978 //m_log.Debug("[SCENE INVENTORY]: user " + remoteClient.AgentId); 983// m_log.DebugFormat(
984// "[AGENT INVENTORY]: Removing inventory items {0} for {1}",
985// string.Join(",", itemIDs.ConvertAll<string>(uuid => uuid.ToString()).ToArray()),
986// remoteClient.Name);
987
979 InventoryService.DeleteItems(remoteClient.AgentId, itemIDs); 988 InventoryService.DeleteItems(remoteClient.AgentId, itemIDs);
980 } 989 }
981 990