コード例 #1
0
        private void PopupUser(string userName, CommunicationMessage.ActionType msgAction, bool msgIsSucceed)
        {
            if (userName.Equals(_logic.user.username))
            {
                string msg = "";
                switch (msgAction)
                {
                case CommunicationMessage.ActionType.Bet:
                    msg = "Bet ";
                    break;

                case CommunicationMessage.ActionType.Fold:
                    msg = "Fold ";
                    break;

                case CommunicationMessage.ActionType.Leave:
                    msg = "Leave ";
                    break;

                case CommunicationMessage.ActionType.StartGame:
                    msg = "Start Game ";
                    break;
                }
                if (msgIsSucceed && !String.IsNullOrEmpty(msg))
                {
                    MessageBox.Show(msg + "succeeded!");
                    return;
                }
                if (!String.IsNullOrEmpty(msg))
                {
                    MessageBox.Show(msg + "failed!");
                }
            }
        }
コード例 #2
0
ファイル: GameServiceHandler.cs プロジェクト: shoferb/OYAOB
        public IEnumerator <ActionResultInfo> DoAction(int userId, CommunicationMessage.ActionType action,
                                                       int amount, int roomId)
        {
            IUser user = _systemControl.GetUserWithId(userId);

            return(_gameCenter.DoAction(user, action, amount, roomId));
        }
コード例 #3
0
ファイル: ClientLogic.cs プロジェクト: shoferb/OYAOB
        public bool SendChatMsg(int _roomId, string _ReciverUsername, string _msgToSend,
                                CommunicationMessage.ActionType _chatType)
        {
            ChatCommMessage toSend = new ChatCommMessage(user.id, _roomId, _sessionId, _ReciverUsername, _msgToSend,
                                                         _chatType);
            Tuple <CommunicationMessage, bool, bool, ResponeCommMessage> messageToList =
                new Tuple <CommunicationMessage, bool, bool, ResponeCommMessage>(toSend, false, false,
                                                                                 new ResponeCommMessage(user.id));

            _eventHandler.SendNewEvent(toSend);
            return(true);
        }
コード例 #4
0
ファイル: ClientLogic.cs プロジェクト: shoferb/OYAOB
 public void NotifyChosenMove(CommunicationMessage.ActionType move, int amount, int roomId)
 {
     if (move.Equals(CommunicationMessage.ActionType.Fold))
     {
         ActionCommMessage response = new ActionCommMessage(user.id, _sessionId, move, amount, roomId);
         _eventHandler.SendNewEvent(response);
     }
     if ((move.Equals(CommunicationMessage.ActionType.Bet)) && (amount >= 0))
     {
         ActionCommMessage response = new ActionCommMessage(user.id, _sessionId, move, amount, roomId);
         _eventHandler.SendNewEvent(response);
     }
 }
コード例 #5
0
ファイル: GameCenter.cs プロジェクト: shoferb/OYAOB
        public IEnumerator <ActionResultInfo> DoAction(IUser user, CommunicationMessage.ActionType action, int amount, int roomId)
        {
            IGame gm = GetRoomById(roomId);

            IEnumerator <ActionResultInfo> toRet = gm.DoAction(user, action, amount, true);

            proxyDB.UpdateGameRoom((GameRoom)gm);
            proxyDB.UpdateGameRoomPotSize(gm.GetPotSize(), gm.Id);
            //if(action == CommunicationMessage.ActionType.StartGame && gm.IsGameActive())
            //{
            //    foreach (Player p in gm.GetPlayersInRoom())
            //    {
            //        p.user.AddRoomToActiveGameList(gm);
            //    }
            //}

            return(toRet);
        }
コード例 #6
0
ファイル: GameBridge.cs プロジェクト: shoferb/OYAOB
 public bool DoAction(int userId, CommunicationMessage.ActionType action, int amount, int roomId)
 {
     return(ActionSuccedded(_gameService.DoAction(userId, action, amount, roomId)));
 }