Inheritance: BinaryClient
Exemple #1
0
 public Player(Game game, YGOClient client)
 {
     Game = game;
     Type = (int)PlayerType.Undefined;
     State = PlayerState.None;
     _client = client;
 }
Exemple #2
0
        public void AddClient(YGOClient client)
        {
            _clients.Add(client);
            Player player = new Player(Game, client);

            client.PacketReceived += packet => player.Parse(packet);
            client.Disconnected += packet => player.OnDisconnected();
        }
Exemple #3
0
        public void Start()
        {
            Connection = new YGOClient();
            _behavior = new GameBehavior(this);

            Connection.Connected += OnConnected;
            Connection.PacketReceived += OnPacketReceived;

            Connection.Connect(IPAddress.Parse(_serverHost), _serverPort);
        }