diff options
author | Justin Clark-Casey (justincc) | 2011-05-12 02:46:13 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-05-12 02:46:13 +0100 |
commit | ac12ace6f1f837cfe934ddc69438796ad174c84f (patch) | |
tree | f4b779db32ffb477ade674df58592bebadc4be0b | |
parent | Revert "Functional improvement: close the stream. Non-functional: add debug m... (diff) | |
download | opensim-SC-ac12ace6f1f837cfe934ddc69438796ad174c84f.zip opensim-SC-ac12ace6f1f837cfe934ddc69438796ad174c84f.tar.gz opensim-SC-ac12ace6f1f837cfe934ddc69438796ad174c84f.tar.bz2 opensim-SC-ac12ace6f1f837cfe934ddc69438796ad174c84f.tar.xz |
Prevent viewer 2 from creating a duplicate outfit inventory links.
I believe this is safe since there is a 1-1 correspondence between link item and worn item (i.e. you can't be wearing the same item at two spots simultaneously in one outfit).
This should stop lots of duplicate links being created when viewer 2 is used.
However, this doesn't prevent broken inventory links, which I believe is timing related since the effect is not consistent (e.g. keep relogging and the viewer should end up seeing them correctly) . I think we actually see this problem on viewer 1 as well.
It might be easier just to implement the Fetch*2 inventory caps which are documented at http://wiki.secondlife.com/wiki/Inventory_API. WebFetch* has been deprecated by Linden Lab since viewer 2.5.1 and according to the sl wiki, "has numerous bugs".
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index cd01a05..523b7f5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -904,11 +904,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
904 | } | 904 | } |
905 | } | 905 | } |
906 | 906 | ||
907 | /// <summary> | ||
908 | /// Link an inventory item to an existing item. | ||
909 | /// </summary> | ||
910 | /// <param name="remoteClient"></param> | ||
911 | /// <param name="transActionID"></param> | ||
912 | /// <param name="folderID"></param> | ||
913 | /// <param name="callbackID"></param> | ||
914 | /// <param name="description"></param> | ||
915 | /// <param name="name"></param> | ||
916 | /// <param name="invType"></param> | ||
917 | /// <param name="type">/param> | ||
918 | /// <param name="olditemID"></param> | ||
907 | private void HandleLinkInventoryItem(IClientAPI remoteClient, UUID transActionID, UUID folderID, | 919 | private void HandleLinkInventoryItem(IClientAPI remoteClient, UUID transActionID, UUID folderID, |
908 | uint callbackID, string description, string name, | 920 | uint callbackID, string description, string name, |
909 | sbyte invType, sbyte type, UUID olditemID) | 921 | sbyte invType, sbyte type, UUID olditemID) |
910 | { | 922 | { |
911 | m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item link {0} in folder {1} pointing to {2}", name, folderID, olditemID); | 923 | m_log.DebugFormat( |
924 | "[AGENT INVENTORY]: Received request from {0} to create inventory item link {1} in folder {2} pointing to {3}", | ||
925 | remoteClient.Name, name, folderID, olditemID); | ||
912 | 926 | ||
913 | if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) | 927 | if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) |
914 | return; | 928 | return; |
@@ -916,7 +930,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
916 | ScenePresence presence; | 930 | ScenePresence presence; |
917 | if (TryGetScenePresence(remoteClient.AgentId, out presence)) | 931 | if (TryGetScenePresence(remoteClient.AgentId, out presence)) |
918 | { | 932 | { |
919 | // byte[] data = null; | 933 | bool linkAlreadyExists = false; |
934 | List<InventoryItemBase> existingItems = InventoryService.GetFolderItems(remoteClient.AgentId, folderID); | ||
935 | foreach (InventoryItemBase item in existingItems) | ||
936 | if (item.AssetID == olditemID) | ||
937 | linkAlreadyExists = true; | ||
938 | |||
939 | if (linkAlreadyExists) | ||
940 | { | ||
941 | m_log.WarnFormat( | ||
942 | "[AGENT INVENTORY]: Ignoring request from {0} to create item link {1} in folder {2} pointing to {3} since a link already exists", | ||
943 | remoteClient.Name, name, folderID, olditemID); | ||
944 | |||
945 | return; | ||
946 | } | ||
920 | 947 | ||
921 | AssetBase asset = new AssetBase(); | 948 | AssetBase asset = new AssetBase(); |
922 | asset.FullID = olditemID; | 949 | asset.FullID = olditemID; |