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.)

adam
MW 2007-03-08 18:22:20 +00:00
parent aa120266d7
commit ecd85fea01
1 changed files with 8 additions and 0 deletions

View File

@ -178,6 +178,14 @@ namespace OpenSim
break; break;
case PacketType.LogoutRequest: case PacketType.LogoutRequest:
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got a logout request"); 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); OpenSim_Main.gridServers.GridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode);
lock(OpenSim_Main.local_world.Entities) { lock(OpenSim_Main.local_world.Entities) {
OpenSim_Main.local_world.Entities.Remove(this.AgentID); OpenSim_Main.local_world.Entities.Remove(this.AgentID);