/// <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)); }
/// <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"); }