aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorDiva Canto2014-05-18 07:49:01 -0700
committerDiva Canto2014-05-18 07:49:01 -0700
commit922f76a3a766220592bc4ccad3911a66728329a0 (patch)
treee318eee5c5c60723afcb3be4b3ee807d126b201a /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
parentBulletSim: adjust avatar step up parameters to better walk up small (diff)
downloadopensim-SC-922f76a3a766220592bc4ccad3911a66728329a0.zip
opensim-SC-922f76a3a766220592bc4ccad3911a66728329a0.tar.gz
opensim-SC-922f76a3a766220592bc4ccad3911a66728329a0.tar.bz2
opensim-SC-922f76a3a766220592bc4ccad3911a66728329a0.tar.xz
Don't fetch assets from the server when doing simple inventory operations like copy-paste items in inventory.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs79
1 files changed, 28 insertions, 51 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 3c3d077..71e3032 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -879,50 +879,33 @@ namespace OpenSim.Region.Framework.Scenes
879 return; 879 return;
880 } 880 }
881 881
882 AssetBase asset = AssetService.Get(item.AssetID.ToString()); 882 if (newName == String.Empty)
883 newName = item.Name;
883 884
884 if (asset != null) 885 if (remoteClient.AgentId == oldAgentID
886 || (LibraryService != null
887 && LibraryService.LibraryRootFolder != null
888 && oldAgentID == LibraryService.LibraryRootFolder.Owner))
885 { 889 {
886 if (newName != String.Empty) 890 CreateNewInventoryItem(
887 { 891 remoteClient, item.CreatorId, item.CreatorData, newFolderID,
888 asset.Name = newName; 892 newName, item.Description, item.Flags, callbackID, item.AssetID, (sbyte)item.AssetType, (sbyte)item.InvType,
889 } 893 item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions,
890 else 894 item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch());
891 { 895 }
892 newName = item.Name; 896 else
893 } 897 {
894 898 // If item is transfer or permissions are off or calling agent is allowed to copy item owner's inventory item.
895 if (remoteClient.AgentId == oldAgentID 899 if (((item.CurrentPermissions & (uint)PermissionMask.Transfer) != 0)
896 || (LibraryService != null 900 && (m_permissions.BypassPermissions()
897 && LibraryService.LibraryRootFolder != null 901 || m_permissions.CanCopyUserInventory(remoteClient.AgentId, oldItemID)))
898 && oldAgentID == LibraryService.LibraryRootFolder.Owner))
899 { 902 {
900 CreateNewInventoryItem( 903 CreateNewInventoryItem(
901 remoteClient, item.CreatorId, item.CreatorData, newFolderID, 904 remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Description, item.Flags, callbackID,
902 newName, item.Description, item.Flags, callbackID, asset, (sbyte)item.InvType, 905 item.AssetID, (sbyte)item.AssetType, (sbyte) item.InvType,
903 item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, 906 item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions,
904 item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch()); 907 item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch());
905 } 908 }
906 else
907 {
908 // If item is transfer or permissions are off or calling agent is allowed to copy item owner's inventory item.
909 if (((item.CurrentPermissions & (uint)PermissionMask.Transfer) != 0)
910 && (m_permissions.BypassPermissions()
911 || m_permissions.CanCopyUserInventory(remoteClient.AgentId, oldItemID)))
912 {
913 CreateNewInventoryItem(
914 remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Description, item.Flags, callbackID,
915 asset, (sbyte) item.InvType,
916 item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions,
917 item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch());
918 }
919 }
920 }
921 else
922 {
923 m_log.ErrorFormat(
924 "[AGENT INVENTORY]: Could not copy item {0} since asset {1} could not be found",
925 item.Name, item.AssetID);
926 } 909 }
927 } 910 }
928 911
@@ -973,10 +956,10 @@ namespace OpenSim.Region.Framework.Scenes
973 public void CreateNewInventoryItem( 956 public void CreateNewInventoryItem(
974 IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, 957 IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID,
975 string name, string description, uint flags, uint callbackID, 958 string name, string description, uint flags, uint callbackID,
976 AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate) 959 UUID assetID, sbyte assetType, sbyte invType, uint nextOwnerMask, int creationDate)
977 { 960 {
978 CreateNewInventoryItem( 961 CreateNewInventoryItem(
979 remoteClient, creatorID, creatorData, folderID, name, description, flags, callbackID, asset, invType, 962 remoteClient, creatorID, creatorData, folderID, name, description, flags, callbackID, assetID, assetType, invType,
980 (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, 0, nextOwnerMask, 0, creationDate); 963 (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, 0, nextOwnerMask, 0, creationDate);
981 } 964 }
982 965
@@ -1001,7 +984,7 @@ namespace OpenSim.Region.Framework.Scenes
1001 /// <param name="creationDate">Unix timestamp at which this item was created.</param> 984 /// <param name="creationDate">Unix timestamp at which this item was created.</param>
1002 private void CreateNewInventoryItem( 985 private void CreateNewInventoryItem(
1003 IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, 986 IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID,
1004 string name, string description, uint flags, uint callbackID, AssetBase asset, sbyte invType, 987 string name, string description, uint flags, uint callbackID, UUID assetID, sbyte assetType, sbyte invType,
1005 uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate) 988 uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate)
1006 { 989 {
1007 InventoryItemBase item = new InventoryItemBase(); 990 InventoryItemBase item = new InventoryItemBase();
@@ -1009,11 +992,11 @@ namespace OpenSim.Region.Framework.Scenes
1009 item.CreatorId = creatorID; 992 item.CreatorId = creatorID;
1010 item.CreatorData = creatorData; 993 item.CreatorData = creatorData;
1011 item.ID = UUID.Random(); 994 item.ID = UUID.Random();
1012 item.AssetID = asset.FullID; 995 item.AssetID = assetID;
1013 item.Name = name; 996 item.Name = name;
1014 item.Description = description; 997 item.Description = description;
1015 item.Flags = flags; 998 item.Flags = flags;
1016 item.AssetType = asset.Type; 999 item.AssetType = assetType;
1017 item.InvType = invType; 1000 item.InvType = invType;
1018 item.Folder = folderID; 1001 item.Folder = folderID;
1019 item.CurrentPermissions = currentMask; 1002 item.CurrentPermissions = currentMask;
@@ -1086,15 +1069,9 @@ namespace OpenSim.Region.Framework.Scenes
1086// return; 1069// return;
1087// } 1070// }
1088 1071
1089 AssetBase asset = new AssetBase();
1090 asset.FullID = olditemID;
1091 asset.Type = type;
1092 asset.Name = name;
1093 asset.Description = description;
1094
1095 CreateNewInventoryItem( 1072 CreateNewInventoryItem(
1096 remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID, 1073 remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID,
1097 name, description, 0, callbackID, asset, invType, 1074 name, description, 0, callbackID, olditemID, type, invType,
1098 (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All, 1075 (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All,
1099 (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, Util.UnixTimeSinceEpoch()); 1076 (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, Util.UnixTimeSinceEpoch());
1100 } 1077 }