mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
* Yet some more connectivity restructuring
* We now have CloseAllAgents( circuit ) and CloseAllCircuits( agentId ) for great justice ( but alas, still only closing on one single scene - be brave! ) * Login and ConnectionClosed now eventified and moveified awayified * Killed off unused NullClientAPI * Now the client is almost only responsible for its own closing. ( I will get that scene out of there ) * Lookin' good!
This commit is contained in:
@@ -33,14 +33,15 @@ using OpenSim.Framework;
|
||||
using OpenSim.Framework.Types;
|
||||
using OpenSim.Framework.Interfaces;
|
||||
using OpenSim.Framework.Communications.Caches;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Region.ClientStack
|
||||
{
|
||||
public class PacketServer
|
||||
{
|
||||
private ClientStackNetworkHandler _networkHandler;
|
||||
private ClientStackNetworkHandler m_networkHandler;
|
||||
private IScene _localScene;
|
||||
private ClientManager m_clientManager = new ClientManager();
|
||||
private readonly ClientManager m_clientManager = new ClientManager();
|
||||
public ClientManager ClientManager
|
||||
{
|
||||
get { return m_clientManager; }
|
||||
@@ -48,8 +49,8 @@ namespace OpenSim.Region.ClientStack
|
||||
|
||||
public PacketServer(ClientStackNetworkHandler networkHandler)
|
||||
{
|
||||
_networkHandler = networkHandler;
|
||||
_networkHandler.RegisterPacketServer(this);
|
||||
m_networkHandler = networkHandler;
|
||||
m_networkHandler.RegisterPacketServer(this);
|
||||
}
|
||||
|
||||
public IScene LocalScene
|
||||
@@ -70,11 +71,6 @@ namespace OpenSim.Region.ClientStack
|
||||
m_clientManager.InPacket(circuitCode, packet);
|
||||
}
|
||||
|
||||
public virtual void ConnectionClosed(uint circuitCode)
|
||||
{
|
||||
m_clientManager.ConnectionClosed(circuitCode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -145,10 +141,24 @@ namespace OpenSim.Region.ClientStack
|
||||
this.m_clientManager.Add(useCircuit.CircuitCode.Code, newuser);
|
||||
|
||||
newuser.OnViewerEffect += m_clientManager.ViewerEffectHandler;
|
||||
newuser.OnLogout += LogoutHandler;
|
||||
newuser.OnConnectionClosed += CloseClient;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void LogoutHandler(IClientAPI client)
|
||||
{
|
||||
LogoutReplyPacket logReply = new LogoutReplyPacket();
|
||||
logReply.AgentData.AgentID = client.AgentId;
|
||||
logReply.AgentData.SessionID = client.SessionId;
|
||||
logReply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1];
|
||||
logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock();
|
||||
logReply.InventoryData[0].ItemID = LLUUID.Zero;
|
||||
client.OutPacket(logReply);
|
||||
|
||||
CloseClient( client );
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -160,17 +170,22 @@ namespace OpenSim.Region.ClientStack
|
||||
/// <param name="circuitcode"></param>
|
||||
public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode)
|
||||
{
|
||||
this._networkHandler.SendPacketTo(buffer, size, flags, circuitcode);
|
||||
this.m_networkHandler.SendPacketTo(buffer, size, flags, circuitcode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="circuitcode"></param>
|
||||
public virtual void RemoveClientCircuit(uint circuitcode)
|
||||
public virtual void CloseCircuit(uint circuitcode)
|
||||
{
|
||||
this._networkHandler.RemoveClientCircuit(circuitcode);
|
||||
this.m_clientManager.Remove(circuitcode);
|
||||
m_networkHandler.RemoveClientCircuit( circuitcode );
|
||||
m_clientManager.CloseAllAgents( circuitcode );
|
||||
}
|
||||
|
||||
public virtual void CloseClient( IClientAPI client )
|
||||
{
|
||||
CloseCircuit( client.CircuitCode );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user