From d428f0ac35bef44637fd641d2448d3f73c745cf9 Mon Sep 17 00:00:00 2001 From: nico Date: Wed, 14 Nov 2018 17:23:59 +0800 Subject: [PATCH] Squashed commit of the following: commit ba361b5f0b2a943081cae97d0c0f94cd91ee9626 Merge: e8ad4d5 dbfd26b Author: Nico Date: Wed Nov 14 16:44:54 2018 +0800 Merge pull request #9 from abbychau/master Fix english grammatical errors commit dbfd26b91e2a9beba3621c01bd706474a910412b Author: Abby Date: Wed Nov 14 17:24:19 2018 +0900 add space commit 1ea32fe93de71c2a628763d76872280581695318 Author: Abby Date: Wed Nov 14 17:16:18 2018 +0900 fix words and formats commit a5cc4e1a089c86820cb8aefd054e4322b7cd3c15 Author: Abby Date: Wed Nov 14 17:02:15 2018 +0900 fix 's commit 42dcd95b0748707c067f35d103df014b48449335 Author: Abby Date: Wed Nov 14 16:57:54 2018 +0900 Fix english grammatical errors # Conflicts: # landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_SHOW_OPTIONS.java --- README.md | 2 +- .../ClientEventListener_CODE_CLIENT_CONNECT.java | 2 +- .../event/ClientEventListener_CODE_CLIENT_EXIT.java | 2 +- ...lientEventListener_CODE_GAME_LANDLORD_CONFIRM.java | 2 +- .../ClientEventListener_CODE_GAME_LANDLORD_CYCLE.java | 2 +- .../ClientEventListener_CODE_GAME_LANDLORD_ELECT.java | 4 ++-- .../event/ClientEventListener_CODE_GAME_OVER.java | 2 +- .../ClientEventListener_CODE_GAME_POKER_PLAY.java | 4 ++-- ...tEventListener_CODE_GAME_POKER_PLAY_CANT_PASS.java | 2 +- ...entEventListener_CODE_GAME_POKER_PLAY_INVALID.java | 2 +- ...ClientEventListener_CODE_GAME_POKER_PLAY_LESS.java | 2 +- ...ntEventListener_CODE_GAME_POKER_PLAY_MISMATCH.java | 2 +- ...ClientEventListener_CODE_GAME_POKER_PLAY_PASS.java | 2 +- ...ntEventListener_CODE_GAME_POKER_PLAY_REDIRECT.java | 8 +++----- .../event/ClientEventListener_CODE_GAME_STARTING.java | 2 +- .../ClientEventListener_CODE_ROOM_CREATE_SUCCESS.java | 2 +- ...ientEventListener_CODE_ROOM_JOIN_FAIL_BY_FULL.java | 2 +- ...tEventListener_CODE_ROOM_JOIN_FAIL_BY_INEXIST.java | 2 +- .../ClientEventListener_CODE_ROOM_JOIN_SUCCESS.java | 4 ++-- .../event/ClientEventListener_CODE_SHOW_OPTIONS.java | 1 + .../event/ClientEventListener_CODE_SHOW_POKERS.java | 4 ++-- .../org/nico/ratel/landlords/print/SimplePrinter.java | 11 +++++++++++ 22 files changed, 38 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 16b7d32..5f6473d 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you want to choose **Link** ``` You can enter ``7890j`` or ``789tj`` -If you want to choose **The king of Fried** +If you want to choose **The Joker Bomb** ``` ┌──┐──┐ │S |X | diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_CLIENT_CONNECT.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_CLIENT_CONNECT.java index 3530c3b..1d5b533 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_CLIENT_CONNECT.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_CLIENT_CONNECT.java @@ -9,7 +9,7 @@ public class ClientEventListener_CODE_CLIENT_CONNECT extends ClientEventListener @Override public void call(Channel channel, String data) { - SimplePrinter.printNotice("Connection to server successful, welcome to ratel !!"); + SimplePrinter.printNotice("Connection to server is successful. Welcome to ratel!!"); SimpleClient.id = Integer.parseInt(data); } diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_CLIENT_EXIT.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_CLIENT_EXIT.java index afc6391..0a9bcdc 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_CLIENT_EXIT.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_CLIENT_EXIT.java @@ -23,7 +23,7 @@ public class ClientEventListener_CODE_CLIENT_EXIT extends ClientEventListener{ }else { role = String.valueOf(map.get("exitClientNickname")); } - SimplePrinter.printNotice(role + " withdrew from the room, room dissolve!!"); + SimplePrinter.printNotice(role + " withdrew from the room. Room disbanded!!"); get(ClientEventCode.CODE_SHOW_OPTIONS).call(channel, data); } diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_LANDLORD_CONFIRM.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_LANDLORD_CONFIRM.java index b23ceb2..c899885 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_LANDLORD_CONFIRM.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_LANDLORD_CONFIRM.java @@ -21,7 +21,7 @@ public class ClientEventListener_CODE_GAME_LANDLORD_CONFIRM extends ClientEventL String landlordNickname = String.valueOf(map.get("landlordNickname")); - SimplePrinter.printNotice(landlordNickname + " grabbed the landlord and got an extra three poker shots"); + SimplePrinter.printNotice(landlordNickname + " grabbed the landlord and got extra three poker shots"); List additionalPokers = Noson.convert(map.get("additionalPokers"), new NoType>() {}); SimplePrinter.printPokers(additionalPokers); diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_LANDLORD_CYCLE.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_LANDLORD_CYCLE.java index ef65672..c86e28a 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_LANDLORD_CYCLE.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_LANDLORD_CYCLE.java @@ -8,7 +8,7 @@ public class ClientEventListener_CODE_GAME_LANDLORD_CYCLE extends ClientEventLis @Override public void call(Channel channel, String data) { - SimplePrinter.printNotice("No player takes the landowner, resend poker"); + SimplePrinter.printNotice("No player takes the landlord, so redealing cards."); } diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_LANDLORD_ELECT.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_LANDLORD_ELECT.java index 1d94509..561718e 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_LANDLORD_ELECT.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_LANDLORD_ELECT.java @@ -18,7 +18,7 @@ public class ClientEventListener_CODE_GAME_LANDLORD_ELECT extends ClientEventLis int turnClientId = (int) map.get("nextClientId"); if(turnClientId == SimpleClient.id) { - SimplePrinter.printNotice("It's your turn to rob the landlord[Y/N] (enter [EXIT] to exit current room)"); + SimplePrinter.printNotice("It's your turn. Do you want to rob the landlord? [Y/N] (enter [EXIT] to exit current room)"); String line = SimpleWriter.write("Y/N"); if(line.equalsIgnoreCase("EXIT")) { pushToServer(channel, ServerEventCode.CODE_CLIENT_EXIT); @@ -31,7 +31,7 @@ public class ClientEventListener_CODE_GAME_LANDLORD_ELECT extends ClientEventLis call(channel, data); } }else { - SimplePrinter.printNotice("It's turn " + map.get("nextClientNickname") + " to confirm, please wait patiently !"); + SimplePrinter.printNotice("It's " + map.get("nextClientNickname") + "'s turn. Please wait patiently for his/her confirmation !"); } } diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_OVER.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_OVER.java index 7b8553c..ab4cccd 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_OVER.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_OVER.java @@ -13,7 +13,7 @@ public class ClientEventListener_CODE_GAME_OVER extends ClientEventListener{ @Override public void call(Channel channel, String data) { Map map = MapHelper.parser(data); - SimplePrinter.printNotice(map.get("winnerNickname") + " win"); + SimplePrinter.printNotice(map.get("winnerNickname") + " wins"); SimplePrinter.printNotice("Game over"); pushToServer(channel, ServerEventCode.CODE_CLIENT_EXIT); } diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY.java index 19fbe10..df8fa8a 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY.java @@ -21,12 +21,12 @@ public class ClientEventListener_CODE_GAME_POKER_PLAY extends ClientEventListene public void call(Channel channel, String data) { Map map = MapHelper.parser(data); - SimplePrinter.printNotice("It's your turn to play, your pokers are as follows"); + SimplePrinter.printNotice("It's your turn to play, your pokers are as follows: "); List pokers = Noson.convert(map.get("pokers"), new NoType>() {}); SimplePrinter.printPokers(pokers); - SimplePrinter.printNotice("Please enter the card you came up (enter [EXIT] to exit current room, enter [PASS] jump current round)"); + SimplePrinter.printNotice("Please enter the card you came up with (enter [EXIT] to exit current room, enter [PASS] to jump current round)"); String line = SimpleWriter.write("card"); if(line == null){ diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_CANT_PASS.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_CANT_PASS.java index 3cdffdb..032b197 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_CANT_PASS.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_CANT_PASS.java @@ -9,7 +9,7 @@ public class ClientEventListener_CODE_GAME_POKER_PLAY_CANT_PASS extends ClientEv @Override public void call(Channel channel, String data) { - SimplePrinter.printNotice("The last time you play the card, you can't pass"); + SimplePrinter.printNotice("You played the previous card, so you can't pass."); pushToServer(channel, ServerEventCode.CODE_GAME_POKER_PLAY_REDIRECT); } diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_INVALID.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_INVALID.java index e394961..8b29228 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_INVALID.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_INVALID.java @@ -10,7 +10,7 @@ public class ClientEventListener_CODE_GAME_POKER_PLAY_INVALID extends ClientEven @Override public void call(Channel channel, String data) { - SimplePrinter.printNotice("Out pokers format is invalid"); + SimplePrinter.printNotice("Out pokers' format is invalid"); pushToServer(channel, ServerEventCode.CODE_GAME_POKER_PLAY_REDIRECT); } diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_LESS.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_LESS.java index 3ca4564..29f3a4c 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_LESS.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_LESS.java @@ -9,7 +9,7 @@ public class ClientEventListener_CODE_GAME_POKER_PLAY_LESS extends ClientEventLi @Override public void call(Channel channel, String data) { - SimplePrinter.printNotice("Your pokers type is less than pre pokers, could not beat !!"); + SimplePrinter.printNotice("Your pokers' type has lower rank than the previous. You could not play this combination !!"); pushToServer(channel, ServerEventCode.CODE_GAME_POKER_PLAY_REDIRECT); } diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_MISMATCH.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_MISMATCH.java index db9d3c9..e307cdc 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_MISMATCH.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_MISMATCH.java @@ -14,7 +14,7 @@ public class ClientEventListener_CODE_GAME_POKER_PLAY_MISMATCH extends ClientEve public void call(Channel channel, String data) { Map map = MapHelper.parser(data); - SimplePrinter.printNotice("Your pokers type is " + map.get("playType") + " (" + map.get("playCount") + ") but pre pokers type is " + map.get("preType") + " (" + map.get("preCount") + "), mismatch !!"); + SimplePrinter.printNotice("Your pokers' type is " + map.get("playType") + " (" + map.get("playCount") + ") but previous pokers' type is " + map.get("preType") + " (" + map.get("preCount") + "), mismatch !!"); pushToServer(channel, ServerEventCode.CODE_GAME_POKER_PLAY_REDIRECT); } diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_PASS.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_PASS.java index 5741896..1226604 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_PASS.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_PASS.java @@ -15,7 +15,7 @@ public class ClientEventListener_CODE_GAME_POKER_PLAY_PASS extends ClientEventLi public void call(Channel channel, String data) { Map map = MapHelper.parser(data); - SimplePrinter.printNotice(map.get("clientNickname") + " dont out, turn next player " + map.get("nextClientNickname") + " out pokers"); + SimplePrinter.printNotice(map.get("clientNickname") + " passed. It is now " + map.get("nextClientNickname") + "'s turn."); int turnClientId = (int) map.get("nextClientId"); if(SimpleClient.id == turnClientId) { diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_REDIRECT.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_REDIRECT.java index 8e77df0..2f9a6e7 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_REDIRECT.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_POKER_PLAY_REDIRECT.java @@ -19,19 +19,17 @@ public class ClientEventListener_CODE_GAME_POKER_PLAY_REDIRECT extends ClientEve int sellClientId = (int) map.get("sellClientId"); - SimplePrinter.printNotice(""); - SimplePrinter.printNotice("Everyone's current situation: "); - SimplePrinter.printNotice(""); + SimplePrinter.printNotice("\nEveryone's number of cards:\n"); List> clientInfos = (List>) map.get("clientInfos"); for(Map clientInfo: clientInfos) { - SimplePrinter.printNotice(clientInfo.get("clientNickname") + "\t[" + clientInfo.get("type") + "] surplus " + clientInfo.get("surplus") + " piece of poker"); + SimplePrinter.printNotice(clientInfo.get("clientNickname") + "\t(" + clientInfo.get("type") + "): \t " + clientInfo.get("surplus") + " cards"); } SimplePrinter.printNotice(""); if(sellClientId == SimpleClient.id) { get(ClientEventCode.CODE_GAME_POKER_PLAY).call(channel, data); }else { - SimplePrinter.printNotice("Next out player is " + map.get("sellClinetNickname") + ", please wait for him to out his poker"); + SimplePrinter.printNotice("Next player is " + map.get("sellClinetNickname") + ". Please wait for him to play his cards."); } } diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_STARTING.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_STARTING.java index 4dc5ad5..8ec9df9 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_STARTING.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_GAME_STARTING.java @@ -24,7 +24,7 @@ public class ClientEventListener_CODE_GAME_STARTING extends ClientEventListener{ List pokers = Noson.convert(map.get("pokers"), new NoType>() {}); SimplePrinter.printNotice(""); - SimplePrinter.printNotice("Your pokers is"); + SimplePrinter.printNotice("Your pokers are"); SimplePrinter.printPokers(pokers); get(ClientEventCode.CODE_GAME_LANDLORD_ELECT).call(channel, data); diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_CREATE_SUCCESS.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_CREATE_SUCCESS.java index 8be85d5..7c4f858 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_CREATE_SUCCESS.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_CREATE_SUCCESS.java @@ -13,7 +13,7 @@ public class ClientEventListener_CODE_ROOM_CREATE_SUCCESS extends ClientEventLis Room room = Noson.convert(data, Room.class); - SimplePrinter.printNotice("You has been create room with id " + room.getId()); + SimplePrinter.printNotice("You have created a room with id " + room.getId()); SimplePrinter.printNotice("Please wait for other players to join !"); } diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_JOIN_FAIL_BY_FULL.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_JOIN_FAIL_BY_FULL.java index 86eb01f..89631d4 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_JOIN_FAIL_BY_FULL.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_JOIN_FAIL_BY_FULL.java @@ -14,7 +14,7 @@ public class ClientEventListener_CODE_ROOM_JOIN_FAIL_BY_FULL extends ClientEvent public void call(Channel channel, String data) { Map dataMap = MapHelper.parser(data); - SimplePrinter.printNotice("Join room fail, room " + dataMap.get("roomId") + " player count is full!"); + SimplePrinter.printNotice("Join room failed. Room " + dataMap.get("roomId") + " player count is full!"); ClientEventListener.get(ClientEventCode.CODE_SHOW_OPTIONS).call(channel, data); } diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_JOIN_FAIL_BY_INEXIST.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_JOIN_FAIL_BY_INEXIST.java index 6408e15..9cd73b9 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_JOIN_FAIL_BY_INEXIST.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_JOIN_FAIL_BY_INEXIST.java @@ -14,7 +14,7 @@ public class ClientEventListener_CODE_ROOM_JOIN_FAIL_BY_INEXIST extends ClientEv public void call(Channel channel, String data) { Map dataMap = MapHelper.parser(data); - SimplePrinter.printNotice("Join room fail, room " + dataMap.get("roomId") + " is inexist!"); + SimplePrinter.printNotice("Join room failed. Room " + dataMap.get("roomId") + " inexists!"); ClientEventListener.get(ClientEventCode.CODE_SHOW_OPTIONS).call(channel, data); } diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_JOIN_SUCCESS.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_JOIN_SUCCESS.java index 3734986..77af1f1 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_JOIN_SUCCESS.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_ROOM_JOIN_SUCCESS.java @@ -16,10 +16,10 @@ public class ClientEventListener_CODE_ROOM_JOIN_SUCCESS extends ClientEventListe int joinClientId = (int) map.get("clientId"); if(SimpleClient.id == joinClientId) { - SimplePrinter.printNotice("You has been join room:" + map.get("roomId") + ", there are " + map.get("roomClientCount") + " player in the room now"); + SimplePrinter.printNotice("You have joined room:" + map.get("roomId") + ". There are " + map.get("roomClientCount") + " players in the room now."); SimplePrinter.printNotice("Please wait for other players to join, start a good game when the room player reaches three !"); }else { - SimplePrinter.printNotice(map.get("clientNickname") + " join room, the current number of rooms is " + map.get("roomClientCount")); + SimplePrinter.printNotice(map.get("clientNickname") + " joined room, the current number of room player is " + map.get("roomClientCount")); } diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_SHOW_OPTIONS.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_SHOW_OPTIONS.java index f13d2b3..0b552bb 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_SHOW_OPTIONS.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_SHOW_OPTIONS.java @@ -18,6 +18,7 @@ public class ClientEventListener_CODE_SHOW_OPTIONS extends ClientEventListener{ SimplePrinter.printNotice("3. Setting"); SimplePrinter.printNotice("Please enter the number of options"); String line = SimpleWriter.write("options"); + while(line == null || OptionsUtils.getOptions(line) == -1) { SimplePrinter.printNotice("Invalid option, please choose again:"); line = SimpleWriter.write("option"); diff --git a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_SHOW_POKERS.java b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_SHOW_POKERS.java index 0a89a46..434d8ec 100644 --- a/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_SHOW_POKERS.java +++ b/landlords-client/src/main/java/org/nico/ratel/landlords/client/event/ClientEventListener_CODE_SHOW_POKERS.java @@ -18,13 +18,13 @@ public class ClientEventListener_CODE_SHOW_POKERS extends ClientEventListener{ Map map = MapHelper.parser(data); - SimplePrinter.printNotice(map.get("clientNickname") + " out of the poker"); + SimplePrinter.printNotice("\n" + map.get("clientNickname") + " played:"); List pokers = Noson.convert(map.get("pokers"), new NoType>() {}); SimplePrinter.printPokers(pokers); if(map.containsKey("sellClinetNickname")) { - SimplePrinter.printNotice("Next out player is " + map.get("sellClinetNickname") + ", please wait for him to out his poker"); + SimplePrinter.printNotice("Next player is " + map.get("sellClinetNickname") + ". Please wait for him to play his pokers."); } } diff --git a/landlords-common/src/main/java/org/nico/ratel/landlords/print/SimplePrinter.java b/landlords-common/src/main/java/org/nico/ratel/landlords/print/SimplePrinter.java index 32a40ff..e8e09b9 100644 --- a/landlords-common/src/main/java/org/nico/ratel/landlords/print/SimplePrinter.java +++ b/landlords-common/src/main/java/org/nico/ratel/landlords/print/SimplePrinter.java @@ -3,6 +3,8 @@ package org.nico.ratel.landlords.print; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; +import java.util.Map; +import java.util.HashMap; import org.nico.ratel.landlords.entity.Poker; import org.nico.ratel.landlords.helper.PokerHelper; @@ -19,6 +21,15 @@ public class SimplePrinter { System.out.println(msg); } + public static void printNotice(String msgKey, String locale) { + //TODO : read locale + Map> map = new HashMap>(); + map.put("english", new HashMap()); + map.get("eng").put("caterpillar", "caterpillar's message!!"); + + System.out.println(map.get(locale).get(msgKey)); + } + public static void serverLog(String msg) { System.out.println(FORMAT.format(new Date()) + "-> " + msg); }