Пример #1
0
        /// <summary>
        /// Called when a challenge is reloaded.
        /// </summary>
        /// <param name="ws">The websocket.</param>
        /// <param name="message">The message.</param>
        private void OnChallengeReload(WebSocketBase ws, MReload message)
        {
            if (_disposing)
            {
                return;
            }

            if (challengeCon != null && challengeCon.IsConnected())
            {
                //Disconnect challenge socket
                log.ConditionalDebug("Disconnecting challenge socket.");
                challengeCon.DisconnectAsync().Wait();
            }

            if (challengeLocation != null)
            {
                Task <Round> roundTask = GetRound(challengeLocation);
                roundTask.Wait();

                Round round = roundTask.Result;
                if (round != null)
                {
                    if (gameCons.TryGetValue(round.Game.Url.Socket, out LilaGame gameCon))
                    {
                        return;
                    }

                    JoinGame(round.Game);
                }
            }
        }
Пример #2
0
 /// <summary>
 /// Called when the game needs to be reloaded.
 /// </summary>
 /// <param name="ws">The websocket.</param>
 /// <param name="message">The message.</param>
 private void OnReload(WebSocketBase ws, MReload message)
 {
     if (ProcessGameMessage(message))
     {
         if (message.Data?.Type == "rematchOffer")
         {
             AcceptRematch();
         }
     }
 }
Пример #3
0
 /// <summary>
 /// Called when the game needs to be reloaded.
 /// </summary>
 /// <param name="ws">The websocket.</param>
 /// <param name="message">The message.</param>
 private void OnReload(WebSocketBase ws, MReload message)
 {
     ProcessGameMessage(message);
 }