Browse Source

1.暂时屏蔽请求过滤器;2.离开房间打印日志优化

johnclot69 2 months ago
parent
commit
1a021eb165

+ 4 - 4
incubator-game/src/main/java/com/incubator/game/handler/room/LeaveRoomHandler.java

@@ -28,7 +28,7 @@ public class LeaveRoomHandler extends NetHandler {
 
         Player player = (Player) PlayerUtil.getOnlinePlayer(session.getPlayerId());
         if (player == null) {
-            Log.info("创建房间失败,找不到玩家");
+            Log.info("离开房间失败,找不到玩家");
             response.setCode(CommonProto.Code.SYSTEM_ERR_VALUE);
             response.setMessage("操作失败...");
             return;
@@ -36,7 +36,7 @@ public class LeaveRoomHandler extends NetHandler {
 
         // 判断玩家绑定房间
         if (player.data.roomId <= 0) {
-            Log.info("准备失败,玩家不在房间");
+            Log.info("离开房间失败,玩家不在房间");
             response.setCode(CommonProto.Code.PLAYER_ROOM_NOT_EXIST_ERR_VALUE);
             response.setMessage("操作失败,玩家不在房间...");
             return;
@@ -45,7 +45,7 @@ public class LeaveRoomHandler extends NetHandler {
         // 玩家房间是否存在
         Room room = RoomService.getInstance().getRoom(player.data.roomId);
         if (room == null) {
-            Log.info("玩家房间已解散");
+            Log.info("离开房间失败,玩家房间已解散");
             response.setCode(CommonProto.Code.ROOM_NOT_EXIST_ERR_VALUE);
             response.setMessage("操作失败,玩家房间已解散...");
             return;
@@ -53,7 +53,7 @@ public class LeaveRoomHandler extends NetHandler {
 
         // 当前状态是否可操作
         if (room.state != 0 || player.data.state != 0) {
-            Log.info("游戏已开始...");
+            Log.info("离开房间失败,游戏已开始...");
             response.setCode(7);
             response.setMessage("操作失败,游戏已开始...");
             return;

+ 1 - 1
incubator-game/src/main/java/com/incubator/game/listener/PublicListener.java

@@ -82,7 +82,7 @@ public class PublicListener extends GameServerConnectionListener {
 				// 使用请求过滤器
 				if (!RequestFilter.isAllowed(conn, request.getCmd())) {
 					Log.warn("请求过于频繁,已过滤: cmd={}, player={}", request.getCmd(), conn.getPlayerId());
-					return;
+//					return;
 				}
 
 				// 心跳消息特殊处理