diff options
author | UbitUmarov | 2017-01-25 19:39:58 +0000 |
---|---|---|
committer | UbitUmarov | 2017-01-25 19:39:58 +0000 |
commit | 02fbe5a740e81280bff16caaf50f5f6326fc9c80 (patch) | |
tree | 59219a664b08884ffa168171aab62c5062d55486 /OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | |
parent | fix test setup (diff) | |
download | opensim-SC-02fbe5a740e81280bff16caaf50f5f6326fc9c80.zip opensim-SC-02fbe5a740e81280bff16caaf50f5f6326fc9c80.tar.gz opensim-SC-02fbe5a740e81280bff16caaf50f5f6326fc9c80.tar.bz2 opensim-SC-02fbe5a740e81280bff16caaf50f5f6326fc9c80.tar.xz |
add and use CanDropInObjectInv
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Permissions.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index 968b298..4630497 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | |||
@@ -87,6 +87,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
87 | public delegate bool CreateObjectInventoryHandler(int invType, UUID objectID, UUID userID); | 87 | public delegate bool CreateObjectInventoryHandler(int invType, UUID objectID, UUID userID); |
88 | public delegate bool CopyObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); | 88 | public delegate bool CopyObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); |
89 | public delegate bool DoObjectInvToObjectInv(TaskInventoryItem item, SceneObjectPart sourcePart, SceneObjectPart destPart); | 89 | public delegate bool DoObjectInvToObjectInv(TaskInventoryItem item, SceneObjectPart sourcePart, SceneObjectPart destPart); |
90 | public delegate bool DoDropInObjectInv(InventoryItemBase item, ScenePresence sp, SceneObjectPart destPart); | ||
90 | public delegate bool DeleteObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); | 91 | public delegate bool DeleteObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); |
91 | public delegate bool TransferObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); | 92 | public delegate bool TransferObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); |
92 | public delegate bool CreateUserInventoryHandler(int invType, UUID userID); | 93 | public delegate bool CreateUserInventoryHandler(int invType, UUID userID); |
@@ -160,6 +161,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
160 | public event CreateObjectInventoryHandler OnCreateObjectInventory; | 161 | public event CreateObjectInventoryHandler OnCreateObjectInventory; |
161 | public event CopyObjectInventoryHandler OnCopyObjectInventory; | 162 | public event CopyObjectInventoryHandler OnCopyObjectInventory; |
162 | public event DoObjectInvToObjectInv OnDoObjectInvToObjectInv; | 163 | public event DoObjectInvToObjectInv OnDoObjectInvToObjectInv; |
164 | public event DoDropInObjectInv OnDropInObjectInv; | ||
163 | public event DeleteObjectInventoryHandler OnDeleteObjectInventory; | 165 | public event DeleteObjectInventoryHandler OnDeleteObjectInventory; |
164 | public event TransferObjectInventoryHandler OnTransferObjectInventory; | 166 | public event TransferObjectInventoryHandler OnTransferObjectInventory; |
165 | public event CreateUserInventoryHandler OnCreateUserInventory; | 167 | public event CreateUserInventoryHandler OnCreateUserInventory; |
@@ -1109,6 +1111,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
1109 | return true; | 1111 | return true; |
1110 | } | 1112 | } |
1111 | 1113 | ||
1114 | public bool CanDropInObjectInv(InventoryItemBase item, IClientAPI client, SceneObjectPart destPart) | ||
1115 | { | ||
1116 | DoDropInObjectInv handler = OnDropInObjectInv; | ||
1117 | if (handler != null) | ||
1118 | { | ||
1119 | if (client == null || client.SceneAgent == null|| destPart == null || item == null) | ||
1120 | return false; | ||
1121 | |||
1122 | ScenePresence sp = client.SceneAgent as ScenePresence; | ||
1123 | if(sp == null || sp.IsDeleted) | ||
1124 | return false; | ||
1125 | |||
1126 | Delegate[] list = handler.GetInvocationList(); | ||
1127 | foreach (DoDropInObjectInv h in list) | ||
1128 | { | ||
1129 | if (h(item, sp, destPart) == false) | ||
1130 | return false; | ||
1131 | } | ||
1132 | } | ||
1133 | return true; | ||
1134 | } | ||
1135 | |||
1112 | public bool CanDeleteObjectInventory(UUID itemID, UUID objectID, UUID userID) | 1136 | public bool CanDeleteObjectInventory(UUID itemID, UUID objectID, UUID userID) |
1113 | { | 1137 | { |
1114 | DeleteObjectInventoryHandler handler = OnDeleteObjectInventory; | 1138 | DeleteObjectInventoryHandler handler = OnDeleteObjectInventory; |