|
@@ -38,18 +38,18 @@ public final class MsgUtil {
|
|
|
*/
|
|
|
public static Map<String, Object> roomToMessage(Room room, Player player, Player opPlayer) {
|
|
|
Map<String, Object> data = new HashMap<>();
|
|
|
- data.put("RoomId", room.data.roomId);
|
|
|
- data.put("Type", room.data.type);
|
|
|
- data.put("OwnerId", room.data.ownerId);
|
|
|
- data.put("State", room.data.state);
|
|
|
- data.put("Time", room.data.time);
|
|
|
- data.put("CurRound", room.data.curRound);
|
|
|
- data.put("ZhuangPos", room.data.zhuangPos);
|
|
|
- data.put("OpId", opPlayer != null ? opPlayer.getId() : "");
|
|
|
- data.put("OpPos", room.data.opPos);
|
|
|
- data.put("CurDisCardList", room.data.curDisCardList);
|
|
|
+ data.put("roomId", room.data.roomId);
|
|
|
+ data.put("type", room.data.type);
|
|
|
+ data.put("ownerId", room.data.ownerId);
|
|
|
+ data.put("state", room.data.state);
|
|
|
+ data.put("time", room.data.time);
|
|
|
+ data.put("curRound", room.data.curRound);
|
|
|
+ data.put("zhuangPos", room.data.zhuangPos);
|
|
|
+ data.put("opId", opPlayer != null ? opPlayer.getId() : "");
|
|
|
+ data.put("opPos", room.data.opPos);
|
|
|
+ data.put("curDisCardList", room.data.curDisCardList);
|
|
|
data.put("CurDisCardSex", room.data.CurDisCardSex);
|
|
|
- data.put("MyInfo", playerRoomToMessage(room, player, true));
|
|
|
+ data.put("myInfo", playerRoomToMessage(room, player, true));
|
|
|
return data;
|
|
|
}
|
|
|
|
|
@@ -62,21 +62,16 @@ public final class MsgUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static Map<String, Object> playerRoomToMessage(Room room, Player player, boolean flag) {
|
|
|
- Map<String, Object> data = new HashMap<>();
|
|
|
- data.put("Id", player.getId());
|
|
|
- data.put("Name", player.data.name);
|
|
|
- data.put("Sex", player.data.sex);
|
|
|
- data.put("Exp", player.data.exp);
|
|
|
- data.put("Level", player.data.level);
|
|
|
- data.put("Vip", player.data.vip);
|
|
|
- data.put("Diamond", player.data.diamond);
|
|
|
- data.put("Pos", player.data.pos);
|
|
|
- data.put("State", player.data.state);
|
|
|
- data.put("IsAuto", player.data.isAuto);
|
|
|
+ Map<String, Object> data = playerInfoToMessage(player);
|
|
|
+
|
|
|
+ data.put("diamond", player.data.diamond);
|
|
|
+ data.put("pos", player.data.pos);
|
|
|
+ data.put("state", player.data.state);
|
|
|
+ data.put("isAuto", player.data.isAuto);
|
|
|
Map<String, Object> cardInfo = new HashMap<>();
|
|
|
- cardInfo.put("RemainCards", flag? player.data.remainCards : "");
|
|
|
- cardInfo.put("RemainCardsNum", player.data.remainCards.size());
|
|
|
- data.put("CardInfo", cardInfo);
|
|
|
+ cardInfo.put("remainCards", flag? player.data.remainCards : "");
|
|
|
+ cardInfo.put("remainCardsNum", player.data.remainCards.size());
|
|
|
+ data.put("cardInfo", cardInfo);
|
|
|
return data;
|
|
|
}
|
|
|
|