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!"); } } }
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)); }
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); }
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); } }
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); }
public bool DoAction(int userId, CommunicationMessage.ActionType action, int amount, int roomId) { return(ActionSuccedded(_gameService.DoAction(userId, action, amount, roomId))); }