View of /trunk/ModularRex/RexNetwork/RexPacketServer.cs
Parent Directory
|
Revision Log
Revision 11 -
(download)
(annotate)
Wed Nov 26 11:52:02 2008 UTC (4 years, 6 months ago) by afrisby
File size: 2693 byte(s)
Wed Nov 26 11:52:02 2008 UTC (4 years, 6 months ago) by afrisby
File size: 2693 byte(s)
* Adds source code comments, and synchronises a number of files with internal copies.
using System.Net;
using System.Reflection;
using log4net;
using OpenMetaverse.Packets;
using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Region.ClientStack;
using OpenSim.Region.ClientStack.LindenUDP;
namespace ModularRex.RexNetwork
{
/// <summary>
/// Inherits all important functions from LLPacketServer
/// Differences:
/// - Spawns RexClientView instead of LLClientView
/// - May need to connect up some custom handlers
/// for any new rex-only packets if any
/// still exist.
/// </summary>
public class RexPacketServer : LLPacketServer
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public RexPacketServer(ILLClientStackNetworkHandler networkHandler, ClientStackUserSettings userSettings)
: base(networkHandler, userSettings)
{
}
protected override IClientAPI CreateNewCircuit(EndPoint remoteEP,
IScene scene, AssetCache assetCache, LLPacketServer packServer,
AuthenticateResponse sessionInfo, OpenMetaverse.UUID agentId,
OpenMetaverse.UUID sessionId, uint circuitCode, EndPoint proxyEP)
{
return
new RexClientView(remoteEP, scene, assetCache, packServer,
sessionInfo, agentId, sessionId,
circuitCode, proxyEP, new ClientStackUserSettings());
}
public override bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit,
AssetCache assetCache, AuthenticateResponse circuitManager, EndPoint proxyEP)
{
IClientAPI newuser;
if (m_scene.ClientManager.TryGetClient(useCircuit.CircuitCode.Code, out newuser))
{
return false;
}
RexClientView rexuser;
m_log.Debug("[REXCLIENT] Creating RexClient for user");
rexuser = (RexClientView) CreateNewCircuit(epSender, m_scene, assetCache, this, circuitManager,
useCircuit.CircuitCode.ID, useCircuit.CircuitCode.SessionID,
useCircuit.CircuitCode.Code, proxyEP);
m_scene.ClientManager.Add(useCircuit.CircuitCode.Code, rexuser);
rexuser.OnViewerEffect += m_scene.ClientManager.ViewerEffectHandler;
rexuser.OnLogout += LogoutHandler;
rexuser.OnConnectionClosed += CloseClient;
return true;
}
}
}
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

