use of com.code.server.game.poker.robot.ResponseRobotVo in project summer by foxsugar.
the class TTZRobot method bet.
@Override
public void bet(GameTuiTongZi game) {
String roomId = game.getRoom().getRoomId();
int partition = SpringUtil.getBean(ServerConfig.class).getServerId();
KafkaMsgKey msgKey = new KafkaMsgKey();
msgKey.setRoomId(roomId);
msgKey.setPartition(partition);
Map<String, Object> put = new HashMap();
put.put("zhu", 1);
for (PlayerTuiTongZi p : game.getPlayerCardInfos().values()) {
if (p.getUserId() != game.room.getBankerId() && p.getBet() == null) {
msgKey.setUserId(p.getUserId());
put.put("userId", p.getUserId());
}
}
ResponseRobotVo result = new ResponseRobotVo("gameService", "bet", put);
SpringUtil.getBean(MsgProducer.class).send2Partition("gameService", partition, msgKey, result);
}
use of com.code.server.game.poker.robot.ResponseRobotVo in project summer by foxsugar.
the class CowRobot method raise.
@Override
public void raise(GameCow game) {
String roomId = game.getRoom().getRoomId();
int partition = SpringUtil.getBean(ServerConfig.class).getServerId();
KafkaMsgKey msgKey = new KafkaMsgKey();
msgKey.setRoomId(roomId);
msgKey.setPartition(partition);
Map<String, Object> put = new HashMap();
put.put("addChip", 1);
for (PlayerCow p : game.getPlayerCardInfos().values()) {
if (p.userId != game.room.getBankerId() && 0 == p.getRaise()) {
msgKey.setUserId(p.getUserId());
put.put("userId", p.getUserId());
}
}
ResponseRobotVo result = new ResponseRobotVo("gameService", "raise", put);
SpringUtil.getBean(MsgProducer.class).send2Partition("gameService", partition, msgKey, result);
}
use of com.code.server.game.poker.robot.ResponseRobotVo in project summer by foxsugar.
the class CowRobot method getReady.
@Override
public void getReady(RoomCow roomCow) {
String roomId = roomCow.getRoomId();
int partition = SpringUtil.getBean(ServerConfig.class).getServerId();
KafkaMsgKey msgKey = new KafkaMsgKey();
msgKey.setRoomId(roomId);
msgKey.setPartition(partition);
for (Long l : roomCow.getUserStatus().keySet()) {
if (0 == roomCow.getUserStatus().get(l)) {
msgKey.setUserId(l);
}
}
Map<String, Object> put = new HashMap();
ResponseRobotVo result = new ResponseRobotVo("roomService", "getReady", put);
SpringUtil.getBean(MsgProducer.class).send2Partition("roomService", partition, msgKey, result);
}
use of com.code.server.game.poker.robot.ResponseRobotVo in project summer by foxsugar.
the class CowRobot method compare.
@Override
public void compare(GameCow game) {
String roomId = game.getRoom().getRoomId();
int partition = SpringUtil.getBean(ServerConfig.class).getServerId();
KafkaMsgKey msgKey = new KafkaMsgKey();
msgKey.setRoomId(roomId);
msgKey.setPartition(partition);
Map<String, Object> put = new HashMap();
for (PlayerCow p : game.getPlayerCardInfos().values()) {
if (0 == p.getKill()) {
msgKey.setUserId(p.getUserId());
put.put("userId", p.getUserId());
}
}
ResponseRobotVo result = new ResponseRobotVo("gameService", "compare", put);
SpringUtil.getBean(MsgProducer.class).send2Partition("gameService", partition, msgKey, result);
}
use of com.code.server.game.poker.robot.ResponseRobotVo in project summer by foxsugar.
the class DouDiZhuGoldRobot method pass.
@Override
public void pass(GameDouDiZhu game) {
String roomId = game.getRoom().getRoomId();
int partition = SpringUtil.getBean(ServerConfig.class).getServerId();
KafkaMsgKey msgKey = new KafkaMsgKey();
msgKey.setUserId(game.getPlayTurn());
msgKey.setRoomId(roomId);
msgKey.setPartition(partition);
// 按service的名字 分topic
// {"service":"gameService","method":"pass","params":{"userId":"8"}}
Map<String, Object> put = new HashMap<>();
put.put("userId", game.getPlayTurn());
ResponseRobotVo result = new ResponseRobotVo("gameService", "pass", put);
SpringUtil.getBean(MsgProducer.class).send2Partition("gameService", partition, msgKey, result);
}
Aggregations