diff options
Diffstat (limited to 'OpenSim/Region/Framework')
5 files changed, 31 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index dbc7def..2f016fa 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -2085,7 +2085,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2085 | /// <param name='action'>DeRezAction</param> | 2085 | /// <param name='action'>DeRezAction</param> |
2086 | /// <param name='destinationID'>User folder ID to place derezzed object</param> | 2086 | /// <param name='destinationID'>User folder ID to place derezzed object</param> |
2087 | public virtual void DeRezObjects( | 2087 | public virtual void DeRezObjects( |
2088 | IClientAPI remoteClient, List<uint> localIDs, UUID groupID, DeRezAction action, UUID destinationID) | 2088 | IClientAPI remoteClient, List<uint> localIDs, UUID groupID, DeRezAction action, UUID destinationID, bool AddToReturns = true) |
2089 | { | 2089 | { |
2090 | // First, see of we can perform the requested action and | 2090 | // First, see of we can perform the requested action and |
2091 | // build a list of eligible objects | 2091 | // build a list of eligible objects |
@@ -2094,7 +2094,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2094 | List<SceneObjectGroup> takeGroups = new List<SceneObjectGroup>(); | 2094 | List<SceneObjectGroup> takeGroups = new List<SceneObjectGroup>(); |
2095 | List<SceneObjectGroup> takeDeleteGroups = new List<SceneObjectGroup>(); | 2095 | List<SceneObjectGroup> takeDeleteGroups = new List<SceneObjectGroup>(); |
2096 | 2096 | ||
2097 | ScenePresence sp = remoteClient.SceneAgent as ScenePresence; | 2097 | ScenePresence sp = null; |
2098 | if(remoteClient != null) | ||
2099 | sp = remoteClient.SceneAgent as ScenePresence; | ||
2100 | else if(action != DeRezAction.Return) | ||
2101 | return; // only Return can be called without a client | ||
2098 | 2102 | ||
2099 | // Start with true for both, then remove the flags if objects | 2103 | // Start with true for both, then remove the flags if objects |
2100 | // that we can't derez are part of the selection | 2104 | // that we can't derez are part of the selection |
@@ -2201,13 +2205,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2201 | { | 2205 | { |
2202 | if (Permissions.CanReturnObjects( | 2206 | if (Permissions.CanReturnObjects( |
2203 | null, | 2207 | null, |
2204 | remoteClient.AgentId, | 2208 | remoteClient, |
2205 | new List<SceneObjectGroup>() {grp})) | 2209 | new List<SceneObjectGroup>() {grp})) |
2206 | { | 2210 | { |
2207 | permissionToTake = true; | 2211 | permissionToTake = true; |
2208 | permissionToDelete = true; | 2212 | permissionToDelete = true; |
2209 | 2213 | if(AddToReturns) | |
2210 | AddReturn(grp.OwnerID == grp.GroupID ? grp.LastOwnerID : grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return"); | 2214 | AddReturn(grp.OwnerID == grp.GroupID ? grp.LastOwnerID : grp.OwnerID, grp.Name, grp.AbsolutePosition, |
2215 | "parcel owner return"); | ||
2211 | } | 2216 | } |
2212 | } | 2217 | } |
2213 | else // Auto return passes through here with null agent | 2218 | else // Auto return passes through here with null agent |
@@ -2641,7 +2646,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2641 | } | 2646 | } |
2642 | 2647 | ||
2643 | public virtual bool returnObjects(SceneObjectGroup[] returnobjects, | 2648 | public virtual bool returnObjects(SceneObjectGroup[] returnobjects, |
2644 | UUID AgentId) | 2649 | IClientAPI client) |
2645 | { | 2650 | { |
2646 | List<uint> localIDs = new List<uint>(); | 2651 | List<uint> localIDs = new List<uint>(); |
2647 | 2652 | ||
@@ -2651,8 +2656,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2651 | "parcel owner return"); | 2656 | "parcel owner return"); |
2652 | localIDs.Add(grp.RootPart.LocalId); | 2657 | localIDs.Add(grp.RootPart.LocalId); |
2653 | } | 2658 | } |
2654 | DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return, | 2659 | DeRezObjects(client, localIDs, UUID.Zero, DeRezAction.Return, |
2655 | UUID.Zero); | 2660 | UUID.Zero, false); |
2656 | 2661 | ||
2657 | return true; | 2662 | return true; |
2658 | } | 2663 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 940f80c..4fef9c3 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -185,8 +185,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
185 | // A prim is only tainted if it's allowed to be edited by the person clicking it. | 185 | // A prim is only tainted if it's allowed to be edited by the person clicking it. |
186 | if (Permissions.CanChangeSelectedState(part, (ScenePresence)remoteClient.SceneAgent)) | 186 | if (Permissions.CanChangeSelectedState(part, (ScenePresence)remoteClient.SceneAgent)) |
187 | { | 187 | { |
188 | bool oldsel = part.IsSelected; | ||
188 | part.IsSelected = true; | 189 | part.IsSelected = true; |
189 | EventManager.TriggerParcelPrimCountTainted(); | 190 | if(!oldsel) |
191 | EventManager.TriggerParcelPrimCountTainted(); | ||
190 | } | 192 | } |
191 | 193 | ||
192 | part.SendPropertiesToClient(remoteClient); | 194 | part.SendPropertiesToClient(remoteClient); |
@@ -228,6 +230,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
228 | if (so.OwnerID == remoteClient.AgentId) | 230 | if (so.OwnerID == remoteClient.AgentId) |
229 | { | 231 | { |
230 | so.SetGroup(groupID, remoteClient); | 232 | so.SetGroup(groupID, remoteClient); |
233 | EventManager.TriggerParcelPrimCountTainted(); | ||
231 | } | 234 | } |
232 | } | 235 | } |
233 | } | 236 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index 45d710a..6d3b82f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
54 | public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID); | 54 | public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID); |
55 | public delegate bool MoveObjectHandler(SceneObjectGroup sog, ScenePresence sp); | 55 | public delegate bool MoveObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
56 | public delegate bool ObjectEntryHandler(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint); | 56 | public delegate bool ObjectEntryHandler(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint); |
57 | public delegate bool ReturnObjectsHandler(ILandObject land, UUID user, List<SceneObjectGroup> objects); | 57 | public delegate bool ReturnObjectsHandler(ILandObject land, ScenePresence sp, List<SceneObjectGroup> objects); |
58 | public delegate bool InstantMessageHandler(UUID user, UUID target); | 58 | public delegate bool InstantMessageHandler(UUID user, UUID target); |
59 | public delegate bool InventoryTransferHandler(UUID user, UUID target); | 59 | public delegate bool InventoryTransferHandler(UUID user, UUID target); |
60 | public delegate bool ViewScriptHandler(UUID script, UUID objectID, UUID user); | 60 | public delegate bool ViewScriptHandler(UUID script, UUID objectID, UUID user); |
@@ -556,17 +556,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
556 | #endregion | 556 | #endregion |
557 | 557 | ||
558 | #region RETURN OBJECT | 558 | #region RETURN OBJECT |
559 | public bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects) | 559 | public bool CanReturnObjects(ILandObject land, IClientAPI client, List<SceneObjectGroup> objects) |
560 | { | 560 | { |
561 | bool result = true; | 561 | bool result = true; |
562 | 562 | ||
563 | ReturnObjectsHandler handler = OnReturnObjects; | 563 | ReturnObjectsHandler handler = OnReturnObjects; |
564 | if (handler != null) | 564 | if (handler != null) |
565 | { | 565 | { |
566 | if(objects == null) | ||
567 | return false; | ||
568 | |||
569 | ScenePresence sp = null; | ||
570 | if(client != null && client.SceneAgent != null) | ||
571 | sp = client.SceneAgent as ScenePresence; | ||
572 | |||
566 | Delegate[] list = handler.GetInvocationList(); | 573 | Delegate[] list = handler.GetInvocationList(); |
567 | foreach (ReturnObjectsHandler h in list) | 574 | foreach (ReturnObjectsHandler h in list) |
568 | { | 575 | { |
569 | if (h(land, user, objects) == false) | 576 | if (h(land, sp, objects) == false) |
570 | { | 577 | { |
571 | result = false; | 578 | result = false; |
572 | break; | 579 | break; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4fca4ed..5f99b73 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2604,8 +2604,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2604 | { | 2604 | { |
2605 | // Otherwise, use this default creation code; | 2605 | // Otherwise, use this default creation code; |
2606 | sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); | 2606 | sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); |
2607 | AddNewSceneObject(sceneObject, true); | ||
2608 | sceneObject.SetGroup(groupID, null); | 2607 | sceneObject.SetGroup(groupID, null); |
2608 | AddNewSceneObject(sceneObject, true); | ||
2609 | 2609 | ||
2610 | if (AgentPreferencesService != null) // This will override the brave new full perm world! | 2610 | if (AgentPreferencesService != null) // This will override the brave new full perm world! |
2611 | { | 2611 | { |
@@ -2784,7 +2784,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2784 | } | 2784 | } |
2785 | if (toReturn.Count > 0) | 2785 | if (toReturn.Count > 0) |
2786 | { | 2786 | { |
2787 | returnObjects(toReturn.ToArray(), UUID.Zero); | 2787 | returnObjects(toReturn.ToArray(), null); |
2788 | } | 2788 | } |
2789 | } | 2789 | } |
2790 | 2790 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index dff242e..45196bb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -645,7 +645,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
645 | localIDs.Add(sog.RootPart.LocalId); | 645 | localIDs.Add(sog.RootPart.LocalId); |
646 | sogScene.AddReturn(sog.OwnerID, sog.Name, sog.AbsolutePosition, | 646 | sogScene.AddReturn(sog.OwnerID, sog.Name, sog.AbsolutePosition, |
647 | "Returned at region cross"); | 647 | "Returned at region cross"); |
648 | sogScene.DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return, UUID.Zero); | 648 | sogScene.DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return, UUID.Zero, false); |
649 | } | 649 | } |
650 | catch (Exception) | 650 | catch (Exception) |
651 | { | 651 | { |
@@ -2254,7 +2254,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2254 | RootPart.UUID); | 2254 | RootPart.UUID); |
2255 | m_scene.AddReturn(OwnerID == GroupID ? LastOwnerID : OwnerID, Name, AbsolutePosition, "parcel autoreturn"); | 2255 | m_scene.AddReturn(OwnerID == GroupID ? LastOwnerID : OwnerID, Name, AbsolutePosition, "parcel autoreturn"); |
2256 | m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero, | 2256 | m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero, |
2257 | DeRezAction.Return, UUID.Zero); | 2257 | DeRezAction.Return, UUID.Zero, false); |
2258 | 2258 | ||
2259 | return; | 2259 | return; |
2260 | } | 2260 | } |