server 牌型类型bug fixed

This commit is contained in:
nico committed 2018-11-12 09:20:00 +08:00
1 parent 5a1c54dd75
commit cf16e26bf8
2 files changed
+26 -18

No files matched your search

@@ -24,12 +24,13 @@ public class ClientEventListener_CODE_SHOW_ROOMS extends ClientEventListener{
for(Map<String, Object> room: roomList) {
SimplePrinter.printNotice("#\t" + room.get("roomId") + "\t|\t" + room.get("roomOwner") + "\t|\t" + room.get("roomClientCount") + "\t#");
}
SimplePrinter.printNotice("");
get(ClientEventCode.CODE_SHOW_OPTIONS).call(channel, data);
}else {
SimplePrinter.printNotice("No available room, please create a room !");
get(ClientEventCode.CODE_SHOW_OPTIONS).call(channel, data);
}
SimplePrinter.printNotice("");
}
@@ -31,25 +31,32 @@ public class ServerEventListener_CODE_GAME_POKER_PLAY implements ServerEventList
List<Poker> currentPokers = PokerHelper.getPoker(indexes, clientSide.getPokers());
PokerSell currentPokerShell = PokerHelper.checkPokerType(currentPokers);
if(room.getLastSellClient() != clientSide.getId() && room.getLastPokerShell() != null){
PokerSell lastPokerShell = room.getLastPokerShell();
if(lastPokerShell.getSellType() != currentPokerShell.getSellType() && currentPokerShell.getSellType() != SellType.BOMB && currentPokerShell.getSellType() != SellType.KING_BOMB) {
String result = MapHelper.newInstance()
.put("playType", currentPokerShell.getSellType())
.put("preType", lastPokerShell.getSellType())
.json();
sellFlag = false;
ChannelUtils.pushToClient(clientSide.getChannel(), ClientEventCode.CODE_GAME_POKER_PLAY_MISMATCH, result);
}else if(lastPokerShell.getScore() >= currentPokerShell.getScore()) {
String result = MapHelper.newInstance()
.put("playScore", currentPokerShell.getScore())
.put("preScore", lastPokerShell.getScore())
.json();
sellFlag = false;
ChannelUtils.pushToClient(clientSide.getChannel(), ClientEventCode.CODE_GAME_POKER_PLAY_LESS, result);
if(currentPokerShell.getSellType() != SellType.ILLEGAL) {
if(room.getLastSellClient() != clientSide.getId() && room.getLastPokerShell() != null){
PokerSell lastPokerShell = room.getLastPokerShell();
if(lastPokerShell.getSellType() != currentPokerShell.getSellType() && currentPokerShell.getSellType() != SellType.BOMB && currentPokerShell.getSellType() != SellType.KING_BOMB) {
String result = MapHelper.newInstance()
.put("playType", currentPokerShell.getSellType())
.put("preType", lastPokerShell.getSellType())
.json();
sellFlag = false;
ChannelUtils.pushToClient(clientSide.getChannel(), ClientEventCode.CODE_GAME_POKER_PLAY_MISMATCH, result);
}else if(lastPokerShell.getScore() >= currentPokerShell.getScore()) {
String result = MapHelper.newInstance()
.put("playScore", currentPokerShell.getScore())
.put("preScore", lastPokerShell.getScore())
.json();
sellFlag = false;
ChannelUtils.pushToClient(clientSide.getChannel(), ClientEventCode.CODE_GAME_POKER_PLAY_LESS, result);
}
}
}else {
sellFlag = false;
ChannelUtils.pushToClient(clientSide.getChannel(), ClientEventCode.CODE_GAME_POKER_PLAY_INVALID, null);
}
if(sellFlag) {
ClientSide next = clientSide.getNext();