Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Device"/> class.
 /// </summary>
 /// <param name="Token">The token.</param>
 public Device(NetworkToken Token)
 {
     this.NetworkManager = new NetworkManager(this);
     this.GameListener   = new ServerGameListener(this);
     this.Token          = Token;
     this.Token.SetDevice(this);
 }
        public void OnNetworkToken(NetworkToken token)
        {
            _log.Output($"Recieved network token: {token.Token}");

            _state.NetworkToken = token.Token;

            // send client state back to server
            _connection.NetworkId = token.Token;
            _connection.Send(new ClientInformation(_state));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Device"/> class.
        /// </summary>
        /// <param name="Token">The token.</param>
        public Device(NetworkToken Token)
        {
            this.NetworkManager = new NetworkManager(this);
            this.Token          = Token;
            this.Token.SetDevice(this);

            Device Server = new Device();

            this.GameListener   = new ServerGameListener(Server);
            Server.GameListener = new ClientGameListener(this);

            Server.Connect("game.clashroyaleapp.com");
        }