From 05902d2958303a5280e8d076c3e467e8ccf46a97 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 5 Jan 2017 22:27:53 +0000 Subject: inform viewers of current godlevel; put back a small delay on teleport arrivel to give time to viewers to sync --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 45 ++++++++++++++++++------ 1 file changed, 34 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5b86921..58af347 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1056,6 +1056,18 @@ namespace OpenSim.Region.Framework.Scenes #region Constructor(s) + private void SetAutoGod() + { + if(!isNPC && m_scene.Permissions.IsGod(m_uuid)) + { + m_godLevel = 200; + if(m_godLevel < UserLevel) + m_godLevel = UserLevel; + else + m_godLevel = 0; + } + } + public ScenePresence( IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type) { @@ -2121,18 +2133,15 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); - - if(m_teleportFlags > 0) //sanity check - gotCrossUpdate = false; + if(m_teleportFlags > 0) + { + gotCrossUpdate = false; // sanity check + Thread.Sleep(500); // let viewers catch us + } if(!gotCrossUpdate) RotateToLookAt(look); - -// start sending terrain patchs - if (!gotCrossUpdate && !isNPC) - Scene.SendLayerData(ControllingClient); - // HG bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0; if(isHGTP) @@ -2141,6 +2150,14 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[CompleteMovement] HG"); } + if(!IsChildAgent && !isNPC) + + ControllingClient.SendAdminResponse(UUID.Zero, (uint)GodLevel); + +// start sending terrain patchs + if (!gotCrossUpdate && !isNPC) + Scene.SendLayerData(ControllingClient); + m_previusParcelHide = false; m_previusParcelUUID = UUID.Zero; m_currentParcelHide = false; @@ -4580,7 +4597,9 @@ namespace OpenSim.Region.Framework.Scenes m_pos = cAgentData.Position + offset; CameraPosition = cAgentData.Center + offset; -// if(!m_scene.AutomaticGodsOption) + if(m_scene.AutomaticGodsOption) + SetAutoGod(); + else { if(cAgentData.GodLevel >= 200 && m_scene.Permissions.IsGod(m_uuid)) GodLevel = cAgentData.GodLevel; @@ -4646,7 +4665,9 @@ namespace OpenSim.Region.Framework.Scenes cAgent.HeadRotation = m_headrotation; cAgent.BodyRotation = Rotation; cAgent.ControlFlags = (uint)m_AgentControlFlags; -// if(!m_scene.AutomaticGodsOption) + if(m_scene.AutomaticGodsOption) + SetAutoGod(); + else { if (GodLevel >= 200 && m_scene.Permissions.IsGod(cAgent.AgentID)) cAgent.GodLevel = (byte)GodLevel; @@ -4750,7 +4771,9 @@ namespace OpenSim.Region.Framework.Scenes Rotation = cAgent.BodyRotation; m_AgentControlFlags = (AgentManager.ControlFlags)cAgent.ControlFlags; -// if(!m_scene.AutomaticGodsOption) + if(m_scene.AutomaticGodsOption) + SetAutoGod(); + else { if (cAgent.GodLevel >= 200 && m_scene.Permissions.IsGod(cAgent.AgentID)) GodLevel = cAgent.GodLevel; -- cgit v1.1