示例#1
0
        private void GameResultNotify(int winner)
        {
            NotifyGameResultModel notify = new NotifyGameResultModel();

            notify.GameIdentifier = Information.Identifier;
            notify.Text           = "You lose in Game !";
            notify.Money          = 0;
            notify.Win            = false;



            for (int i = 0; i < Information.PlayersNum; i++)
            {
                if (i == winner)
                {
                    continue;
                }
                string id = Information.Players[i].Id;


                _notificationHub.Clients.User(id).SendAsync("Notify", notify);
                _historyService.AddNote(notify, id);
            }

            notify.Money = FullCash();
            notify.Win   = true;
            notify.Text  = "You won Game !";
            string wid = Information.Players[winner].Id;

            _notificationHub.Clients.User(wid).SendAsync("Notify", notify);

            _historyService.AddNote(notify, wid);
        }