From 1f39a763a5186c7c51e10b5b055394672cc6c54e Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 21 Aug 2013 21:35:03 +0100 Subject: [PATCH] Don't allow users to attempt to sit on objects in a child region without going to that region first. If this is attempted, they get a "Try moving closer. Can't sit on object because it is not in the same region as you." message instead, which is the same as current ll grid. Sitting on ground is okay, since viewer navigates avatar to required region first before sitting. --- .../ClientStack/Linden/UDP/LLClientView.cs | 20 +++++++++++++++++++ .../Region/Framework/Scenes/ScenePresence.cs | 9 +++++++++ 2 files changed, 29 insertions(+) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index f0d8181164..8c51077f99 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -6651,6 +6651,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP } #endregion + if (SceneAgent.IsChildAgent) + { + SendCantSitBecauseChildAgentResponse(); + return true; + } + AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit; if (handlerAgentRequestSit != null) @@ -6675,6 +6681,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP } #endregion + if (SceneAgent.IsChildAgent) + { + SendCantSitBecauseChildAgentResponse(); + return true; + } + AgentSit handlerAgentSit = OnAgentSit; if (handlerAgentSit != null) { @@ -6684,6 +6696,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP return true; } + /// + /// Used when a child agent gets a sit response which should not be fulfilled. + /// + private void SendCantSitBecauseChildAgentResponse() + { + SendAlertMessage("Try moving closer. Can't sit on object because it is not in the same region as you."); + } + private bool HandleSoundTrigger(IClientAPI sender, Packet Pack) { SoundTriggerPacket soundTriggerPacket = (SoundTriggerPacket)Pack; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 37e52866df..4fc207a459 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2297,6 +2297,9 @@ namespace OpenSim.Region.Framework.Scenes public void HandleAgentRequestSit(IClientAPI remoteClient, UUID agentID, UUID targetID, Vector3 offset) { + if (IsChildAgent) + return; + if (ParentID != 0) { if (ParentPart.UUID == targetID) @@ -2523,6 +2526,9 @@ namespace OpenSim.Region.Framework.Scenes public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) { + if (IsChildAgent) + return; + SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID); if (part != null) @@ -2583,6 +2589,9 @@ namespace OpenSim.Region.Framework.Scenes public void HandleAgentSitOnGround() { + if (IsChildAgent) + return; + // m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick.. m_AngularVelocity = Vector3.Zero; Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED");