Example #1
0
        private void AbortGame(object sender, ResponseEventArgs e)
        {
            AbortGameResponse response = e.Response as AbortGameResponse;

            if (response != null)
            {
                if (response.IsSuccess)
                {
                    _stateGame = StateGame.Finished;
                    ShowGameResult(ClientManager.Instance.PlayerNickname, "Противник покинул игру");
                }
                else
                {
                    MessageBox.Show(response.Error);
                }
            }
            ClientManager.Instance.Callback.RemoveHandler <AbortGameResponse>();
        }
Example #2
0
 public void AbortGame(AbortGameResponse response)
 {
     syncContext.Post(new SendOrPostCallback(OnBroadcast <AbortGameResponse>), response);
 }