From 7f996448647e2703b82ea750bd38196fe5cea838 Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 18 Nov 2007 11:11:44 +0000 Subject: Attempt to get World Map working in Grid mode, will need to be using the grid asset server for it to work correctly and has only been quickly tested in a three region grid. Moved PermissionManager creation out of the Scene constructor and instead a PermissionManager is passed to the constructor as a param. So that we could create and use custom permissionsManagers. Added AllowMovement property to ScenePresence which can be used to stop movement of avatars (for example in a custom region that wanted avatars always in one place). Added PermissionManager call when copying objects, although currently the call will always return true so that it allows copying in places like Wright Plaza. A few other changes/fixes. --- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 88 ++++++++++++---------- 1 file changed, 49 insertions(+), 39 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 67b375a..b6daad6 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -147,6 +147,13 @@ namespace OpenSim.Region.Environment.Scenes get { return m_lastname; } } + protected bool m_allowMovement = true; + public bool AllowMovement + { + get { return m_allowMovement; } + set { m_allowMovement = value; } + } + private readonly IClientAPI m_controllingClient; protected PhysicsActor m_physicsActor; @@ -528,58 +535,61 @@ namespace OpenSim.Region.Environment.Scenes // Console.WriteLine("DEBUG: HandleAgentUpdate: null PhysicsActor!"); return; } - - int i = 0; - bool update_movementflag = false; - bool update_rotation = false; - bool DCFlagKeyPressed = false; - Vector3 agent_control_v3 = new Vector3(0, 0, 0); - Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); - bool oldflying = PhysicsActor.Flying; - - PhysicsActor.Flying = ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0); - if (PhysicsActor.Flying != oldflying) + if (m_allowMovement) { - update_movementflag = true; - } + int i = 0; + bool update_movementflag = false; + bool update_rotation = false; + bool DCFlagKeyPressed = false; + Vector3 agent_control_v3 = new Vector3(0, 0, 0); + Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); + bool oldflying = PhysicsActor.Flying; - if (q != m_bodyRot) - { - m_bodyRot = q; - update_rotation = true; - } - if (m_parentID == 0) - { - foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof (Dir_ControlFlags))) + PhysicsActor.Flying = ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0); + if (PhysicsActor.Flying != oldflying) { - if ((flags & (uint) DCF) != 0) + update_movementflag = true; + } + + if (q != m_bodyRot) + { + m_bodyRot = q; + update_rotation = true; + } + + if (m_parentID == 0) + { + foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof(Dir_ControlFlags))) { - DCFlagKeyPressed = true; - agent_control_v3 += Dir_Vectors[i]; - if ((m_movementflag & (uint) DCF) == 0) + if ((flags & (uint)DCF) != 0) { - m_movementflag += (byte) (uint) DCF; - update_movementflag = true; + DCFlagKeyPressed = true; + agent_control_v3 += Dir_Vectors[i]; + if ((m_movementflag & (uint)DCF) == 0) + { + m_movementflag += (byte)(uint)DCF; + update_movementflag = true; + } } - } - else - { - if ((m_movementflag & (uint) DCF) != 0) + else { - m_movementflag -= (byte) (uint) DCF; - update_movementflag = true; + if ((m_movementflag & (uint)DCF) != 0) + { + m_movementflag -= (byte)(uint)DCF; + update_movementflag = true; + } } + i++; } - i++; } - } - if ((update_movementflag) || (update_rotation && DCFlagKeyPressed)) - { - AddNewMovement(agent_control_v3, q); - UpdateMovementAnimations(update_movementflag); + if ((update_movementflag) || (update_rotation && DCFlagKeyPressed)) + { + AddNewMovement(agent_control_v3, q); + UpdateMovementAnimations(update_movementflag); + } } } -- cgit v1.1