From 4f358a38c8440bcf699a2e06c8d8b3bd0ba6d05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=89=91=E5=99=A8=E8=BF=91?= Date: Fri, 11 Jun 2021 15:35:08 +0800 Subject: [PATCH] deployed 2.0.0.RELEASE --- pom.xml | 4 ++-- src/main/java/io/github/yezhihao/netmc/TCPServerHandler.java | 2 +- .../java/io/github/yezhihao/netmc/core/model/Message.java | 3 +++ src/test/java/io/github/yezhihao/netmc/model/MyMessage.java | 5 +++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index e75b3c2..eb1ddbb 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.github.yezhihao netmc - 1.0.5.RELEASE + 2.0.0.RELEASE jar Netmc @@ -74,7 +74,7 @@ org.springframework spring-context - 5.3.7 + 5.3.8 compile diff --git a/src/main/java/io/github/yezhihao/netmc/TCPServerHandler.java b/src/main/java/io/github/yezhihao/netmc/TCPServerHandler.java index 6dc13d8..b22deef 100644 --- a/src/main/java/io/github/yezhihao/netmc/TCPServerHandler.java +++ b/src/main/java/io/github/yezhihao/netmc/TCPServerHandler.java @@ -67,7 +67,7 @@ public class TCPServerHandler extends ChannelInboundHandlerAdapter { } time = System.currentTimeMillis() - time; if (time > 200) - log.info("=========消息ID{},处理耗时{}ms,", request.getMessageId(), time); + log.info("========={},处理耗时{}ms,", request.getMessageName(), time); if (response != null) ctx.writeAndFlush(response); } diff --git a/src/main/java/io/github/yezhihao/netmc/core/model/Message.java b/src/main/java/io/github/yezhihao/netmc/core/model/Message.java index bfecd06..2acde94 100644 --- a/src/main/java/io/github/yezhihao/netmc/core/model/Message.java +++ b/src/main/java/io/github/yezhihao/netmc/core/model/Message.java @@ -15,6 +15,9 @@ public interface Message extends Serializable { /** 消息类型 */ Serializable getMessageId(); + /** 消息类型(日志输出) */ + String getMessageName(); + /** 消息流水号 */ int getSerialNo(); } \ No newline at end of file diff --git a/src/test/java/io/github/yezhihao/netmc/model/MyMessage.java b/src/test/java/io/github/yezhihao/netmc/model/MyMessage.java index 2c549e7..1927b97 100644 --- a/src/test/java/io/github/yezhihao/netmc/model/MyMessage.java +++ b/src/test/java/io/github/yezhihao/netmc/model/MyMessage.java @@ -45,6 +45,11 @@ public class MyMessage implements Message { return header.getType(); } + @Override + public String getMessageName() { + return String.valueOf(header.getType()); + } + @Override public int getSerialNo() { return header.getSerialNo();