From cbc3501246d5250788634f6d1b6fbd1f60661c85 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 5 Jan 2017 18:02:59 +0000 Subject: a few changes to Gods ( ie administrators) control --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 36 +++++++++--------------- 1 file changed, 13 insertions(+), 23 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f906d9f..c1b1a63 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -4506,34 +4506,22 @@ namespace OpenSim.Region.Framework.Scenes #endregion /// - /// This allows the Sim owner the abiility to kick users from their sim currently. - /// It tells the client that the agent has permission to do so. + /// handle god level requests. /// - public void GrantGodlikePowers(UUID agentID, UUID sessionID, UUID token, bool godStatus) + public void GrantGodlikePowers(UUID token, bool godStatus) { int oldgodlevel = GodLevel; - - if (godStatus) + + if (godStatus && !isNPC && m_scene.Permissions.IsGod(UUID)) { - // For now, assign god level 200 to anyone - // who is granted god powers, but has no god level set. - // - UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, agentID); - if (account != null) - { - if (account.UserLevel > 0) - GodLevel = account.UserLevel; - else - GodLevel = 200; - } + GodLevel = 200; + if(GodLevel < UserLevel) + GodLevel = UserLevel; } else - { - GodLevel = 0; - } + GodLevel = 0; ControllingClient.SendAdminResponse(token, (uint)GodLevel); - if(oldgodlevel != GodLevel) parcelGodCheck(m_currentParcelUUID, GodLevel >= 200); } @@ -4640,7 +4628,7 @@ namespace OpenSim.Region.Framework.Scenes cAgent.BodyRotation = Rotation; cAgent.ControlFlags = (uint)m_AgentControlFlags; - if (m_scene.Permissions.IsGod(new UUID(cAgent.AgentID))) + if (GodLevel > 200 && m_scene.Permissions.IsGod(cAgent.AgentID)) cAgent.GodLevel = (byte)GodLevel; else cAgent.GodLevel = (byte) 0; @@ -4741,10 +4729,12 @@ namespace OpenSim.Region.Framework.Scenes Rotation = cAgent.BodyRotation; m_AgentControlFlags = (AgentManager.ControlFlags)cAgent.ControlFlags; - if (m_scene.Permissions.IsGod(new UUID(cAgent.AgentID))) + if (cAgent.GodLevel >200 && m_scene.Permissions.IsGod(cAgent.AgentID)) GodLevel = cAgent.GodLevel; - SetAlwaysRun = cAgent.AlwaysRun; + else + GodLevel = 0; + SetAlwaysRun = cAgent.AlwaysRun; Appearance = new AvatarAppearance(cAgent.Appearance); /* -- cgit v1.1