diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | 61 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 8 |
2 files changed, 61 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index 66439ab..e1fedf4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | |||
@@ -43,6 +43,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
43 | public delegate bool PropagatePermissionsHandler(); | 43 | public delegate bool PropagatePermissionsHandler(); |
44 | public delegate bool RezObjectHandler(int objectCount, UUID owner, Vector3 objectPosition, Scene scene); | 44 | public delegate bool RezObjectHandler(int objectCount, UUID owner, Vector3 objectPosition, Scene scene); |
45 | public delegate bool DeleteObjectHandler(UUID objectID, UUID deleter, Scene scene); | 45 | public delegate bool DeleteObjectHandler(UUID objectID, UUID deleter, Scene scene); |
46 | public delegate bool TransferObjectHandler(UUID objectID, UUID recipient, Scene scene); | ||
46 | public delegate bool TakeObjectHandler(UUID objectID, UUID stealer, Scene scene); | 47 | public delegate bool TakeObjectHandler(UUID objectID, UUID stealer, Scene scene); |
47 | public delegate bool TakeCopyObjectHandler(UUID objectID, UUID userID, Scene inScene); | 48 | public delegate bool TakeCopyObjectHandler(UUID objectID, UUID userID, Scene inScene); |
48 | public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition); | 49 | public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition); |
@@ -80,10 +81,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
80 | public delegate bool CreateObjectInventoryHandler(int invType, UUID objectID, UUID userID); | 81 | public delegate bool CreateObjectInventoryHandler(int invType, UUID objectID, UUID userID); |
81 | public delegate bool CopyObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); | 82 | public delegate bool CopyObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); |
82 | public delegate bool DeleteObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); | 83 | public delegate bool DeleteObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); |
84 | public delegate bool TransferObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); | ||
83 | public delegate bool CreateUserInventoryHandler(int invType, UUID userID); | 85 | public delegate bool CreateUserInventoryHandler(int invType, UUID userID); |
84 | public delegate bool EditUserInventoryHandler(UUID itemID, UUID userID); | 86 | public delegate bool EditUserInventoryHandler(UUID itemID, UUID userID); |
85 | public delegate bool CopyUserInventoryHandler(UUID itemID, UUID userID); | 87 | public delegate bool CopyUserInventoryHandler(UUID itemID, UUID userID); |
86 | public delegate bool DeleteUserInventoryHandler(UUID itemID, UUID userID); | 88 | public delegate bool DeleteUserInventoryHandler(UUID itemID, UUID userID); |
89 | public delegate bool TransferUserInventoryHandler(UUID itemID, UUID userID, UUID recipientID); | ||
87 | public delegate bool TeleportHandler(UUID userID, Scene scene); | 90 | public delegate bool TeleportHandler(UUID userID, Scene scene); |
88 | public delegate bool ControlPrimMediaHandler(UUID userID, UUID primID, int face); | 91 | public delegate bool ControlPrimMediaHandler(UUID userID, UUID primID, int face); |
89 | public delegate bool InteractWithPrimMediaHandler(UUID userID, UUID primID, int face); | 92 | public delegate bool InteractWithPrimMediaHandler(UUID userID, UUID primID, int face); |
@@ -107,6 +110,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
107 | public event PropagatePermissionsHandler OnPropagatePermissions; | 110 | public event PropagatePermissionsHandler OnPropagatePermissions; |
108 | public event RezObjectHandler OnRezObject; | 111 | public event RezObjectHandler OnRezObject; |
109 | public event DeleteObjectHandler OnDeleteObject; | 112 | public event DeleteObjectHandler OnDeleteObject; |
113 | public event TransferObjectHandler OnTransferObject; | ||
110 | public event TakeObjectHandler OnTakeObject; | 114 | public event TakeObjectHandler OnTakeObject; |
111 | public event TakeCopyObjectHandler OnTakeCopyObject; | 115 | public event TakeCopyObjectHandler OnTakeCopyObject; |
112 | public event DuplicateObjectHandler OnDuplicateObject; | 116 | public event DuplicateObjectHandler OnDuplicateObject; |
@@ -144,10 +148,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
144 | public event CreateObjectInventoryHandler OnCreateObjectInventory; | 148 | public event CreateObjectInventoryHandler OnCreateObjectInventory; |
145 | public event CopyObjectInventoryHandler OnCopyObjectInventory; | 149 | public event CopyObjectInventoryHandler OnCopyObjectInventory; |
146 | public event DeleteObjectInventoryHandler OnDeleteObjectInventory; | 150 | public event DeleteObjectInventoryHandler OnDeleteObjectInventory; |
151 | public event TransferObjectInventoryHandler OnTransferObjectInventory; | ||
147 | public event CreateUserInventoryHandler OnCreateUserInventory; | 152 | public event CreateUserInventoryHandler OnCreateUserInventory; |
148 | public event EditUserInventoryHandler OnEditUserInventory; | 153 | public event EditUserInventoryHandler OnEditUserInventory; |
149 | public event CopyUserInventoryHandler OnCopyUserInventory; | 154 | public event CopyUserInventoryHandler OnCopyUserInventory; |
150 | public event DeleteUserInventoryHandler OnDeleteUserInventory; | 155 | public event DeleteUserInventoryHandler OnDeleteUserInventory; |
156 | public event TransferUserInventoryHandler OnTransferUserInventory; | ||
151 | public event TeleportHandler OnTeleport; | 157 | public event TeleportHandler OnTeleport; |
152 | public event ControlPrimMediaHandler OnControlPrimMedia; | 158 | public event ControlPrimMediaHandler OnControlPrimMedia; |
153 | public event InteractWithPrimMediaHandler OnInteractWithPrimMedia; | 159 | public event InteractWithPrimMediaHandler OnInteractWithPrimMedia; |
@@ -264,10 +270,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
264 | } | 270 | } |
265 | } | 271 | } |
266 | 272 | ||
267 | // m_log.DebugFormat( | 273 | return result; |
268 | // "[SCENE PERMISSIONS]: CanDeleteObject() fired for object {0}, deleter {1}, result {2}", | 274 | } |
269 | // objectID, deleter, result); | 275 | |
270 | 276 | public bool CanTransferObject(UUID objectID, UUID recipient) | |
277 | { | ||
278 | bool result = true; | ||
279 | |||
280 | TransferObjectHandler handler = OnTransferObject; | ||
281 | if (handler != null) | ||
282 | { | ||
283 | Delegate[] list = handler.GetInvocationList(); | ||
284 | foreach (TransferObjectHandler h in list) | ||
285 | { | ||
286 | if (h(objectID, recipient, m_scene) == false) | ||
287 | { | ||
288 | result = false; | ||
289 | break; | ||
290 | } | ||
291 | } | ||
292 | } | ||
293 | |||
271 | return result; | 294 | return result; |
272 | } | 295 | } |
273 | 296 | ||
@@ -917,6 +940,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
917 | return true; | 940 | return true; |
918 | } | 941 | } |
919 | 942 | ||
943 | public bool CanTransferObjectInventory(UUID itemID, UUID objectID, UUID userID) | ||
944 | { | ||
945 | TransferObjectInventoryHandler handler = OnTransferObjectInventory; | ||
946 | if (handler != null) | ||
947 | { | ||
948 | Delegate[] list = handler.GetInvocationList(); | ||
949 | foreach (TransferObjectInventoryHandler h in list) | ||
950 | { | ||
951 | if (h(itemID, objectID, userID) == false) | ||
952 | return false; | ||
953 | } | ||
954 | } | ||
955 | return true; | ||
956 | } | ||
957 | |||
920 | /// <summary> | 958 | /// <summary> |
921 | /// Check whether the specified user is allowed to create the given inventory type in their inventory. | 959 | /// Check whether the specified user is allowed to create the given inventory type in their inventory. |
922 | /// </summary> | 960 | /// </summary> |
@@ -1001,6 +1039,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1001 | return true; | 1039 | return true; |
1002 | } | 1040 | } |
1003 | 1041 | ||
1042 | public bool CanTransferUserInventory(UUID itemID, UUID userID, UUID recipientID) | ||
1043 | { | ||
1044 | TransferUserInventoryHandler handler = OnTransferUserInventory; | ||
1045 | if (handler != null) | ||
1046 | { | ||
1047 | Delegate[] list = handler.GetInvocationList(); | ||
1048 | foreach (TransferUserInventoryHandler h in list) | ||
1049 | { | ||
1050 | if (h(itemID, userID, recipientID) == false) | ||
1051 | return false; | ||
1052 | } | ||
1053 | } | ||
1054 | return true; | ||
1055 | } | ||
1056 | |||
1004 | public bool CanTeleport(UUID userID) | 1057 | public bool CanTeleport(UUID userID) |
1005 | { | 1058 | { |
1006 | TeleportHandler handler = OnTeleport; | 1059 | TeleportHandler handler = OnTeleport; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 88e084e..69ebe9e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -193,7 +193,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
193 | } | 193 | } |
194 | } | 194 | } |
195 | 195 | ||
196 | public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, ulong regionHandle); | 196 | public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, UUID scopeID, ulong regionHandle); |
197 | 197 | ||
198 | /// <summary> | 198 | /// <summary> |
199 | /// This informs all neighboring regions about the settings of it's child agent. | 199 | /// This informs all neighboring regions about the settings of it's child agent. |
@@ -202,7 +202,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
202 | /// This contains information, such as, Draw Distance, Camera location, Current Position, Current throttle settings, etc. | 202 | /// This contains information, such as, Draw Distance, Camera location, Current Position, Current throttle settings, etc. |
203 | /// | 203 | /// |
204 | /// </summary> | 204 | /// </summary> |
205 | private void SendChildAgentDataUpdateAsync(AgentPosition cAgentData, ulong regionHandle) | 205 | private void SendChildAgentDataUpdateAsync(AgentPosition cAgentData, UUID scopeID, ulong regionHandle) |
206 | { | 206 | { |
207 | //m_log.Info("[INTERGRID]: Informing neighbors about my agent in " + m_regionInfo.RegionName); | 207 | //m_log.Info("[INTERGRID]: Informing neighbors about my agent in " + m_regionInfo.RegionName); |
208 | try | 208 | try |
@@ -245,7 +245,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
245 | if (regionHandle != m_regionInfo.RegionHandle) | 245 | if (regionHandle != m_regionInfo.RegionHandle) |
246 | { | 246 | { |
247 | SendChildAgentDataUpdateDelegate d = SendChildAgentDataUpdateAsync; | 247 | SendChildAgentDataUpdateDelegate d = SendChildAgentDataUpdateAsync; |
248 | d.BeginInvoke(cAgentData, regionHandle, | 248 | d.BeginInvoke(cAgentData, m_regionInfo.ScopeID, regionHandle, |
249 | SendChildAgentDataUpdateCompleted, | 249 | SendChildAgentDataUpdateCompleted, |
250 | d); | 250 | d); |
251 | } | 251 | } |
@@ -273,7 +273,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
273 | //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); | 273 | //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); |
274 | uint x = 0, y = 0; | 274 | uint x = 0, y = 0; |
275 | Utils.LongToUInts(regionHandle, out x, out y); | 275 | Utils.LongToUInts(regionHandle, out x, out y); |
276 | GridRegion destination = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); | 276 | GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); |
277 | m_scene.SimulationService.CloseAgent(destination, agentID); | 277 | m_scene.SimulationService.CloseAgent(destination, agentID); |
278 | } | 278 | } |
279 | 279 | ||