aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorTeravus Ovares2007-11-24 03:28:42 +0000
committerTeravus Ovares2007-11-24 03:28:42 +0000
commit944b118c622159c87e7f89c05892458d88797d58 (patch)
tree576fff3c7791e3df87425d5da862f5c70ec5c0f6 /OpenSim/Region/Environment
parentMake remoting errors because of missing adjacent regions a little more user a... (diff)
downloadopensim-SC_OLD-944b118c622159c87e7f89c05892458d88797d58.zip
opensim-SC_OLD-944b118c622159c87e7f89c05892458d88797d58.tar.gz
opensim-SC_OLD-944b118c622159c87e7f89c05892458d88797d58.tar.bz2
opensim-SC_OLD-944b118c622159c87e7f89c05892458d88797d58.tar.xz
* Added a way for the Region master user to kick individual users from their sim with a custom message. Their client says, "You've been logged off of secondlife, <Your custom message here> and logs them off.
* Added a way for the Region master user to kick *ALL* users from *ALL* their regions in the estate with a custom message.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs69
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs13
2 files changed, 66 insertions, 16 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 234b12a..0883e5c 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -257,9 +257,15 @@ namespace OpenSim.Region.Environment.Scenes
257 { 257 {
258 ForEachScenePresence(delegate(ScenePresence avatar) 258 ForEachScenePresence(delegate(ScenePresence avatar)
259 { 259 {
260 avatar.Kick("The region is going down."); 260 avatar.ControllingClient.Kick("The region is going down.");
261 avatar.ControllingClient.Stop(); 261
262 }); 262 });
263 ForEachScenePresence(delegate(ScenePresence avatar)
264 {
265 avatar.ControllingClient.Stop();
266
267 });
268
263 269
264 m_heartbeatTimer.Close(); 270 m_heartbeatTimer.Close();
265 m_innerScene.Close(); 271 m_innerScene.Close();
@@ -831,6 +837,7 @@ namespace OpenSim.Region.Environment.Scenes
831 837
832 client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); 838 client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage);
833 client.OnRequestGodlikePowers += handleRequestGodlikePowers; 839 client.OnRequestGodlikePowers += handleRequestGodlikePowers;
840 client.OnGodKickUser += handleGodlikeKickUser;
834 841
835 client.OnCreateNewInventoryItem += CreateNewInventoryItem; 842 client.OnCreateNewInventoryItem += CreateNewInventoryItem;
836 client.OnCreateNewInventoryFolder += CommsManager.UserProfileCache.HandleCreateInventoryFolder; 843 client.OnCreateNewInventoryFolder += CommsManager.UserProfileCache.HandleCreateInventoryFolder;
@@ -883,8 +890,19 @@ namespace OpenSim.Region.Environment.Scenes
883 m_eventManager.TriggerOnRemovePresence(agentID); 890 m_eventManager.TriggerOnRemovePresence(agentID);
884 891
885 ScenePresence avatar = GetScenePresence(agentID); 892 ScenePresence avatar = GetScenePresence(agentID);
893
894 Broadcast(delegate(IClientAPI client) {
895 try
896 {
897 client.SendKillObject(avatar.RegionHandle, avatar.LocalId);
898 }
899 catch (NullReferenceException NE)
900 {
901 //We can safely ignore null reference exceptions. It means the avatar are dead and cleaned up anyway.
902
903 }
904 });
886 905
887 Broadcast(delegate(IClientAPI client) { client.SendKillObject(avatar.RegionHandle, avatar.LocalId); });
888 906
889 ForEachScenePresence( 907 ForEachScenePresence(
890 delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); 908 delegate(ScenePresence presence) { presence.CoarseLocationChange(); });
@@ -1209,6 +1227,51 @@ namespace OpenSim.Region.Environment.Scenes
1209 1227
1210 } 1228 }
1211 1229
1230 public void handleGodlikeKickUser(LLUUID godid, LLUUID sessionid, LLUUID agentid, uint kickflags, byte[] reason)
1231 {
1232 // For some reason the client sends the seemingly hard coded, 44e87126e7944ded05b37c42da3d5cdb
1233 // for kicking everyone. Dun-know.
1234 if (m_scenePresences.ContainsKey(agentid) || agentid == new LLUUID("44e87126e7944ded05b37c42da3d5cdb"))
1235 {
1236 if (godid == RegionInfo.MasterAvatarAssignedUUID)
1237 {
1238 if (agentid == new LLUUID("44e87126e7944ded05b37c42da3d5cdb"))
1239 {
1240
1241 ClientManager.ForEachClient(delegate (IClientAPI controller)
1242 {
1243 if (controller.AgentId != godid) // Do we really want to kick the initiator of this madness?
1244 {
1245 controller.Kick(Helpers.FieldToUTF8String(reason));
1246 }
1247 }
1248 );
1249 // This is a bit crude. It seems the client will be null before it actually stops the thread
1250 // The thread will kill itself eventually :/
1251 // Is there another way to make sure *all* clients get this 'inter region' message?
1252 ClientManager.ForEachClient(delegate (IClientAPI controller)
1253 {
1254 if (controller.AgentId != godid) // Do we really want to kick the initiator of this madness?
1255 {
1256 controller.Close();
1257 }
1258 }
1259 );
1260 }
1261 else
1262 {
1263 m_scenePresences[agentid].ControllingClient.Kick(Helpers.FieldToUTF8String(reason));
1264 m_scenePresences[agentid].ControllingClient.Close();
1265 }
1266 }
1267 else
1268 {
1269 if (m_scenePresences.ContainsKey(godid))
1270 m_scenePresences[godid].ControllingClient.SendAgentAlertMessage("Kick request denied", false);
1271 }
1272 }
1273 }
1274
1212 public void SendAlertToUser(string firstName, string lastName, string message, bool modal) 1275 public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
1213 { 1276 {
1214 foreach (ScenePresence presence in m_scenePresences.Values) 1277 foreach (ScenePresence presence in m_scenePresences.Values)
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index f91913d..6117828 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -1219,20 +1219,7 @@ namespace OpenSim.Region.Environment.Scenes
1219 1219
1220 #endregion 1220 #endregion
1221 1221
1222 public void Kick(string message)
1223 {
1224 KickUserPacket kupack = new KickUserPacket();
1225 KickUserPacket.UserInfoBlock kupackib = kupack.UserInfo;
1226
1227 kupack.UserInfo.AgentID = UUID;
1228 kupack.UserInfo.SessionID = this.ControllingClient.SessionId;
1229 1222
1230 kupack.TargetBlock.TargetIP = (uint)0;
1231 kupack.TargetBlock.TargetPort = (ushort)0;
1232 kupack.UserInfo.Reason = Helpers.StringToField(message);
1233 ControllingClient.OutPacket(kupack, ThrottleOutPacketType.Task);
1234
1235 }
1236 public void GrantGodlikePowers(LLUUID agentID, LLUUID sessionID, LLUUID token) 1223 public void GrantGodlikePowers(LLUUID agentID, LLUUID sessionID, LLUUID token)
1237 { 1224 {
1238 GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket(); 1225 GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket();