コード例 #1
0
ファイル: Client.cs プロジェクト: Farkie/c-raft
 /// <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);
 }
コード例 #2
0
ファイル: PacketHandlers.cs プロジェクト: IdentErr/c-raft
 public static void Register(PacketType packetID, int length, int minimumLength, OnPacketReceive onReceive)
 {
     m_Handlers[(byte)packetID] = new PacketHandler(packetID, length, minimumLength, onReceive);
 }
コード例 #3
0
 public static void Register(PacketType packetID, int length, int minimumLength, OnPacketReceive onReceive)
 {
     m_Handlers[(byte)packetID] = new PacketHandler(packetID, length, minimumLength, onReceive);
 }