Fixed Simian agent object not being removed immediately on logout
git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@2193 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -91,8 +91,6 @@ namespace Simian.Extensions
|
||||
kill.ObjectData[0].ID = agent.Avatar.LocalID;
|
||||
|
||||
server.UDP.BroadcastPacket(kill, PacketCategory.State);
|
||||
|
||||
server.Agents.Remove(agent.AgentID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -280,6 +280,17 @@ namespace Simian.Extensions
|
||||
update.ObjectData[i] = SimulationObject.BuildUpdateBlock(linkSet[i].Prim, String.Empty, Server.RegionHandle,
|
||||
linkSet[i].Prim.PrimData.State, linkSet[i].Prim.Flags);
|
||||
|
||||
if (linkSet[i].Prim.ParentID > 0)
|
||||
{
|
||||
SimulationObject parent;
|
||||
if (SceneObjects.TryGetValue(linkSet[i].Prim.ParentID, out parent))
|
||||
{
|
||||
//re-add old root orientation
|
||||
linkSet[i].Prim.Position += parent.Prim.Position;
|
||||
linkSet[i].Prim.Rotation *= parent.Prim.Rotation;
|
||||
}
|
||||
}
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
//subtract root prim orientation
|
||||
|
||||
@@ -145,7 +145,11 @@ namespace Simian
|
||||
{
|
||||
UDPClient client;
|
||||
if (clients.TryGetValue(agent.AgentID, out client))
|
||||
{
|
||||
client.Shutdown();
|
||||
lock (server.Agents) server.Agents.Remove(agent.AgentID);
|
||||
return clients.Remove(agent.AgentID, client.Address);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
@@ -372,9 +376,7 @@ namespace Simian
|
||||
if (Environment.TickCount - client.Agent.TickLastPacketReceived > 10000)
|
||||
{
|
||||
Logger.Log(String.Format("Ack timeout for {0}, disconnecting", client.Agent.Avatar.Name), Helpers.LogLevel.Warning);
|
||||
UUID remove = client.Agent.AgentID;
|
||||
client.Shutdown();
|
||||
lock (server.Agents) server.Agents.Remove(remove);
|
||||
server.UDP.RemoveClient(client.Agent);
|
||||
|
||||
//HACK: Notify everyone when someone is disconnected
|
||||
OfflineNotificationPacket offline = new OfflineNotificationPacket();
|
||||
|
||||
Reference in New Issue
Block a user