/// <summary> /// Instantiates a new Client object. /// </summary> /// <param name="server">The Server to associate with the entity.</param> /// <param name="sessionId">The entity ID for the client.</param> /// <param name="tcp">The TCP client to be used for communication.</param> internal Client(Server server, int sessionId, TcpClient tcp) : base(server, sessionId) { EnsureServer(server); SessionID = sessionId; Tcp = tcp; PacketHandler = new PacketHandler(Server, tcp); Inventory = null; DisplayName = Username; InitializePosition(); InitializeRecv(); PermHandler = new PermissionHandler(server); }
public static void Register(PacketType packetID, int length, int minimumLength, OnPacketReceive onReceive) { m_Handlers[(byte)packetID] = new PacketHandler(packetID, length, minimumLength, onReceive); }