* Unregister event handlers in LLUDPServer when a client logs out and disconnects

* Move ViewerEffect handling to Scene.PacketHandlers
* Removing the unused CloseAllAgents function
* Trimming ClientManager down. This class needs to be reworked to keep LLUDP circuit codes from intruding into the abstract OpenSim core code
This commit is contained in:
John Hurliman
2009-10-13 12:50:59 -07:00
parent f55b282078
commit c893761319
8 changed files with 267 additions and 415 deletions

View File

@@ -419,7 +419,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
int dataLength = buffer.DataLength;
// Keep appending ACKs until there is no room left in the packet or there are
// Keep appending ACKs until there is no room left in the buffer or there are
// no more ACKs to append
uint ackCount = 0;
uint ack;
@@ -654,11 +654,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// Create the LLClientView
LLClientView clientApi = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
clientApi.OnViewerEffect += m_scene.ClientManager.ViewerEffectHandler;
clientApi.OnLogout += LogoutHandler;
clientApi.OnConnectionClosed +=
delegate(IClientAPI client)
{ if (client is LLClientView) RemoveClient(((LLClientView)client).UDPClient); };
clientApi.OnConnectionClosed += ConnectionClosedHandler;
// Start the IClientAPI
m_scene.ClientManager.Add(circuitCode, clientApi);
@@ -808,7 +805,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private void LogoutHandler(IClientAPI client)
{
client.OnLogout -= LogoutHandler;
client.SendLogoutPacket();
if (client is LLClientView)
RemoveClient(((LLClientView)client).UDPClient);
}
private void ConnectionClosedHandler(IClientAPI client)
{
client.OnConnectionClosed -= ConnectionClosedHandler;
if (client is LLClientView)
RemoveClient(((LLClientView)client).UDPClient);
}