aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/IClientAPI.cs4
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs1
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs17
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs13
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs69
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs13
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs5
7 files changed, 101 insertions, 21 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index f7e3521..3f0c87a 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -268,6 +268,8 @@ namespace OpenSim.Framework
268 public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape); 268 public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape);
269 269
270 public delegate void RequestGodlikePowers(LLUUID AgentID, LLUUID SessionID, LLUUID token, IClientAPI remote_client); 270 public delegate void RequestGodlikePowers(LLUUID AgentID, LLUUID SessionID, LLUUID token, IClientAPI remote_client);
271
272 public delegate void GodKickUser(LLUUID GodAgentID, LLUUID GodSessionID, LLUUID AgentID, uint kickflags, byte[] reason);
271 273
272 public delegate void CreateInventoryFolder( 274 public delegate void CreateInventoryFolder(
273 IClientAPI remoteClient, LLUUID folderID, ushort folderType, string folderName, LLUUID parentID); 275 IClientAPI remoteClient, LLUUID folderID, ushort folderType, string folderName, LLUUID parentID);
@@ -333,6 +335,7 @@ namespace OpenSim.Framework
333 event AddNewPrim OnAddPrim; 335 event AddNewPrim OnAddPrim;
334 336
335 event RequestGodlikePowers OnRequestGodlikePowers; 337 event RequestGodlikePowers OnRequestGodlikePowers;
338 event GodKickUser OnGodKickUser;
336 339
337 event ObjectDuplicate OnObjectDuplicate; 340 event ObjectDuplicate OnObjectDuplicate;
338 event UpdateVector OnGrabObject; 341 event UpdateVector OnGrabObject;
@@ -472,6 +475,7 @@ namespace OpenSim.Framework
472 void SetDebug(int newDebug); 475 void SetDebug(int newDebug);
473 void InPacket(Packet NewPack); 476 void InPacket(Packet NewPack);
474 void Close(); 477 void Close();
478 void Kick(string message);
475 void Stop(); 479 void Stop();
476 event ViewerEffectEventHandler OnViewerEffect; 480 event ViewerEffectEventHandler OnViewerEffect;
477 event Action<IClientAPI> OnLogout; 481 event Action<IClientAPI> OnLogout;
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index b046f0a..80111d9 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -66,6 +66,7 @@ namespace OpenSim.Region.ClientStack
66 public event MoveObject OnGrabUpdate; 66 public event MoveObject OnGrabUpdate;
67 public event AddNewPrim OnAddPrim; 67 public event AddNewPrim OnAddPrim;
68 public event RequestGodlikePowers OnRequestGodlikePowers; 68 public event RequestGodlikePowers OnRequestGodlikePowers;
69 public event GodKickUser OnGodKickUser;
69 public event ObjectExtraParams OnUpdateExtraParams; 70 public event ObjectExtraParams OnUpdateExtraParams;
70 public event UpdateShape OnUpdatePrimShape; 71 public event UpdateShape OnUpdatePrimShape;
71 public event ObjectSelect OnObjectSelect; 72 public event ObjectSelect OnObjectSelect;
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index ca7ba7f..f46c199 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -1075,11 +1075,18 @@ namespace OpenSim.Region.ClientStack
1075 1075
1076 break; 1076 break;
1077 case PacketType.GodKickUser: 1077 case PacketType.GodKickUser:
1078 //GodKickUserPacket gkupack = (GodKickUserPacket) Pack; 1078 OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "unhandled packet " + Pack.ToString());
1079 //gkupack.UserInfo.GodID; 1079
1080 //gkupack.UserInfo.AgentID; 1080 GodKickUserPacket gkupack = (GodKickUserPacket) Pack;
1081 //gkupack.UserInfo.KickFlags; 1081
1082 //gkupack.UserInfo.Reason; 1082 if (gkupack.UserInfo.GodSessionID == SessionId && this.AgentId == gkupack.UserInfo.GodID)
1083 {
1084 OnGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, gkupack.UserInfo.AgentID, (uint) 0, gkupack.UserInfo.Reason);
1085 }
1086 else
1087 {
1088 SendAgentAlertMessage("Kick request denied", false);
1089 }
1083 //KickUserPacket kupack = new KickUserPacket(); 1090 //KickUserPacket kupack = new KickUserPacket();
1084 //KickUserPacket.UserInfoBlock kupackib = kupack.UserInfo; 1091 //KickUserPacket.UserInfoBlock kupackib = kupack.UserInfo;
1085 1092
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index e6712fe..fbe66db 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -308,7 +308,20 @@ namespace OpenSim.Region.ClientStack
308 308
309 ClientThread.Abort(); 309 ClientThread.Abort();
310 } 310 }
311 public void Kick(string message)
312 {
313 KickUserPacket kupack = new KickUserPacket();
314
315 kupack.UserInfo.AgentID = AgentId;
316 kupack.UserInfo.SessionID = SessionId;
317
318 kupack.TargetBlock.TargetIP = (uint)0;
319 kupack.TargetBlock.TargetPort = (ushort)0;
320 kupack.UserInfo.Reason = Helpers.StringToField(message);
321 OutPacket(kupack, ThrottleOutPacketType.Task);
311 322
323
324 }
312 public void Stop() 325 public void Stop()
313 { 326 {
314 clientPingTimer.Stop(); 327 clientPingTimer.Stop();
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();
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index b8800a8..550b232 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -76,6 +76,7 @@ namespace SimpleApp
76 public event Action<IClientAPI> OnRequestAvatarsData; 76 public event Action<IClientAPI> OnRequestAvatarsData;
77 public event AddNewPrim OnAddPrim; 77 public event AddNewPrim OnAddPrim;
78 public event RequestGodlikePowers OnRequestGodlikePowers; 78 public event RequestGodlikePowers OnRequestGodlikePowers;
79 public event GodKickUser OnGodKickUser;
79 public event ObjectDuplicate OnObjectDuplicate; 80 public event ObjectDuplicate OnObjectDuplicate;
80 public event UpdateVector OnGrabObject; 81 public event UpdateVector OnGrabObject;
81 public event ObjectSelect OnDeGrabObject; 82 public event ObjectSelect OnDeGrabObject;
@@ -181,6 +182,10 @@ namespace SimpleApp
181 { 182 {
182 } 183 }
183 184
185 public virtual void Kick(string message)
186 {
187 }
188
184 public virtual void SendStartPingCheck(byte seq) 189 public virtual void SendStartPingCheck(byte seq)
185 { 190 {
186 } 191 }