diff options
author | Melanie | 2011-01-14 03:35:45 +0100 |
---|---|---|
committer | Melanie | 2011-01-14 03:35:45 +0100 |
commit | fe2d9be0cff649fad7fee78b257686954262e3cd (patch) | |
tree | c86ad66c6db05bade59cdb694c4bbac99db81689 /OpenSim/Region/CoreModules | |
parent | Fix slam bits being lost when editing perms in prim inventory (diff) | |
download | opensim-SC_OLD-fe2d9be0cff649fad7fee78b257686954262e3cd.zip opensim-SC_OLD-fe2d9be0cff649fad7fee78b257686954262e3cd.tar.gz opensim-SC_OLD-fe2d9be0cff649fad7fee78b257686954262e3cd.tar.bz2 opensim-SC_OLD-fe2d9be0cff649fad7fee78b257686954262e3cd.tar.xz |
Implement nonlocal god kicks and freezes
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 9fd3318..a83b3df 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | |||
@@ -74,6 +74,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
74 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; | 74 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; |
75 | m_scene.EventManager.OnRegisterCaps += OnRegisterCaps; | 75 | m_scene.EventManager.OnRegisterCaps += OnRegisterCaps; |
76 | m_scene.EventManager.OnClientClosed += OnClientClosed; | 76 | m_scene.EventManager.OnClientClosed += OnClientClosed; |
77 | scene.EventManager.OnIncomingInstantMessage += | ||
78 | OnIncomingInstantMessage; | ||
77 | } | 79 | } |
78 | 80 | ||
79 | public void PostInitialise() {} | 81 | public void PostInitialise() {} |
@@ -128,6 +130,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
128 | uint kickFlags = userData["KickFlags"].AsUInteger(); | 130 | uint kickFlags = userData["KickFlags"].AsUInteger(); |
129 | string reason = userData["Reason"].AsString(); | 131 | string reason = userData["Reason"].AsString(); |
130 | 132 | ||
133 | ScenePresence god = m_scene.GetScenePresence(godID); | ||
134 | if (god == null || god.ControllingClient.SessionId != godSessionID) | ||
135 | return String.Empty; | ||
136 | |||
131 | KickUser(godID, godSessionID, agentID, kickFlags, Util.StringToBytes1024(reason)); | 137 | KickUser(godID, godSessionID, agentID, kickFlags, Util.StringToBytes1024(reason)); |
132 | } | 138 | } |
133 | else | 139 | else |
@@ -188,12 +194,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
188 | if (!m_scene.Permissions.IsGod(godID)) | 194 | if (!m_scene.Permissions.IsGod(godID)) |
189 | return; | 195 | return; |
190 | 196 | ||
191 | ScenePresence god = m_scene.GetScenePresence(godID); | ||
192 | if (god == null || god.ControllingClient.SessionId != sessionID) | ||
193 | return; | ||
194 | |||
195 | ScenePresence sp = m_scene.GetScenePresence(agentID); | 197 | ScenePresence sp = m_scene.GetScenePresence(agentID); |
196 | 198 | ||
199 | if (sp == null && agentID != ALL_AGENTS) | ||
200 | { | ||
201 | IMessageTransferModule transferModule = | ||
202 | m_scene.RequestModuleInterface<IMessageTransferModule>(); | ||
203 | if (transferModule != null) | ||
204 | { | ||
205 | m_log.DebugFormat("[GODS]: Sending nonlocal kill for agent {0}", agentID); | ||
206 | transferModule.SendInstantMessage(new GridInstantMessage( | ||
207 | m_scene, godID, "God", agentID, (byte)250, false, | ||
208 | Utils.BytesToString(reason), UUID.Zero, true, | ||
209 | new Vector3(), new byte[] {(byte)kickflags}), | ||
210 | delegate(bool success) {} ); | ||
211 | } | ||
212 | return; | ||
213 | } | ||
214 | |||
197 | switch (kickflags) | 215 | switch (kickflags) |
198 | { | 216 | { |
199 | case 0: | 217 | case 0: |
@@ -240,5 +258,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
240 | sp.ControllingClient.Kick(reason); | 258 | sp.ControllingClient.Kick(reason); |
241 | sp.Scene.IncomingCloseAgent(sp.UUID); | 259 | sp.Scene.IncomingCloseAgent(sp.UUID); |
242 | } | 260 | } |
261 | |||
262 | private void OnIncomingInstantMessage(GridInstantMessage msg) | ||
263 | { | ||
264 | if (msg.dialog == (uint)250) // Nonlocal kick | ||
265 | { | ||
266 | UUID agentID = new UUID(msg.toAgentID); | ||
267 | string reason = msg.message; | ||
268 | UUID godID = new UUID(msg.fromAgentID); | ||
269 | uint kickMode = (uint)msg.binaryBucket[0]; | ||
270 | |||
271 | KickUser(godID, UUID.Zero, agentID, kickMode, Util.StringToBytes1024(reason)); | ||
272 | } | ||
273 | } | ||
243 | } | 274 | } |
244 | } | 275 | } |