Browse Source

1.优化代码;2.增加加入房间接口

johnclot69 4 months ago
parent
commit
6b6aed36dc
53 changed files with 226 additions and 46 deletions
  1. BIN
      .gradle/7.5.1/checksums/checksums.lock
  2. BIN
      .gradle/7.5.1/checksums/md5-checksums.bin
  3. BIN
      .gradle/7.5.1/checksums/sha1-checksums.bin
  4. BIN
      .gradle/7.5.1/executionHistory/executionHistory.bin
  5. BIN
      .gradle/7.5.1/executionHistory/executionHistory.lock
  6. BIN
      .gradle/7.5.1/fileHashes/fileHashes.bin
  7. BIN
      .gradle/7.5.1/fileHashes/fileHashes.lock
  8. BIN
      .gradle/7.5.1/fileHashes/resourceHashesCache.bin
  9. BIN
      .gradle/buildOutputCleanup/buildOutputCleanup.lock
  10. BIN
      .gradle/buildOutputCleanup/outputFiles.bin
  11. BIN
      .gradle/file-system.probe
  12. 6 0
      .idea/vcs.xml
  13. BIN
      incubator-common/build/libs/incubator-common-1.0-SNAPSHOT.jar
  14. BIN
      incubator-common/build/tmp/compileJava/previous-compilation-data.bin
  15. BIN
      incubator-core/build/libs/incubator-core-1.0-SNAPSHOT.jar
  16. BIN
      incubator-core/build/tmp/compileJava/previous-compilation-data.bin
  17. BIN
      incubator-game/build/classes/java/main/com/incubator/game/GGame.class
  18. BIN
      incubator-game/build/classes/java/main/com/incubator/game/data/entity/PlayerInfoPO.class
  19. BIN
      incubator-game/build/classes/java/main/com/incubator/game/handler/CreatRoomHandler.class
  20. BIN
      incubator-game/build/classes/java/main/com/incubator/game/handler/JoinRoomHandler.class
  21. BIN
      incubator-game/build/classes/java/main/com/incubator/game/player/GPlayer.class
  22. BIN
      incubator-game/build/tmp/compileJava/previous-compilation-data.bin
  23. 1 0
      incubator-game/conf/event.xml
  24. 18 16
      incubator-game/src/main/java/com/incubator/game/GGame.java
  25. 3 0
      incubator-game/src/main/java/com/incubator/game/data/entity/PlayerInfoPO.java
  26. 4 4
      incubator-game/src/main/java/com/incubator/game/data/model/RoomPO.java
  27. 17 4
      incubator-game/src/main/java/com/incubator/game/handler/CreatRoomHandler.java
  28. 62 0
      incubator-game/src/main/java/com/incubator/game/handler/JoinRoomHandler.java
  29. 3 3
      incubator-game/src/main/java/com/incubator/game/handler/LoginGameHandler.java
  30. 7 0
      incubator-game/src/main/java/com/incubator/game/player/GPlayer.java
  31. 2 2
      incubator-game/src/main/java/com/incubator/game/player/Player.java
  32. 4 5
      incubator-game/src/main/java/com/incubator/game/room/Room.java
  33. 28 3
      incubator-game/src/main/java/com/incubator/game/service/RoomService.java
  34. 2 2
      incubator-game/src/main/java/com/incubator/game/timer/FlushDB.java
  35. 4 4
      incubator-game/src/main/java/com/incubator/game/util/MsgUtil.java
  36. BIN
      incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$CardInfo$1.class
  37. BIN
      incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$CardInfo$Builder.class
  38. BIN
      incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$CardInfo.class
  39. BIN
      incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$Code$1.class
  40. BIN
      incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$Code.class
  41. BIN
      incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$PlayerInfo$1.class
  42. BIN
      incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$PlayerInfo$Builder.class
  43. BIN
      incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$PlayerInfo.class
  44. BIN
      incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$RoomInfo$1.class
  45. BIN
      incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$RoomInfo$Builder.class
  46. BIN
      incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$RoomInfo.class
  47. BIN
      incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto.class
  48. 3 0
      incubator-message/build/extracted-include-protos/test/CommonProto.proto
  49. 56 3
      incubator-message/build/generated/source/proto/main/java/com/incubator/message/proto/CommonProto.java
  50. BIN
      incubator-message/build/libs/incubator-message-1.0-SNAPSHOT.jar
  51. 3 0
      incubator-message/build/resources/main/CommonProto.proto
  52. BIN
      incubator-message/build/tmp/compileJava/previous-compilation-data.bin
  53. 3 0
      incubator-message/src/main/proto/CommonProto.proto

BIN
.gradle/7.5.1/checksums/checksums.lock


BIN
.gradle/7.5.1/checksums/md5-checksums.bin


BIN
.gradle/7.5.1/checksums/sha1-checksums.bin


BIN
.gradle/7.5.1/executionHistory/executionHistory.bin


BIN
.gradle/7.5.1/executionHistory/executionHistory.lock


BIN
.gradle/7.5.1/fileHashes/fileHashes.bin


BIN
.gradle/7.5.1/fileHashes/fileHashes.lock


BIN
.gradle/7.5.1/fileHashes/resourceHashesCache.bin


BIN
.gradle/buildOutputCleanup/buildOutputCleanup.lock


BIN
.gradle/buildOutputCleanup/outputFiles.bin


BIN
.gradle/file-system.probe


+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+  </component>
+</project>

BIN
incubator-common/build/libs/incubator-common-1.0-SNAPSHOT.jar


BIN
incubator-common/build/tmp/compileJava/previous-compilation-data.bin


BIN
incubator-core/build/libs/incubator-core-1.0-SNAPSHOT.jar


BIN
incubator-core/build/tmp/compileJava/previous-compilation-data.bin


BIN
incubator-game/build/classes/java/main/com/incubator/game/GGame.class


BIN
incubator-game/build/classes/java/main/com/incubator/game/data/entity/PlayerInfoPO.class


BIN
incubator-game/build/classes/java/main/com/incubator/game/handler/CreatRoomHandler.class


BIN
incubator-game/build/classes/java/main/com/incubator/game/handler/JoinRoomHandler.class


BIN
incubator-game/build/classes/java/main/com/incubator/game/player/GPlayer.class


BIN
incubator-game/build/tmp/compileJava/previous-compilation-data.bin


+ 1 - 0
incubator-game/conf/event.xml

@@ -4,6 +4,7 @@
 	<onDate id="100001" handleClass="com.incubator.game.handler.HeartBeatHandler" desc="请求 心跳" />
 	<onDate id="100003" handleClass="com.incubator.game.handler.LoginGameHandler" desc="请求 登录" />
 	<onDate id="100007" handleClass="com.incubator.game.handler.CreatRoomHandler" desc="请求 创建房间" />
+	<onDate id="100009" handleClass="com.incubator.game.handler.JoinRoomHandler" desc="请求 加入房间" />
 
 	<!-- 服务器内部消息 -->
 	<onDate id="6000" handleClass="com.incubator.game.handler.center.GameRegHandler" desc="中控->游戏 注册返回" />

+ 18 - 16
incubator-game/src/main/java/com/incubator/game/GGame.java

@@ -102,9 +102,6 @@ public class GGame extends AbstractService {
     /** http消息事件 **/
     public static Map<String, HttpRequestHandler> httpHandlers = new HashMap<>();
 
-    /** 连接人线 **/
-    public static AtomicInteger onlineConnCount = new AtomicInteger();
-
     /** 本服所有在线玩家 */
     public static Map<String, GPlayer> onlinePlayers = new ConcurrentHashMap<>();
 
@@ -142,17 +139,17 @@ public class GGame extends AbstractService {
 
     @Override
     protected void doStart() throws Throwable {
-        // 初始化Properties配置
+        // 1.初始化Properties配置
         this.initProperties();
-        // 初始化数据库连接池
-        DBFactory.init();
-        // 加载游戏数据
+        // 2.初始化数据库连接池
+//        DBFactory.init();
+        // 3.初始化游戏数据
         this.initGameData();
-        // 开启定时任务
+        // 4.初始化定时任务
         this.initQuartzTask();
-        // 初始化消息事件
+        // 5.初始化消息事件
         this.initHandler();
-        // 初始化网络服务
+        // 6.初始化网络服务
         this.initNetService();
     }
 
@@ -161,8 +158,13 @@ public class GGame extends AbstractService {
         logger.info("服务器维护中, 已关闭服务器!");
     }
 
+    /**
+     * 1.初始化Properties配置
+     *
+     * @throws Exception
+     */
     public void initProperties() throws Exception {
-        logger.info("初始化 Properties ...");
+        logger.info("初始化Properties配置...");
         SERVER_SETTINGS = new PropertiesUtil(env.getConfDir() + "/" + CONFIG_FILE);
         DB_SETTINGS = new PropertiesUtil(env.getConfDir() + "/" + DB_FILE);
         sd = new SensitiveDictionary(Files.newInputStream(Paths.get(env.getConfDir() + "/" + WORDS_FILE)), CharsetUtil.UTF_8);
@@ -182,7 +184,7 @@ public class GGame extends AbstractService {
     }
 
     /**
-     * 加载游戏数据
+     * 3.初始化游戏数据
      */
     public void initGameData() {
         //加载策划配置表
@@ -213,7 +215,7 @@ public class GGame extends AbstractService {
 //    }
 
     /**
-     * 初始化定时器任务
+     * 4.初始化定时器任务
      **/
     private void initQuartzTask() {
         logger.info("初始化定时器任务...");
@@ -227,7 +229,7 @@ public class GGame extends AbstractService {
     }
 
     /**
-     * 初始化消息事件
+     * 5.初始化消息事件
      */
     private void initHandler() {
         logger.info("初始化消息事件...");
@@ -262,7 +264,7 @@ public class GGame extends AbstractService {
     }
 
     /**
-     * 初始化网络服务
+     * 6.初始化网络服务
      **/
     private void initNetService() {
         logger.info("初始化网络服务...");
@@ -276,7 +278,7 @@ public class GGame extends AbstractService {
                 new InitalizerHttpServerHandler(new HttpInnerListener()));
         innerHttpServer.start();
 
-        // 客端开启连接中控服务端
+        // 开启连接中控服务端
 //        NetClient centerClient = new NettyClient(GGame.CENTER_HOST, GGame.CENTER_PORT,
 //                new WebSocketServerBinaryAdapterHandler("/ws", new InitalizerProtocolHandler(new CenterClientListener())));
 //        centerClient.enableReconnect(scheduleExec, TimeUnit.SECONDS.toMillis(5));

+ 3 - 0
incubator-game/src/main/java/com/incubator/game/data/entity/PlayerInfoPO.java

@@ -23,6 +23,9 @@ public class PlayerInfoPO {
 	public int vip;
 	/** 玩家携带钻石 **/
 	public long diamond;
+
+	/** 玩家绑定的房间 **/
+	public int roomId;
 	/** 玩家位置(0东 1南 2西 3北) **/
 	public int pos;
 	/** 玩家状态(0未准备 1已准备 2游戏中 3结束) **/

+ 4 - 4
incubator-game/src/main/java/com/incubator/game/data/model/RoomPO.java

@@ -1,6 +1,6 @@
 package com.incubator.game.data.model;
 
-import com.incubator.game.player.WNPlayer;
+import com.incubator.game.player.Player;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -21,10 +21,10 @@ public class RoomPO {
 	public String ownerId = "";
 	/** 最大人数 **/
 	public int maxNum;
-	/** 玩家id集合 **/
-	public Map<String, WNPlayer> playerIds = new HashMap<>();
+	/** 玩家id集合 [key:玩家id, value:玩家对象]**/
+	public Map<String, Player> playerIds = new HashMap<>();
 	/** 玩家 [key:座位号, value:玩家对象] **/
-	public Map<Integer, WNPlayer> playerMap = new HashMap<>();
+	public Map<Integer, Player> playerMap = new HashMap<>();
 
 	/** 房间状态(0等待 1开局 2进行中 3已结束) **/
 	public int state;

+ 17 - 4
incubator-game/src/main/java/com/incubator/game/handler/CreatRoomHandler.java

@@ -4,7 +4,7 @@ import com.incubator.common.net.Connection;
 import com.incubator.core.net.ws.NetHandler;
 import com.incubator.core.net.ws.WSRequest;
 import com.incubator.core.net.ws.WSResponse;
-import com.incubator.game.player.WNPlayer;
+import com.incubator.game.player.Player;
 import com.incubator.game.room.Room;
 import com.incubator.game.service.RoomService;
 import com.incubator.game.util.MsgUtil;
@@ -22,11 +22,11 @@ public class CreatRoomHandler extends NetHandler {
 	public void onDate(Connection session, WSRequest request, WSResponse response) {
 		response.setCmd(CommonProto.Cmd.CreateRoomRes_VALUE);
 
-		WNPlayer player = (WNPlayer) PlayerUtil.getOnlinePlayer(session.getPlayerId());
+		Player player = (Player) PlayerUtil.getOnlinePlayer(session.getPlayerId());
 		if (player == null) {
 			logger.info("创建房间失败,找不到玩家");
 			response.setCode(CommonProto.Code.SYSTEM_ERR_VALUE);
-			response.setMessage("操作失败...");
+			response.setMessage("操作失败");
 			return;
 		}
 
@@ -35,11 +35,24 @@ public class CreatRoomHandler extends NetHandler {
 		if (type <= 0) {
 			logger.info("参数错误");
 			response.setCode(CommonProto.Code.PARAMETER_ERR_VALUE);
+			response.setMessage("参数错误");
+			return;
+		}
+
+		// 玩家是否存在房间
+		Room room = RoomService.getInstance().getRoomByPlayerId(player.getId());
+		if (room != null) {
+			logger.info("玩家已在房间,不可创建房间");
+			response.setCode(CommonProto.Code.PLAYER_ROOM_EXIST_ERR_VALUE);
+			response.setMessage("操作失败");
 			return;
 		}
 
 		// 创建房间
-		Room room = RoomService.getInstance().creatRoom(player);
+		room = RoomService.getInstance().creatRoom(player);
+
+		// 玩家绑定房间
+		player.data.roomId = room.data.roomId;
 
 		// 正常返回
 		response.setData(MsgUtil.roomToMessage(room, player, null));

+ 62 - 0
incubator-game/src/main/java/com/incubator/game/handler/JoinRoomHandler.java

@@ -0,0 +1,62 @@
+package com.incubator.game.handler;
+
+import com.incubator.common.net.Connection;
+import com.incubator.core.net.ws.NetHandler;
+import com.incubator.core.net.ws.WSRequest;
+import com.incubator.core.net.ws.WSResponse;
+import com.incubator.game.player.Player;
+import com.incubator.game.room.Room;
+import com.incubator.game.service.RoomService;
+import com.incubator.game.util.MsgUtil;
+import com.incubator.game.util.PlayerUtil;
+import com.incubator.message.proto.CommonProto;
+
+/**
+ * 加入房间请求
+ *
+ * @author johnc
+ */
+public class JoinRoomHandler extends NetHandler {
+
+	@Override
+	public void onDate(Connection session, WSRequest request, WSResponse response) {
+		response.setCmd(CommonProto.Cmd.JoinRoomRes_VALUE);
+
+		Player player = (Player) PlayerUtil.getOnlinePlayer(session.getPlayerId());
+		if (player == null) {
+			logger.info("创建房间失败,找不到玩家");
+			response.setCode(CommonProto.Code.SYSTEM_ERR_VALUE);
+			response.setMessage("操作失败...");
+			return;
+		}
+
+		// 判断参数
+		int roomId = Integer.parseInt(request.getData().getOrDefault("RoomId", "").toString());
+		if (roomId <= 0) {
+			logger.info("参数错误");
+			response.setCode(CommonProto.Code.PARAMETER_ERR_VALUE);
+			response.setMessage("参数错误...");
+			return;
+		}
+
+		// 房间是否存在
+		Room room = RoomService.getInstance().getRoom(roomId);
+		if (room == null) {
+			logger.info("房间已解散");
+			response.setCode(CommonProto.Code.ROOM_NOT_EXIST_ERR_VALUE);
+			response.setMessage("操作失败,房间已解散...");
+			return;
+		}
+
+		// 判断玩家绑定房间
+		if (player.data.roomId >= 0 && player.data.roomId != roomId) {
+			logger.info("不可重复加入其他房间");
+			response.setCode(CommonProto.Code.JOIN_ROOM_REPEATEDLY_ERR_VALUE);
+			response.setMessage("操作失败,不可重复加入其他房间...");
+			return;
+		}
+
+		// 加入房间
+		RoomService.getInstance().joinRoom(room, player);
+	}
+}

+ 3 - 3
incubator-game/src/main/java/com/incubator/game/handler/LoginGameHandler.java

@@ -5,7 +5,7 @@ import com.incubator.core.net.ws.NetHandler;
 import com.incubator.core.net.ws.WSRequest;
 import com.incubator.core.net.ws.WSResponse;
 import com.incubator.game.data.entity.PlayerInfoPO;
-import com.incubator.game.player.WNPlayer;
+import com.incubator.game.player.Player;
 import com.incubator.game.room.Room;
 import com.incubator.game.service.RoomService;
 import com.incubator.game.util.MsgUtil;
@@ -39,9 +39,9 @@ public class LoginGameHandler extends NetHandler {
 		// 创建player
 		String player_id = UUID.randomUUID().toString();
 		PlayerInfoPO playerInfoPO = PlayerUtil.createPlayer(player_id);
-		WNPlayer player = new WNPlayer(playerInfoPO);
+		Player player = new Player(playerInfoPO);
 
-		// 加入缓存
+		// 绑定session
 		player.bind(session, 0L, player.getId());
 		logger.info("玩家进入游戏 playerId={}", player.getId());
 

+ 7 - 0
incubator-game/src/main/java/com/incubator/game/player/GPlayer.java

@@ -28,6 +28,13 @@ public abstract class GPlayer extends GPlayerBase {
 	
 	public GPlayer() {}
 
+	/**
+	 * 绑定session
+	 *
+	 * @param session
+	 * @param userid 账号id
+	 * @param playerId 玩家id
+	 */
 	public void bind(Connection session, long userid, String playerId) {
 		synchronized (this) {			
 			this.userId = userid;

+ 2 - 2
incubator-game/src/main/java/com/incubator/game/player/WNPlayer.java → incubator-game/src/main/java/com/incubator/game/player/Player.java

@@ -10,14 +10,14 @@ import java.util.Date;
 /**
  * 玩家实体
  */
-public class WNPlayer extends GPlayer {
+public class Player extends GPlayer {
 
     protected Logger logger = Log4jUtil.getLogger(getClass());
 
     /** 玩家数据 **/
     public PlayerInfoPO data;
 
-    public WNPlayer(PlayerInfoPO playerInfoPO) {
+    public Player(PlayerInfoPO playerInfoPO) {
         try {
             this.data = playerInfoPO;
         } catch (Exception e) {

+ 4 - 5
incubator-game/src/main/java/com/incubator/game/room/Room.java

@@ -2,12 +2,9 @@ package com.incubator.game.room;
 
 import com.incubator.common.log4j.Log4jUtil;
 import com.incubator.game.data.model.RoomPO;
-import com.incubator.game.player.WNPlayer;
+import com.incubator.game.player.Player;
 import org.slf4j.Logger;
 
-import java.util.HashMap;
-import java.util.Map;
-
 /**
  * 房间实体类
  */
@@ -18,7 +15,9 @@ public class Room {
     /** 房间数据 **/
     public RoomPO data;
 
-    public Room() {
+    public Room() {}
 
+    public void add(Player player) {
+        this.data.playerIds
     }
 }

+ 28 - 3
incubator-game/src/main/java/com/incubator/game/service/RoomService.java

@@ -1,7 +1,7 @@
 package com.incubator.game.service;
 
 import com.incubator.common.util.RandomUtil;
-import com.incubator.game.player.WNPlayer;
+import com.incubator.game.player.Player;
 import com.incubator.game.room.Room;
 
 import java.util.*;
@@ -82,9 +82,9 @@ public class RoomService {
      * @param player
      * @return
      */
-    public Room creatRoom(WNPlayer player) {
+    public Room creatRoom(Player player) {
         Room room = new Room();
-        room.data.roomId = this.randomRoomNumber();
+        room.data.roomId = randomRoomNumber();
         room.data.type = 1;
         room.data.ownerId = player.getId();
         room.data.maxNum = 4;
@@ -92,6 +92,31 @@ public class RoomService {
             room.data.playerIds.put(player.getId(), player);
         }
         room.data.playerMap.put(0, player);
+
+        return room;
+    }
+
+    /**
+     * 加入房间
+     *
+     * @param room
+     * @param player
+     * @return
+     */
+    public Room joinRoom(Room room, Player player) {
+        if (!room.data.playerIds.containsKey(player.getId())) {
+            room.data.playerIds.put(player.getId(), player);
+        }
+        int index = 0;
+        for (Player tmpPlayer : room.data.playerIds.values()) {
+            if (tmpPlayer != null) {
+                room.data.playerMap.put(index, player);
+                index++;
+            }
+        }
+
+        // 推送房间所有玩家
+
         return room;
     }
 }

+ 2 - 2
incubator-game/src/main/java/com/incubator/game/timer/FlushDB.java

@@ -2,7 +2,7 @@ package com.incubator.game.timer;
 
 import com.incubator.game.GGame;
 import com.incubator.game.player.GPlayer;
-import com.incubator.game.player.WNPlayer;
+import com.incubator.game.player.Player;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import com.incubator.core.quartz.QuartzTask;
@@ -38,7 +38,7 @@ public class FlushDB extends QuartzTask {
 		//玩家数据
 		for (GPlayer _player : GGame.onlinePlayers.values()) {
 			if (_player != null) {
-				WNPlayer player = (WNPlayer) _player;
+				Player player = (Player) _player;
 				player.sync();
 			}
 		}

+ 4 - 4
incubator-game/src/main/java/com/incubator/game/util/MsgUtil.java

@@ -1,6 +1,6 @@
 package com.incubator.game.util;
 
-import com.incubator.game.player.WNPlayer;
+import com.incubator.game.player.Player;
 import com.incubator.game.room.Room;
 
 import java.util.HashMap;
@@ -17,7 +17,7 @@ public final class MsgUtil {
      * @param player
      * @return
      */
-    public static Map<String, Object> playerInfoToMessage(WNPlayer player) {
+    public static Map<String, Object> playerInfoToMessage(Player player) {
         Map<String, Object> data = new HashMap<>();
         data.put("id", player.getId());
         data.put("name", player.data.name);
@@ -36,7 +36,7 @@ public final class MsgUtil {
      * @param opPlayer 当前操作玩家
      * @return
      */
-    public static Map<String, Object> roomToMessage(Room room, WNPlayer player, WNPlayer opPlayer) {
+    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);
@@ -61,7 +61,7 @@ public final class MsgUtil {
      * @param flag 是否本人
      * @return
      */
-    public static Map<String, Object> playerRoomToMessage(Room room, WNPlayer player, boolean flag) {
+    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);

BIN
incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$CardInfo$1.class


BIN
incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$CardInfo$Builder.class


BIN
incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$CardInfo.class


BIN
incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$Code$1.class


BIN
incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$Code.class


BIN
incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$PlayerInfo$1.class


BIN
incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$PlayerInfo$Builder.class


BIN
incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$PlayerInfo.class


BIN
incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$RoomInfo$1.class


BIN
incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$RoomInfo$Builder.class


BIN
incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto$RoomInfo.class


BIN
incubator-message/build/classes/java/main/com/incubator/message/proto/CommonProto.class


+ 3 - 0
incubator-message/build/extracted-include-protos/test/CommonProto.proto

@@ -90,6 +90,9 @@ enum Code {
     OK = 0;                             //OK
     PARAMETER_ERR = 1;						      //参数错误
     SYSTEM_ERR = 2;                     //系统错误
+    PLAYER_ROOM_EXIST_ERR = 3;          //玩家已在房间
+    ROOM_NOT_EXIST_ERR = 4;             //房间已解散
+    JOIN_ROOM_REPEATEDLY_ERR = 5;       //重复加入其他房间
 }
 
 message CardInfo {

+ 56 - 3
incubator-message/build/generated/source/proto/main/java/com/incubator/message/proto/CommonProto.java

@@ -972,6 +972,30 @@ public final class CommonProto {
      * <code>SYSTEM_ERR = 2;</code>
      */
     SYSTEM_ERR(2),
+    /**
+     * <pre>
+     *玩家已在房间
+     * </pre>
+     *
+     * <code>PLAYER_ROOM_EXIST_ERR = 3;</code>
+     */
+    PLAYER_ROOM_EXIST_ERR(3),
+    /**
+     * <pre>
+     *房间已解散
+     * </pre>
+     *
+     * <code>ROOM_NOT_EXIST_ERR = 4;</code>
+     */
+    ROOM_NOT_EXIST_ERR(4),
+    /**
+     * <pre>
+     *重复加入其他房间
+     * </pre>
+     *
+     * <code>JOIN_ROOM_REPEATEDLY_ERR = 5;</code>
+     */
+    JOIN_ROOM_REPEATEDLY_ERR(5),
     UNRECOGNIZED(-1),
     ;
 
@@ -999,6 +1023,30 @@ public final class CommonProto {
      * <code>SYSTEM_ERR = 2;</code>
      */
     public static final int SYSTEM_ERR_VALUE = 2;
+    /**
+     * <pre>
+     *玩家已在房间
+     * </pre>
+     *
+     * <code>PLAYER_ROOM_EXIST_ERR = 3;</code>
+     */
+    public static final int PLAYER_ROOM_EXIST_ERR_VALUE = 3;
+    /**
+     * <pre>
+     *房间已解散
+     * </pre>
+     *
+     * <code>ROOM_NOT_EXIST_ERR = 4;</code>
+     */
+    public static final int ROOM_NOT_EXIST_ERR_VALUE = 4;
+    /**
+     * <pre>
+     *重复加入其他房间
+     * </pre>
+     *
+     * <code>JOIN_ROOM_REPEATEDLY_ERR = 5;</code>
+     */
+    public static final int JOIN_ROOM_REPEATEDLY_ERR_VALUE = 5;
 
 
     public final int getNumber() {
@@ -1028,6 +1076,9 @@ public final class CommonProto {
         case 0: return OK;
         case 1: return PARAMETER_ERR;
         case 2: return SYSTEM_ERR;
+        case 3: return PLAYER_ROOM_EXIST_ERR;
+        case 4: return ROOM_NOT_EXIST_ERR;
+        case 5: return JOIN_ROOM_REPEATEDLY_ERR;
         default: return null;
       }
     }
@@ -5858,9 +5909,11 @@ public final class CommonProto {
       "\020\246\3676\022\024\n\016RoomPlayerJoin\020\250\3676\022\025\n\017RoomPlayer" +
       "Leave\020\252\3676\022\025\n\017GameStateChange\020\254\3676\022\020\n\nShop" +
       "Update\020\256\3676\022\017\n\tBagUpdate\020\260\3676\022\016\n\010ErrorRes\020" +
-      "\260\3057*1\n\004Code\022\006\n\002OK\020\000\022\021\n\rPARAMETER_ERR\020\001\022\016" +
-      "\n\nSYSTEM_ERR\020\002B*\n\033com.incubator.message." +
-      "protoB\013CommonProtob\006proto3"
+      "\260\3057*\202\001\n\004Code\022\006\n\002OK\020\000\022\021\n\rPARAMETER_ERR\020\001\022" +
+      "\016\n\nSYSTEM_ERR\020\002\022\031\n\025PLAYER_ROOM_EXIST_ERR" +
+      "\020\003\022\026\n\022ROOM_NOT_EXIST_ERR\020\004\022\034\n\030JOIN_ROOM_" +
+      "REPEATEDLY_ERR\020\005B*\n\033com.incubator.messag" +
+      "e.protoB\013CommonProtob\006proto3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,

BIN
incubator-message/build/libs/incubator-message-1.0-SNAPSHOT.jar


+ 3 - 0
incubator-message/build/resources/main/CommonProto.proto

@@ -90,6 +90,9 @@ enum Code {
     OK = 0;                             //OK
     PARAMETER_ERR = 1;						      //参数错误
     SYSTEM_ERR = 2;                     //系统错误
+    PLAYER_ROOM_EXIST_ERR = 3;          //玩家已在房间
+    ROOM_NOT_EXIST_ERR = 4;             //房间已解散
+    JOIN_ROOM_REPEATEDLY_ERR = 5;       //重复加入其他房间
 }
 
 message CardInfo {

BIN
incubator-message/build/tmp/compileJava/previous-compilation-data.bin


+ 3 - 0
incubator-message/src/main/proto/CommonProto.proto

@@ -90,6 +90,9 @@ enum Code {
     OK = 0;                             //OK
     PARAMETER_ERR = 1;						      //参数错误
     SYSTEM_ERR = 2;                     //系统错误
+    PLAYER_ROOM_EXIST_ERR = 3;          //玩家已在房间
+    ROOM_NOT_EXIST_ERR = 4;             //房间已解散
+    JOIN_ROOM_REPEATEDLY_ERR = 5;       //重复加入其他房间
 }
 
 message CardInfo {