* Moved OpenMetaverse.StructuredData to a separate library

* Added experimental JSON serialization/deserialization to OSD using LitJSON (works, but subject to change soon)
* Moved packet handling code out of Simian.cs

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2361 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2008-11-18 03:16:38 +00:00
parent 8e84377b22
commit 5fbcd0c4d6
19 changed files with 4080 additions and 28 deletions

View File

@@ -99,6 +99,26 @@ namespace Simian.Extensions
server.UDP.BroadcastPacket(sound, PacketCategory.State);
}
public void Disconnect(Agent agent)
{
// Remove the avatar from the scene
SimulationObject obj;
if (server.Scene.TryGetObject(agent.AgentID, out obj))
server.Scene.ObjectRemove(this, obj);
else
Logger.Log("Disconnecting an agent that is not in the scene", Helpers.LogLevel.Warning);
// Remove the UDP client
server.UDP.RemoveClient(agent);
// HACK: Notify everyone when someone disconnects
OfflineNotificationPacket offline = new OfflineNotificationPacket();
offline.AgentBlock = new OfflineNotificationPacket.AgentBlockBlock[1];
offline.AgentBlock[0] = new OfflineNotificationPacket.AgentBlockBlock();
offline.AgentBlock[0].AgentID = agent.AgentID;
server.UDP.BroadcastPacket(offline, PacketCategory.State);
}
void AgentAnimationHandler(Packet packet, Agent agent)
{
AgentAnimationPacket animPacket = (AgentAnimationPacket)packet;

View File

@@ -84,7 +84,7 @@ namespace Simian.Extensions
server.UDP.SendPacket(agent.AgentID, reply, PacketCategory.Transaction);
server.DisconnectClient(agent);
server.Avatars.Disconnect(agent);
}
}
}

View File

@@ -413,7 +413,7 @@ namespace Simian
Logger.Log(String.Format("Ack timeout for {0}, disconnecting", client.Agent.Avatar.Name),
Helpers.LogLevel.Warning);
server.DisconnectClient(client.Agent);
server.Avatars.Disconnect(client.Agent);
return;
}
}