diff options
author | Justin Clark-Casey (justincc) | 2009-11-27 19:23:51 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2009-11-27 19:23:51 +0000 |
commit | e078fb2e713fd20c811bd8a12a914042fdf062ee (patch) | |
tree | b1bbd591b5a535b7f06e817900687dcfad7641b7 /OpenSim | |
parent | minor: add KittyLiu to CONTRIBUTORS.txt (diff) | |
download | opensim-SC_OLD-e078fb2e713fd20c811bd8a12a914042fdf062ee.zip opensim-SC_OLD-e078fb2e713fd20c811bd8a12a914042fdf062ee.tar.gz opensim-SC_OLD-e078fb2e713fd20c811bd8a12a914042fdf062ee.tar.bz2 opensim-SC_OLD-e078fb2e713fd20c811bd8a12a914042fdf062ee.tar.xz |
Implement god mode user freezing and unfreezing
See http://opensimulator.org/mantis/view.php?id=4356
Thanks Revolution
I performed a subsequent probable bug fix in this patch
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | 71 |
2 files changed, 45 insertions, 28 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 4221212..c2aa8e2 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -13610,7 +13610,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
13610 | if (handlerGodKickUser != null) | 13610 | if (handlerGodKickUser != null) |
13611 | { | 13611 | { |
13612 | handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, | 13612 | handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, |
13613 | gkupack.UserInfo.AgentID, (uint)0, gkupack.UserInfo.Reason); | 13613 | gkupack.UserInfo.AgentID, gkupack.UserInfo.KickFlags, gkupack.UserInfo.Reason,gkupack.UserInfo); |
13614 | } | 13614 | } |
13615 | } | 13615 | } |
13616 | else | 13616 | else |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 273c128..7e1bed5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | |||
@@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
98 | /// <param name="godID">The person doing the kicking</param> | 98 | /// <param name="godID">The person doing the kicking</param> |
99 | /// <param name="sessionID">The session of the person doing the kicking</param> | 99 | /// <param name="sessionID">The session of the person doing the kicking</param> |
100 | /// <param name="agentID">the person that is being kicked</param> | 100 | /// <param name="agentID">the person that is being kicked</param> |
101 | /// <param name="kickflags">This isn't used apparently</param> | 101 | /// <param name="kickflags">Tells what to do to the user</param> |
102 | /// <param name="reason">The message to send to the user after it's been turned into a field</param> | 102 | /// <param name="reason">The message to send to the user after it's been turned into a field</param> |
103 | public void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason) | 103 | public void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason) |
104 | { | 104 | { |
@@ -110,39 +110,56 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
110 | { | 110 | { |
111 | if (m_scene.Permissions.IsGod(godID)) | 111 | if (m_scene.Permissions.IsGod(godID)) |
112 | { | 112 | { |
113 | if (agentID == kickUserID) | 113 | if (kickflags == 0) |
114 | { | 114 | { |
115 | string reasonStr = Utils.BytesToString(reason); | 115 | if (agentID == kickUserID) |
116 | { | ||
117 | string reasonStr = Utils.BytesToString(reason); | ||
116 | 118 | ||
117 | m_scene.ForEachClient( | 119 | m_scene.ForEachClient( |
118 | delegate(IClientAPI controller) | 120 | delegate(IClientAPI controller) |
119 | { | 121 | { |
120 | if (controller.AgentId != godID) | 122 | if (controller.AgentId != godID) |
121 | controller.Kick(reasonStr); | 123 | controller.Kick(reasonStr); |
122 | } | 124 | } |
123 | ); | 125 | ); |
124 | 126 | ||
125 | // This is a bit crude. It seems the client will be null before it actually stops the thread | 127 | // This is a bit crude. It seems the client will be null before it actually stops the thread |
126 | // The thread will kill itself eventually :/ | 128 | // The thread will kill itself eventually :/ |
127 | // Is there another way to make sure *all* clients get this 'inter region' message? | 129 | // Is there another way to make sure *all* clients get this 'inter region' message? |
128 | m_scene.ForEachScenePresence( | 130 | m_scene.ForEachScenePresence( |
129 | delegate(ScenePresence p) | 131 | delegate(ScenePresence p) |
130 | { | ||
131 | if (p.UUID != godID && !p.IsChildAgent) | ||
132 | { | 132 | { |
133 | // Possibly this should really be p.Close() though that method doesn't send a close | 133 | if (p.UUID != godID && !p.IsChildAgent) |
134 | // to the client | 134 | { |
135 | p.ControllingClient.Close(); | 135 | // Possibly this should really be p.Close() though that method doesn't send a close |
136 | // to the client | ||
137 | p.ControllingClient.Close(); | ||
138 | } | ||
136 | } | 139 | } |
137 | } | 140 | ); |
138 | ); | 141 | } |
142 | else | ||
143 | { | ||
144 | m_scene.SceneGraph.removeUserCount(!sp.IsChildAgent); | ||
145 | |||
146 | sp.ControllingClient.Kick(Utils.BytesToString(reason)); | ||
147 | sp.ControllingClient.Close(); | ||
148 | } | ||
139 | } | 149 | } |
140 | else | 150 | |
151 | if (kickflags == 1) | ||
141 | { | 152 | { |
142 | m_scene.SceneGraph.removeUserCount(!sp.IsChildAgent); | 153 | sp.AllowMovement = false; |
143 | 154 | m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason)); | |
144 | sp.ControllingClient.Kick(Utils.BytesToString(reason)); | 155 | m_dialogModule.SendAlertToUser(godID, "User Frozen"); |
145 | sp.ControllingClient.Close(); | 156 | } |
157 | |||
158 | if (kickflags == 2) | ||
159 | { | ||
160 | sp.AllowMovement = true; | ||
161 | m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason)); | ||
162 | m_dialogModule.SendAlertToUser(godID, "User Unfrozen"); | ||
146 | } | 163 | } |
147 | } | 164 | } |
148 | else | 165 | else |