use of com.code.server.constant.response.ResponseVo in project summer by foxsugar.
the class GameCow method raise.
/**
* 加注
* @return
*/
public int raise(long userId, double addChip) throws Exception {
logger.info(userId + " 下注: " + addChip);
Map<String, Object> result = new HashMap<>();
result.put("userId", userId);
result.put("addChip", addChip);
ResponseVo vo = new ResponseVo("gameService", "raiseResponse", result);
MsgSender.sendMsg2Player(vo, users);
MsgSender.sendMsg2Player("gameService", "raise", 0, userId);
PlayerCow playerCardInfo = playerCardInfos.get(userId);
playerCardInfo.setRaise(1);
playerCardInfo.setScore(addChip);
boolean b = true;
for (PlayerCow p : playerCardInfos.values()) {
if (room.getBankerId() != p.userId && 0 == p.getRaise()) {
b = false;
}
}
if (b) {
dealFiveCard();
noticePlayerCompare();
this.step = IGameConstant.STEP_COMPARE;
updateLastOperateTime();
}
return 0;
}
use of com.code.server.constant.response.ResponseVo in project summer by foxsugar.
the class GameCow method compare.
/**
* 开牌
* @return
*/
public int compare(long userId) {
logger.info(userId + " 开牌: ");
Map<String, Object> result = new HashMap<>();
result.put("userId", userId);
ResponseVo vo = new ResponseVo("gameService", "compareResponse", result);
MsgSender.sendMsg2Player(vo, users);
MsgSender.sendMsg2Player("gameService", "compare", 0, userId);
PlayerCow playerCardInfo = playerCardInfos.get(userId);
playerCardInfo.setKill(1);
boolean b = true;
for (PlayerCow p : playerCardInfos.values()) {
if (0 == p.getKill()) {
b = false;
}
}
if (b) {
// 自动结束
this.step = 0;
compute();
sendResult();
genRecord();
room.clearReadyStatus(true);
updateLastOperateTime();
updateRoomLastTime();
sendFinalResult();
}
return 0;
}
use of com.code.server.constant.response.ResponseVo in project summer by foxsugar.
the class GameCow method init.
public void init(List<Long> users) {
// 初始化玩家
for (Long uid : users) {
PlayerCow playerCardInfo = getGameTypePlayerCardInfo();
playerCardInfo.userId = uid;
playerCardInfos.put(uid, playerCardInfo);
}
this.users.addAll(users);
// 通知游戏开始
MsgSender.sendMsg2Player(new ResponseVo("gameService", "gameCowBegin", "ok"), room.users);
// 洗牌
shuffle();
// 发牌
deal();
noticePlayerBet();
this.step = IGameConstant.STEP_RAISE;
updateLastOperateTime();
}
use of com.code.server.constant.response.ResponseVo in project summer by foxsugar.
the class GameDouDiZhuJixian method dizhuAddTableCards.
protected void dizhuAddTableCards() {
// 把底牌加到地主身上
PlayerCardInfoDouDiZhu playerCardInfo = playerCardInfos.get(dizhu);
if (playerCardInfo != null) {
playerCardInfo.cards.addAll(tableCards);
// 给所有人看
MsgSender.sendMsg2Player(new ResponseVo("gameService", "showTableCard", tableCards), dizhu);
}
}
use of com.code.server.constant.response.ResponseVo in project summer by foxsugar.
the class GameDouDiZhuLinFen method dizhuAddTableCards.
/**
* 底牌加到地主身上
*/
protected void dizhuAddTableCards() {
// 把底牌加到地主身上
PlayerCardInfoDouDiZhu playerCardInfo = playerCardInfos.get(dizhu);
if (playerCardInfo != null) {
playerCardInfo.cards.addAll(tableCards);
// 给所有人看
MsgSender.sendMsg2Player(new ResponseVo("gameService", "showTableCard", tableCards), dizhu);
}
}
Aggregations