From 9359293b11dfd0db82ba3ce8110b0014afbde88f Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Thu, 10 Nov 2011 15:20:21 -0800 Subject: [PATCH 1/2] Cleaned UpdatePermissions calls on SOP and SOG to eliminate redundant properties packet sends and so one part is not telling a different part what to do. That should be up to the SOG to manage permissions on its parts and notify clients when one of them changes. --- .../Framework/Scenes/SceneObjectGroup.cs | 7 ++++- .../Framework/Scenes/SceneObjectPart.cs | 27 +++++++------------ 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 3fa6bb086d..4355394952 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1873,7 +1873,7 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Send metadata about the root prim (name, description, sale price, etc.) to a client. + /// Send metadata about the root prim (name, description, sale price, permissions, etc.) to a client. /// /// public void SendPropertiesToClient(IClientAPI client) @@ -2481,6 +2481,11 @@ namespace OpenSim.Region.Framework.Scenes parts[i].UpdatePermissions(AgentID, field, localID, mask, addRemTF); HasGroupChanged = true; + + // Send the group's properties to all clients once all parts are updated + IClientAPI client; + if (Scene.TryGetClient(AgentID, out client)) + SendPropertiesToClient(client); } #endregion diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 407115962f..ad60604993 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1338,22 +1338,6 @@ namespace OpenSim.Region.Framework.Scenes client.SendObjectPropertiesReply(this); } - /// - /// For the scene object group to which this part belongs, send that scene object's root part properties to a client. - /// - /// - private void SendRootPartPropertiesToClient(UUID AgentID) - { - m_parentGroup.Scene.ForEachClient(delegate(IClientAPI client) - { - // Ugly reference :( - if (client.AgentId == AgentID) - { - m_parentGroup.SendPropertiesToClient(client); - } - }); - } - // TODO: unused: // private void handleTimerAccounting(uint localID, double interval) // { @@ -4214,6 +4198,15 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Update permissions on the SOP. Should only be called from SOG.UpdatePermissions because the SOG + /// will handle the client notifications once all of its parts are updated. + /// + /// + /// + /// + /// + /// public void UpdatePermissions(UUID AgentID, byte field, uint localID, uint mask, byte addRemTF) { bool set = addRemTF == 1; @@ -4262,8 +4255,6 @@ namespace OpenSim.Region.Framework.Scenes } SendFullUpdateToAllClients(); - - SendRootPartPropertiesToClient(AgentID); } } From 0daece6f2b8c14f9de02aabfa136135161083bc2 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 10 Nov 2011 23:15:03 +0100 Subject: [PATCH 2/2] Fix turn left and turn right properly. Works for both built-ins and LSL AOs --- .../Scenes/Animation/ScenePresenceAnimator.cs | 17 +++++++++++------ .../Region/Framework/Scenes/ScenePresence.cs | 5 +++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 05cdf610b4..4cf854edf8 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -180,12 +180,17 @@ namespace OpenSim.Region.Framework.Scenes.Animation bool heldBack = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG); bool heldLeft = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS); bool heldRight = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG); - //bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT; - //bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT; + bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT; + bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT; bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS; bool heldDown = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG; //bool flying = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) == AgentManager.ControlFlags.AGENT_CONTROL_FLY; //bool mouselook = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) == AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK; + if (heldForward || heldBack || heldLeft || heldRight || heldUp || heldDown) + { + heldTurnLeft = false; + heldTurnRight = false; + } // Direction in which the avatar is trying to move Vector3 move = Vector3.Zero; @@ -363,10 +368,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation // Not walking if (move.Z < 0) return "CROUCH"; -// else if (heldTurnLeft) -// return "TURNLEFT"; -// else if (heldTurnRight) -// return "TURNRIGHT"; + else if (heldTurnLeft) + return "TURNLEFT"; + else if (heldTurnRight) + return "TURNRIGHT"; else return "STAND"; } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e662492936..fdf944b5a0 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1387,6 +1387,11 @@ namespace OpenSim.Region.Framework.Scenes if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0) m_updateCount = UPDATE_COUNT; + // Make turning in place work + if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS) != 0 || + (flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG) != 0) + m_updateCount = UPDATE_COUNT; + if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) { StandUp();