Пример #1
0
 public static void Parse(Client client, Packet packet)
 {
     if(Packets.ContainsKey(packet.Header.OpCode))
         Packets[packet.Header.OpCode].Unpack(client, packet);
     else
         throw new Exception("Packet inconnu: " + packet.Header.OpCode);
 }
Пример #2
0
 public Client AcceptClient()
 {
     _listener.Start();
     var c =  new Client(_listener.AcceptTcpClient());
     _listener.Stop();
     return c;
 }
Пример #3
0
 public PlayState(Client client, string currentName, ref Stack<GameState> gameStates, bool begin = false)
 {
     Parser.RegisterPackets(ManageNetworkEvents);
     _client = client;
     _currentName = currentName;
     _myTurn = begin;
     _gameStates = gameStates;
 }