diff options
author | UbitUmarov | 2017-01-05 21:21:15 +0000 |
---|---|---|
committer | UbitUmarov | 2017-01-05 21:21:15 +0000 |
commit | 1fb01a009925f6c5d55f9f485a6d151b3b981f40 (patch) | |
tree | e4d049b30f06df07d1ddc5b72bb4e8499866bea2 /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | remove code i started but didn't finish (diff) | |
download | opensim-SC-1fb01a009925f6c5d55f9f485a6d151b3b981f40.zip opensim-SC-1fb01a009925f6c5d55f9f485a6d151b3b981f40.tar.gz opensim-SC-1fb01a009925f6c5d55f9f485a6d151b3b981f40.tar.bz2 opensim-SC-1fb01a009925f6c5d55f9f485a6d151b3b981f40.tar.xz |
add config option automatic_gods. With this option true, users that can be Gods will have that level automaticly without the need request on viewer; Propagate current god level to nearby regions (with local checks)
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 29e139b..c8d28f9 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1087,6 +1087,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1087 | if (account != null) | 1087 | if (account != null) |
1088 | UserLevel = account.UserLevel; | 1088 | UserLevel = account.UserLevel; |
1089 | 1089 | ||
1090 | if(!isNPC && m_scene.AutomaticGodsOption && m_scene.Permissions != null) | ||
1091 | { | ||
1092 | if(m_scene.Permissions.IsGod(m_uuid)) | ||
1093 | m_godLevel = 200; | ||
1094 | if(m_godLevel < UserLevel) | ||
1095 | m_godLevel = UserLevel; | ||
1096 | } | ||
1097 | |||
1090 | // IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); | 1098 | // IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); |
1091 | // if (gm != null) | 1099 | // if (gm != null) |
1092 | // Grouptitle = gm.GetGroupTitle(m_uuid); | 1100 | // Grouptitle = gm.GetGroupTitle(m_uuid); |
@@ -4262,6 +4270,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4262 | agentpos.Position = AbsolutePosition; | 4270 | agentpos.Position = AbsolutePosition; |
4263 | agentpos.Velocity = Velocity; | 4271 | agentpos.Velocity = Velocity; |
4264 | agentpos.RegionHandle = RegionHandle; | 4272 | agentpos.RegionHandle = RegionHandle; |
4273 | agentpos.GodLevel = GodLevel; | ||
4265 | agentpos.Throttles = ControllingClient.GetThrottlesPacked(1); | 4274 | agentpos.Throttles = ControllingClient.GetThrottlesPacked(1); |
4266 | 4275 | ||
4267 | // Let's get this out of the update loop | 4276 | // Let's get this out of the update loop |
@@ -4510,6 +4519,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4510 | /// </summary> | 4519 | /// </summary> |
4511 | public void GrantGodlikePowers(UUID token, bool godStatus) | 4520 | public void GrantGodlikePowers(UUID token, bool godStatus) |
4512 | { | 4521 | { |
4522 | if(m_scene.AutomaticGodsOption) | ||
4523 | return; | ||
4524 | |||
4513 | int oldgodlevel = GodLevel; | 4525 | int oldgodlevel = GodLevel; |
4514 | 4526 | ||
4515 | if (godStatus && !isNPC && m_scene.Permissions.IsGod(UUID)) | 4527 | if (godStatus && !isNPC && m_scene.Permissions.IsGod(UUID)) |
@@ -4568,6 +4580,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
4568 | m_pos = cAgentData.Position + offset; | 4580 | m_pos = cAgentData.Position + offset; |
4569 | 4581 | ||
4570 | CameraPosition = cAgentData.Center + offset; | 4582 | CameraPosition = cAgentData.Center + offset; |
4583 | if(!m_scene.AutomaticGodsOption) | ||
4584 | { | ||
4585 | if(cAgentData.GodLevel >= 200 && m_scene.Permissions.IsGod(m_uuid)) | ||
4586 | GodLevel = cAgentData.GodLevel; | ||
4587 | else | ||
4588 | GodLevel = 0; | ||
4589 | } | ||
4571 | 4590 | ||
4572 | if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) | 4591 | if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) |
4573 | { | 4592 | { |
@@ -4627,11 +4646,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
4627 | cAgent.HeadRotation = m_headrotation; | 4646 | cAgent.HeadRotation = m_headrotation; |
4628 | cAgent.BodyRotation = Rotation; | 4647 | cAgent.BodyRotation = Rotation; |
4629 | cAgent.ControlFlags = (uint)m_AgentControlFlags; | 4648 | cAgent.ControlFlags = (uint)m_AgentControlFlags; |
4630 | 4649 | if(!m_scene.AutomaticGodsOption) | |
4631 | if (GodLevel > 200 && m_scene.Permissions.IsGod(cAgent.AgentID)) | 4650 | { |
4632 | cAgent.GodLevel = (byte)GodLevel; | 4651 | if (GodLevel >= 200 && m_scene.Permissions.IsGod(cAgent.AgentID)) |
4633 | else | 4652 | cAgent.GodLevel = (byte)GodLevel; |
4634 | cAgent.GodLevel = (byte) 0; | 4653 | else |
4654 | cAgent.GodLevel = (byte) 0; | ||
4655 | } | ||
4635 | 4656 | ||
4636 | cAgent.AlwaysRun = SetAlwaysRun; | 4657 | cAgent.AlwaysRun = SetAlwaysRun; |
4637 | 4658 | ||
@@ -4729,10 +4750,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
4729 | Rotation = cAgent.BodyRotation; | 4750 | Rotation = cAgent.BodyRotation; |
4730 | m_AgentControlFlags = (AgentManager.ControlFlags)cAgent.ControlFlags; | 4751 | m_AgentControlFlags = (AgentManager.ControlFlags)cAgent.ControlFlags; |
4731 | 4752 | ||
4732 | if (cAgent.GodLevel >200 && m_scene.Permissions.IsGod(cAgent.AgentID)) | 4753 | if(!m_scene.AutomaticGodsOption) |
4733 | GodLevel = cAgent.GodLevel; | 4754 | { |
4734 | else | 4755 | if (cAgent.GodLevel >= 200 && m_scene.Permissions.IsGod(cAgent.AgentID)) |
4735 | GodLevel = 0; | 4756 | GodLevel = cAgent.GodLevel; |
4757 | else | ||
4758 | GodLevel = 0; | ||
4759 | } | ||
4736 | 4760 | ||
4737 | SetAlwaysRun = cAgent.AlwaysRun; | 4761 | SetAlwaysRun = cAgent.AlwaysRun; |
4738 | 4762 | ||