From 17671ade71d69ea1e8e8dcbae937119a127ece4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=94=E6=B0=91=E5=B0=8F=E9=95=87?= <262610965@qq.com> Date: Tue, 16 Apr 2024 10:29:16 +0800 Subject: [PATCH] :whale: 21.5 --- README.md | 2 +- common/common-core/pom.xml | 2 +- .../game/action/skeleton/IoGameVersion.java | 2 +- common/common-kit/pom.xml | 2 +- common/common-micro-kit/pom.xml | 2 +- common/common-validation/pom.xml | 2 +- doc_update.md | 115 ++++++++++++++++++ external/external-core/pom.xml | 2 +- external/external-netty/pom.xml | 2 +- net-bolt/bolt-broker-server/pom.xml | 2 +- net-bolt/bolt-client/pom.xml | 2 +- net-bolt/bolt-core/pom.xml | 2 +- pom.xml | 2 +- run-one/run-one-netty/pom.xml | 2 +- widget/light-client/pom.xml | 2 +- widget/light-domain-event/pom.xml | 2 +- widget/light-game-room/pom.xml | 2 +- widget/light-jprotobuf/pom.xml | 2 +- widget/light-profile/pom.xml | 2 +- .../pom.xml | 2 +- widget/light-redis-lock/pom.xml | 2 +- widget/light-timer-task/pom.xml | 2 +- widget/other-tool/pom.xml | 2 +- 23 files changed, 137 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 17067eef9..cce44098d 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ ioGame 是轻量级的网络编程框架,**不依赖任何第三方**中间件 com.iohao.game run-one-netty - 21.4 + 21.5 ``` diff --git a/common/common-core/pom.xml b/common/common-core/pom.xml index 0aa9f2887..0acafdd61 100644 --- a/common/common-core/pom.xml +++ b/common/common-core/pom.xml @@ -5,7 +5,7 @@ ioGame com.iohao.game - 21.4 + 21.5 ../../pom.xml 4.0.0 diff --git a/common/common-core/src/main/java/com/iohao/game/action/skeleton/IoGameVersion.java b/common/common-core/src/main/java/com/iohao/game/action/skeleton/IoGameVersion.java index b257b38ef..23fd05e41 100644 --- a/common/common-core/src/main/java/com/iohao/game/action/skeleton/IoGameVersion.java +++ b/common/common-core/src/main/java/com/iohao/game/action/skeleton/IoGameVersion.java @@ -29,7 +29,7 @@ public final class IoGameVersion { public static String a; static { - String internalVersion = "21.4"; + String internalVersion = "21.5"; VERSION = internalVersion .replace("", "") diff --git a/common/common-kit/pom.xml b/common/common-kit/pom.xml index 33f57e337..aad381d27 100644 --- a/common/common-kit/pom.xml +++ b/common/common-kit/pom.xml @@ -5,7 +5,7 @@ ioGame com.iohao.game - 21.4 + 21.5 ../../pom.xml 4.0.0 diff --git a/common/common-micro-kit/pom.xml b/common/common-micro-kit/pom.xml index 48c0decfc..a94197bd3 100644 --- a/common/common-micro-kit/pom.xml +++ b/common/common-micro-kit/pom.xml @@ -6,7 +6,7 @@ com.iohao.game ioGame - 21.4 + 21.5 ../../pom.xml diff --git a/common/common-validation/pom.xml b/common/common-validation/pom.xml index 0ab6495b7..03d49025d 100644 --- a/common/common-validation/pom.xml +++ b/common/common-validation/pom.xml @@ -5,7 +5,7 @@ ioGame com.iohao.game - 21.4 + 21.5 ../../pom.xml 4.0.0 diff --git a/doc_update.md b/doc_update.md index a59424503..2a9a059de 100644 --- a/doc_update.md +++ b/doc_update.md @@ -3,6 +3,121 @@ https://www.yuque.com/iohao/game/ab15oe +#### 2024-03-28 - v21.4 + +https://github.com/iohao/ioGame/releases/tag/21.4 + + + + +[ #253](https://github.com/iohao/ioGame/issues/253) + +> CreateRoomInfo.createUserId int --> long + + + +ExecutorRegion + +> 1. 优化默认创建策略 +> 2. 优化 ExecutorRegionKit,SimpleThreadExecutorRegion 默认使用全局单例,减少对象的创建。 + + + +proto 文档生成时,默认指定为 StandardCharsets.UTF_8 + +> javaProjectBuilder.setEncoding(StandardCharsets.UTF_8.name()); + + + +玩家下线时,使用自身所关联的线程处理。 + +> SocketUserSessions removeUserSession + +```java +public void removeUserSession(SocketUserSession userSession) { + + if (Objects.isNull(userSession)) { + return; + } + + long userId = userSession.getUserId(); + ExecutorRegionKit.getSimpleThreadExecutor(userId) + .executeTry(() -> internalRemoveUserSession(userSession)); +} +``` + + + +#### 2024-03-11 - v21.3 + +https://github.com/game-town/ioGame/releases/tag/21.3 + + + +[#250](https://github.com/game-town/ioGame/issues/250) 游戏对外服 - 自定义编解码 - WebSocketMicroBootstrapFlow + + + +文档 [游戏对外服-自定义编解码 (yuque.com)](https://www.yuque.com/iohao/game/ea6geg#Z8pbL) + + + +重写 WebSocketMicroBootstrapFlow createExternalCodec 方法,用于创建开发者自定义的编解码,其他配置则使用 pipelineCodec 中的默认配置。 + +```java +DefaultExternalServerBuilder builder = ...; + +builder.setting().setMicroBootstrapFlow(new WebSocketMicroBootstrapFlow() { + @Override + protected MessageToMessageCodec createExternalCodec() { + // 开发者自定义的编解码实现类。 + return new YourWsExternalCodec(); + } +}); +``` + + + +以下展示的是 WebSocketMicroBootstrapFlow pipelineCodec 相关代码 + +```java +public class WebSocketMicroBootstrapFlow extends SocketMicroBootstrapFlow { + ... 省略部分代码 + @Override + public void pipelineCodec(PipelineContext context) { + // 添加 http 相关 handler + this.httpHandler(context); + + // 建立连接前的验证 handler + this.verifyHandler(context); + + // 添加 websocket 相关 handler + this.websocketHandler(context); + + // websocket 编解码 + var externalCodec = this.createExternalCodec(); + context.addLast("codec", externalCodec); + } + + @Override + protected MessageToMessageCodec createExternalCodec() { + // createExternalCodec 相当于一个钩子方法。 + return new WebSocketExternalCodec(); + } +}; +``` + + + +[#249](https://github.com/game-town/ioGame/issues/249) +将集群启动顺序放到 Broker(游戏网关)之后。 + +集群增减和逻辑服 Connect 增减使用同一线程处理。 + +IoGameGlobalConfig brokerClusterLog 集群相关日志不开启。 + + + #### 2024-02-22 - v21.2 修复版本号显示错误问题(该版本没有功能上的更新与修改,不升级也不影响) diff --git a/external/external-core/pom.xml b/external/external-core/pom.xml index e2c04c42d..7d60a5eea 100644 --- a/external/external-core/pom.xml +++ b/external/external-core/pom.xml @@ -6,7 +6,7 @@ com.iohao.game ioGame - 21.4 + 21.5 ../../pom.xml diff --git a/external/external-netty/pom.xml b/external/external-netty/pom.xml index 58f0d1062..eac2d43ce 100644 --- a/external/external-netty/pom.xml +++ b/external/external-netty/pom.xml @@ -6,7 +6,7 @@ com.iohao.game ioGame - 21.4 + 21.5 ../../pom.xml diff --git a/net-bolt/bolt-broker-server/pom.xml b/net-bolt/bolt-broker-server/pom.xml index cca061d50..d8601b60d 100644 --- a/net-bolt/bolt-broker-server/pom.xml +++ b/net-bolt/bolt-broker-server/pom.xml @@ -5,7 +5,7 @@ ioGame com.iohao.game - 21.4 + 21.5 ../../pom.xml 4.0.0 diff --git a/net-bolt/bolt-client/pom.xml b/net-bolt/bolt-client/pom.xml index 7e8c58ebf..45ff4e4e6 100644 --- a/net-bolt/bolt-client/pom.xml +++ b/net-bolt/bolt-client/pom.xml @@ -5,7 +5,7 @@ ioGame com.iohao.game - 21.4 + 21.5 ../../pom.xml 4.0.0 diff --git a/net-bolt/bolt-core/pom.xml b/net-bolt/bolt-core/pom.xml index a984ec918..639d663e9 100644 --- a/net-bolt/bolt-core/pom.xml +++ b/net-bolt/bolt-core/pom.xml @@ -5,7 +5,7 @@ ioGame com.iohao.game - 21.4 + 21.5 ../../pom.xml 4.0.0 diff --git a/pom.xml b/pom.xml index 6eed27ee1..8c03982f2 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.iohao.game ioGame - 21.4 + 21.5 ioGame 生产资料公有制。 diff --git a/run-one/run-one-netty/pom.xml b/run-one/run-one-netty/pom.xml index 18b7a81ec..05d837c7a 100644 --- a/run-one/run-one-netty/pom.xml +++ b/run-one/run-one-netty/pom.xml @@ -6,7 +6,7 @@ com.iohao.game ioGame - 21.4 + 21.5 ../../pom.xml diff --git a/widget/light-client/pom.xml b/widget/light-client/pom.xml index 31d36e6d5..b6478f943 100644 --- a/widget/light-client/pom.xml +++ b/widget/light-client/pom.xml @@ -6,7 +6,7 @@ com.iohao.game ioGame - 21.4 + 21.5 ../../pom.xml diff --git a/widget/light-domain-event/pom.xml b/widget/light-domain-event/pom.xml index fae4fe823..d19accf0f 100644 --- a/widget/light-domain-event/pom.xml +++ b/widget/light-domain-event/pom.xml @@ -5,7 +5,7 @@ ioGame com.iohao.game - 21.4 + 21.5 ../../pom.xml 4.0.0 diff --git a/widget/light-game-room/pom.xml b/widget/light-game-room/pom.xml index 217a3b309..9388ed1d9 100644 --- a/widget/light-game-room/pom.xml +++ b/widget/light-game-room/pom.xml @@ -5,7 +5,7 @@ ioGame com.iohao.game - 21.4 + 21.5 ../../pom.xml 4.0.0 diff --git a/widget/light-jprotobuf/pom.xml b/widget/light-jprotobuf/pom.xml index 5e2c3530a..0e7743f12 100644 --- a/widget/light-jprotobuf/pom.xml +++ b/widget/light-jprotobuf/pom.xml @@ -5,7 +5,7 @@ ioGame com.iohao.game - 21.4 + 21.5 ../../pom.xml 4.0.0 diff --git a/widget/light-profile/pom.xml b/widget/light-profile/pom.xml index fe807d6ba..9defcef30 100644 --- a/widget/light-profile/pom.xml +++ b/widget/light-profile/pom.xml @@ -5,7 +5,7 @@ ioGame com.iohao.game - 21.4 + 21.5 ../../pom.xml 4.0.0 diff --git a/widget/light-redis-lock-spring-boot-starter/pom.xml b/widget/light-redis-lock-spring-boot-starter/pom.xml index 8717ff481..e2aa29a3d 100644 --- a/widget/light-redis-lock-spring-boot-starter/pom.xml +++ b/widget/light-redis-lock-spring-boot-starter/pom.xml @@ -8,7 +8,7 @@ ioGame com.iohao.game - 21.4 + 21.5 ../../pom.xml diff --git a/widget/light-redis-lock/pom.xml b/widget/light-redis-lock/pom.xml index 3c6567c8e..a19c71bc9 100644 --- a/widget/light-redis-lock/pom.xml +++ b/widget/light-redis-lock/pom.xml @@ -5,7 +5,7 @@ ioGame com.iohao.game - 21.4 + 21.5 ../../pom.xml 4.0.0 diff --git a/widget/light-timer-task/pom.xml b/widget/light-timer-task/pom.xml index 0d35f6ea3..3345d7c73 100644 --- a/widget/light-timer-task/pom.xml +++ b/widget/light-timer-task/pom.xml @@ -5,7 +5,7 @@ ioGame com.iohao.game - 21.4 + 21.5 ../../pom.xml 4.0.0 diff --git a/widget/other-tool/pom.xml b/widget/other-tool/pom.xml index 9f66b2141..f5229af39 100644 --- a/widget/other-tool/pom.xml +++ b/widget/other-tool/pom.xml @@ -6,7 +6,7 @@ com.iohao.game ioGame - 21.4 + 21.5 ../../pom.xml