mirror of
https://github.com/tiennm99/caro.git
synced 2026-10-03 05:19:23 +00:00
server 牌型类型bug fixed
This commit is contained in:
1 parent
5a1c54dd75
commit
cf16e26bf8
2 files changed
+26
-18
No files matched your search
+2
-1
@@ -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("");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
+24
-17
@@ -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();
|
||||
|
||||
|
||||
Reference in new issue
Block a user