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); }
public Client AcceptClient() { _listener.Start(); var c = new Client(_listener.AcceptTcpClient()); _listener.Stop(); return c; }
public PlayState(Client client, string currentName, ref Stack<GameState> gameStates, bool begin = false) { Parser.RegisterPackets(ManageNetworkEvents); _client = client; _currentName = currentName; _myTurn = begin; _gameStates = gameStates; }