diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 45 |
1 files changed, 34 insertions, 11 deletions
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 | |||
1056 | 1056 | ||
1057 | #region Constructor(s) | 1057 | #region Constructor(s) |
1058 | 1058 | ||
1059 | private void SetAutoGod() | ||
1060 | { | ||
1061 | if(!isNPC && m_scene.Permissions.IsGod(m_uuid)) | ||
1062 | { | ||
1063 | m_godLevel = 200; | ||
1064 | if(m_godLevel < UserLevel) | ||
1065 | m_godLevel = UserLevel; | ||
1066 | else | ||
1067 | m_godLevel = 0; | ||
1068 | } | ||
1069 | } | ||
1070 | |||
1059 | public ScenePresence( | 1071 | public ScenePresence( |
1060 | IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type) | 1072 | IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type) |
1061 | { | 1073 | { |
@@ -2121,18 +2133,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
2121 | 2133 | ||
2122 | m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2134 | m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2123 | 2135 | ||
2124 | 2136 | if(m_teleportFlags > 0) | |
2125 | if(m_teleportFlags > 0) //sanity check | 2137 | { |
2126 | gotCrossUpdate = false; | 2138 | gotCrossUpdate = false; // sanity check |
2139 | Thread.Sleep(500); // let viewers catch us | ||
2140 | } | ||
2127 | 2141 | ||
2128 | if(!gotCrossUpdate) | 2142 | if(!gotCrossUpdate) |
2129 | RotateToLookAt(look); | 2143 | RotateToLookAt(look); |
2130 | 2144 | ||
2131 | |||
2132 | // start sending terrain patchs | ||
2133 | if (!gotCrossUpdate && !isNPC) | ||
2134 | Scene.SendLayerData(ControllingClient); | ||
2135 | |||
2136 | // HG | 2145 | // HG |
2137 | bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0; | 2146 | bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0; |
2138 | if(isHGTP) | 2147 | if(isHGTP) |
@@ -2141,6 +2150,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2141 | m_log.DebugFormat("[CompleteMovement] HG"); | 2150 | m_log.DebugFormat("[CompleteMovement] HG"); |
2142 | } | 2151 | } |
2143 | 2152 | ||
2153 | if(!IsChildAgent && !isNPC) | ||
2154 | |||
2155 | ControllingClient.SendAdminResponse(UUID.Zero, (uint)GodLevel); | ||
2156 | |||
2157 | // start sending terrain patchs | ||
2158 | if (!gotCrossUpdate && !isNPC) | ||
2159 | Scene.SendLayerData(ControllingClient); | ||
2160 | |||
2144 | m_previusParcelHide = false; | 2161 | m_previusParcelHide = false; |
2145 | m_previusParcelUUID = UUID.Zero; | 2162 | m_previusParcelUUID = UUID.Zero; |
2146 | m_currentParcelHide = false; | 2163 | m_currentParcelHide = false; |
@@ -4580,7 +4597,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4580 | m_pos = cAgentData.Position + offset; | 4597 | m_pos = cAgentData.Position + offset; |
4581 | 4598 | ||
4582 | CameraPosition = cAgentData.Center + offset; | 4599 | CameraPosition = cAgentData.Center + offset; |
4583 | // if(!m_scene.AutomaticGodsOption) | 4600 | if(m_scene.AutomaticGodsOption) |
4601 | SetAutoGod(); | ||
4602 | else | ||
4584 | { | 4603 | { |
4585 | if(cAgentData.GodLevel >= 200 && m_scene.Permissions.IsGod(m_uuid)) | 4604 | if(cAgentData.GodLevel >= 200 && m_scene.Permissions.IsGod(m_uuid)) |
4586 | GodLevel = cAgentData.GodLevel; | 4605 | GodLevel = cAgentData.GodLevel; |
@@ -4646,7 +4665,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4646 | cAgent.HeadRotation = m_headrotation; | 4665 | cAgent.HeadRotation = m_headrotation; |
4647 | cAgent.BodyRotation = Rotation; | 4666 | cAgent.BodyRotation = Rotation; |
4648 | cAgent.ControlFlags = (uint)m_AgentControlFlags; | 4667 | cAgent.ControlFlags = (uint)m_AgentControlFlags; |
4649 | // if(!m_scene.AutomaticGodsOption) | 4668 | if(m_scene.AutomaticGodsOption) |
4669 | SetAutoGod(); | ||
4670 | else | ||
4650 | { | 4671 | { |
4651 | if (GodLevel >= 200 && m_scene.Permissions.IsGod(cAgent.AgentID)) | 4672 | if (GodLevel >= 200 && m_scene.Permissions.IsGod(cAgent.AgentID)) |
4652 | cAgent.GodLevel = (byte)GodLevel; | 4673 | cAgent.GodLevel = (byte)GodLevel; |
@@ -4750,7 +4771,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4750 | Rotation = cAgent.BodyRotation; | 4771 | Rotation = cAgent.BodyRotation; |
4751 | m_AgentControlFlags = (AgentManager.ControlFlags)cAgent.ControlFlags; | 4772 | m_AgentControlFlags = (AgentManager.ControlFlags)cAgent.ControlFlags; |
4752 | 4773 | ||
4753 | // if(!m_scene.AutomaticGodsOption) | 4774 | if(m_scene.AutomaticGodsOption) |
4775 | SetAutoGod(); | ||
4776 | else | ||
4754 | { | 4777 | { |
4755 | if (cAgent.GodLevel >= 200 && m_scene.Permissions.IsGod(cAgent.AgentID)) | 4778 | if (cAgent.GodLevel >= 200 && m_scene.Permissions.IsGod(cAgent.AgentID)) |
4756 | GodLevel = cAgent.GodLevel; | 4779 | GodLevel = cAgent.GodLevel; |