From ecd85fea012129e4c9eac3dad10937f42c709cc6 Mon Sep 17 00:00:00 2001 From: MW Date: Thu, 8 Mar 2007 18:22:20 +0000 Subject: [PATCH] When a user logs off , the server now tells the other clients to kill that avatar. (So no more half dead avatars messing up the landscape.) --- src/OpenSimClient.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/OpenSimClient.cs b/src/OpenSimClient.cs index eb190e9992..50d8c78ec9 100644 --- a/src/OpenSimClient.cs +++ b/src/OpenSimClient.cs @@ -178,6 +178,14 @@ namespace OpenSim break; case PacketType.LogoutRequest: ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got a logout request"); + //tell all clients to kill our object + KillObjectPacket kill = new KillObjectPacket(); + kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; + kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); + kill.ObjectData[0].ID = this.ClientAvatar.localid; + foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) { + client.OutPacket(kill); + } OpenSim_Main.gridServers.GridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode); lock(OpenSim_Main.local_world.Entities) { OpenSim_Main.local_world.Entities.Remove(this.AgentID);