diff options
author | Melanie | 2010-03-18 18:57:29 +0000 |
---|---|---|
committer | Melanie | 2010-03-18 18:57:29 +0000 |
commit | 734b0416deac953937df9cd6dd1d0bbfbdc03a58 (patch) | |
tree | a2fec4f069a72c70ee790ea28e2762471c01ee41 /OpenSim/Region/Framework/Scenes | |
parent | Inconsistent locking of ScenePresence array in SceneGraph. Fixed by eliminati... (diff) | |
download | opensim-SC_OLD-734b0416deac953937df9cd6dd1d0bbfbdc03a58.zip opensim-SC_OLD-734b0416deac953937df9cd6dd1d0bbfbdc03a58.tar.gz opensim-SC_OLD-734b0416deac953937df9cd6dd1d0bbfbdc03a58.tar.bz2 opensim-SC_OLD-734b0416deac953937df9cd6dd1d0bbfbdc03a58.tar.xz |
Unify a previous refactor of object return with the older solution. We
really don't need two methods doing the same thing, but differently.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | 29 |
2 files changed, 10 insertions, 26 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 41533a1..c662a6b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1518,9 +1518,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1518 | if (remoteClient != null) | 1518 | if (remoteClient != null) |
1519 | { | 1519 | { |
1520 | permissionToTake = | 1520 | permissionToTake = |
1521 | Permissions.CanReturnObject( | 1521 | Permissions.CanReturnObjects( |
1522 | grp.UUID, | 1522 | null, |
1523 | remoteClient.AgentId); | 1523 | remoteClient.AgentId, |
1524 | new List<SceneObjectGroup>() {grp}); | ||
1524 | permissionToDelete = permissionToTake; | 1525 | permissionToDelete = permissionToTake; |
1525 | 1526 | ||
1526 | if (permissionToDelete) | 1527 | if (permissionToDelete) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index d1d6b6a..7dab04f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | |||
@@ -48,7 +48,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
48 | public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); | 48 | public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); |
49 | public delegate bool MoveObjectHandler(UUID objectID, UUID moverID, Scene scene); | 49 | public delegate bool MoveObjectHandler(UUID objectID, UUID moverID, Scene scene); |
50 | public delegate bool ObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene); | 50 | public delegate bool ObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene); |
51 | public delegate bool ReturnObjectHandler(UUID objectID, UUID returnerID, Scene scene); | 51 | public delegate bool ReturnObjectsHandler(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene); |
52 | public delegate bool InstantMessageHandler(UUID user, UUID target, Scene startScene); | 52 | public delegate bool InstantMessageHandler(UUID user, UUID target, Scene startScene); |
53 | public delegate bool InventoryTransferHandler(UUID user, UUID target, Scene startScene); | 53 | public delegate bool InventoryTransferHandler(UUID user, UUID target, Scene startScene); |
54 | public delegate bool ViewScriptHandler(UUID script, UUID objectID, UUID user, Scene scene); | 54 | public delegate bool ViewScriptHandler(UUID script, UUID objectID, UUID user, Scene scene); |
@@ -81,7 +81,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
81 | public delegate bool CopyUserInventoryHandler(UUID itemID, UUID userID); | 81 | public delegate bool CopyUserInventoryHandler(UUID itemID, UUID userID); |
82 | public delegate bool DeleteUserInventoryHandler(UUID itemID, UUID userID); | 82 | public delegate bool DeleteUserInventoryHandler(UUID itemID, UUID userID); |
83 | public delegate bool TeleportHandler(UUID userID, Scene scene); | 83 | public delegate bool TeleportHandler(UUID userID, Scene scene); |
84 | public delegate bool UseObjectReturnHandler(ILandObject landData, uint type, IClientAPI client, List<SceneObjectGroup> retlist, Scene scene); | ||
85 | #endregion | 84 | #endregion |
86 | 85 | ||
87 | public class ScenePermissions | 86 | public class ScenePermissions |
@@ -107,7 +106,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
107 | public event EditObjectInventoryHandler OnEditObjectInventory; | 106 | public event EditObjectInventoryHandler OnEditObjectInventory; |
108 | public event MoveObjectHandler OnMoveObject; | 107 | public event MoveObjectHandler OnMoveObject; |
109 | public event ObjectEntryHandler OnObjectEntry; | 108 | public event ObjectEntryHandler OnObjectEntry; |
110 | public event ReturnObjectHandler OnReturnObject; | 109 | public event ReturnObjectsHandler OnReturnObjects; |
111 | public event InstantMessageHandler OnInstantMessage; | 110 | public event InstantMessageHandler OnInstantMessage; |
112 | public event InventoryTransferHandler OnInventoryTransfer; | 111 | public event InventoryTransferHandler OnInventoryTransfer; |
113 | public event ViewScriptHandler OnViewScript; | 112 | public event ViewScriptHandler OnViewScript; |
@@ -140,7 +139,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
140 | public event CopyUserInventoryHandler OnCopyUserInventory; | 139 | public event CopyUserInventoryHandler OnCopyUserInventory; |
141 | public event DeleteUserInventoryHandler OnDeleteUserInventory; | 140 | public event DeleteUserInventoryHandler OnDeleteUserInventory; |
142 | public event TeleportHandler OnTeleport; | 141 | public event TeleportHandler OnTeleport; |
143 | public event UseObjectReturnHandler OnUseObjectReturn; | ||
144 | #endregion | 142 | #endregion |
145 | 143 | ||
146 | #region Object Permission Checks | 144 | #region Object Permission Checks |
@@ -377,15 +375,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
377 | #endregion | 375 | #endregion |
378 | 376 | ||
379 | #region RETURN OBJECT | 377 | #region RETURN OBJECT |
380 | public bool CanReturnObject(UUID objectID, UUID returnerID) | 378 | public bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects) |
381 | { | 379 | { |
382 | ReturnObjectHandler handler = OnReturnObject; | 380 | ReturnObjectsHandler handler = OnReturnObjects; |
383 | if (handler != null) | 381 | if (handler != null) |
384 | { | 382 | { |
385 | Delegate[] list = handler.GetInvocationList(); | 383 | Delegate[] list = handler.GetInvocationList(); |
386 | foreach (ReturnObjectHandler h in list) | 384 | foreach (ReturnObjectsHandler h in list) |
387 | { | 385 | { |
388 | if (h(objectID, returnerID, m_scene) == false) | 386 | if (h(land, user, objects, m_scene) == false) |
389 | return false; | 387 | return false; |
390 | } | 388 | } |
391 | } | 389 | } |
@@ -949,20 +947,5 @@ namespace OpenSim.Region.Framework.Scenes | |||
949 | } | 947 | } |
950 | return true; | 948 | return true; |
951 | } | 949 | } |
952 | |||
953 | public bool CanUseObjectReturn(ILandObject landData, uint type , IClientAPI client, List<SceneObjectGroup> retlist) | ||
954 | { | ||
955 | UseObjectReturnHandler handler = OnUseObjectReturn; | ||
956 | if (handler != null) | ||
957 | { | ||
958 | Delegate[] list = handler.GetInvocationList(); | ||
959 | foreach (UseObjectReturnHandler h in list) | ||
960 | { | ||
961 | if (h(landData, type, client, retlist, m_scene) == false) | ||
962 | return false; | ||
963 | } | ||
964 | } | ||
965 | return true; | ||
966 | } | ||
967 | } | 950 | } |
968 | } | 951 | } |