/// <summary> /// Plays a move. /// </summary> /// <param name="move">The move.</param> public void PlayMove(PData <PMove> move) { if (socket != null) { socket.Send(move); } }
/// <summary> /// Sends a ping. /// </summary> public void SendPing() { if (socket != null) { socket.Send(tournamentPing); } }
/// <summary> /// Connects the lobby internally /// </summary> private void ConnectLobbyInternal() { if (_disposing) { return; } Uri host = new Uri("wss://socket.lichess.org"); Uri relative = new Uri(LilaRoutes.LobbySocket, UriKind.Relative); Uri absolute = new Uri(host, relative); UriBuilder lobbyBldr = new UriBuilder(absolute) { Query = string.Format("sri={0}", LobbySri = random.NextSri()) }; //int port = LilaPing.PingServer(9025, 9029, 1); //lobbyBldr.Port = port == -1 ? 9025 : port; if (lobbyCon != null && lobbyCon.Connect(lobbyBldr.Uri)) { Events.FireEventAsync(Events._onConnect, new ConnectEvent(this)); lobbyCon.Send(new PHookIn()); lobbyCon.Send(new PServerLatency(true)); } }