From 0baaa23bde53bf47f4c8155c5927681bc6f3a5fc Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 21 Aug 2016 20:00:27 +0100
Subject: remove sceneGraph MoveObject and make it part of
ProcessObjectGrabUpdate ( scene.PacketHandlers) where it belongs
---
.../Region/Framework/Scenes/Scene.PacketHandlers.cs | 19 ++++++++++++++++---
OpenSim/Region/Framework/Scenes/Scene.cs | 3 +--
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 4 ++--
3 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index c49edd1..fc90d60 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -377,8 +377,21 @@ namespace OpenSim.Region.Framework.Scenes
if (part == null)
return;
- SceneObjectGroup obj = part.ParentGroup;
+ SceneObjectGroup group = part.ParentGroup;
+ if(group == null || group.IsDeleted)
+ return;
+
+ if (Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.)
+ {
+ group.GrabMovement(objectID, offset, pos, remoteClient);
+ }
+ // This is outside the above permissions condition
+ // so that if the object is locked the client moving the object
+ // get's it's position on the simulator even if it was the same as before
+ // This keeps the moving user's client in sync with the rest of the world.
+ group.SendGroupTerseUpdate();
+
SurfaceTouchEventArgs surfaceArg = null;
if (surfaceArgs != null && surfaceArgs.Count > 0)
surfaceArg = surfaceArgs[0];
@@ -391,9 +404,9 @@ namespace OpenSim.Region.Framework.Scenes
// or if we're meant to pass on touches anyway. Don't send to root prim
// if prim touched is the root prim as we just did it
if (((part.ScriptEvents & scriptEvents.touch) == 0) ||
- (part.PassTouches && (part.LocalId != obj.RootPart.LocalId)))
+ (part.PassTouches && (part.LocalId != group.RootPart.LocalId)))
{
- EventManager.TriggerObjectGrabbing(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg);
+ EventManager.TriggerObjectGrabbing(group.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg);
}
}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 7b1b3c9..88416e4 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3329,7 +3329,6 @@ namespace OpenSim.Region.Framework.Scenes
client.OnObjectRequest += RequestPrim;
client.OnObjectSelect += SelectPrim;
client.OnObjectDeselect += DeselectPrim;
- client.OnGrabUpdate += m_sceneGraph.MoveObject;
client.OnSpinStart += m_sceneGraph.SpinStart;
client.OnSpinUpdate += m_sceneGraph.SpinObject;
client.OnDeRezObject += DeRezObjects;
@@ -3457,7 +3456,6 @@ namespace OpenSim.Region.Framework.Scenes
client.OnObjectRequest -= RequestPrim;
client.OnObjectSelect -= SelectPrim;
client.OnObjectDeselect -= DeselectPrim;
- client.OnGrabUpdate -= m_sceneGraph.MoveObject;
client.OnSpinStart -= m_sceneGraph.SpinStart;
client.OnSpinUpdate -= m_sceneGraph.SpinObject;
client.OnDeRezObject -= DeRezObjects;
@@ -3472,6 +3470,7 @@ namespace OpenSim.Region.Framework.Scenes
client.OnRequestObjectPropertiesFamily -= m_sceneGraph.RequestObjectPropertiesFamily;
client.OnObjectPermissions -= HandleObjectPermissionsUpdate;
client.OnGrabObject -= ProcessObjectGrab;
+ client.OnGrabUpdate -= ProcessObjectGrabUpdate;
client.OnDeGrabObject -= ProcessObjectDeGrab;
client.OnUndo -= m_sceneGraph.HandleUndo;
client.OnRedo -= m_sceneGraph.HandleRedo;
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index b65d168..0e5720f 100755
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1674,7 +1674,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
-
+/* moved to scene ProcessObjectGrabUpdate
///
/// Move the given object
///
@@ -1699,7 +1699,7 @@ namespace OpenSim.Region.Framework.Scenes
group.SendGroupTerseUpdate();
}
}
-
+*/
///
/// Start spinning the given object
///
--
cgit v1.1