Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2f51c16
refactor(consul)!: adopt typed plugin construction
nick2781 Oct 26, 2026
fc9035a
fix(hash)!: standardize Murmur digests and retain legacy MSVC access
nick2781 Oct 26, 2026
d8b3a61
test(hash): isolate standalone Murmur header checks
nick2781 Oct 26, 2026
b794cfc
test(consul): exercise construction across application jobs
nick2781 Oct 26, 2026
87e24d4
docs(hash): distinguish affected routing consumers
nick2781 Oct 26, 2026
c9bdebe
chore(consul): synchronize preceding merge candidate
nick2781 Oct 26, 2026
5a8b002
chore(hash): synchronize preceding merge candidate
nick2781 Oct 26, 2026
15b0901
docs(consul): publish construction guide in canonical pages
nick2781 Oct 26, 2026
7f2256f
build(deps): bump fast-uri from 3.1.8 to 3.1.9 in /docs/site
dependabot[bot] Oct 26, 2026
3bed670
refactor(proto): remove unused codec scaffolding
nick2781 Oct 26, 2026
53222f8
refactor(hash): remove platform header dependencies
nick2781 Oct 26, 2026
5a4944c
chore(integration): synchronize accepted hash candidate
nick2781 Oct 26, 2026
69af843
chore(hash): synchronize preceding Consul candidate
nick2781 Oct 26, 2026
ab53c06
chore(integration): synchronize preceding plugin changes
nick2781 Oct 26, 2026
9c6b94e
chore(integration): synchronize preceding header cleanup
nick2781 Oct 26, 2026
94009f4
build(deps): combine fast-uri update with Consul validation
nick2781 Oct 26, 2026
40795f8
chore(integration): synchronize preceding merge candidate
nick2781 Oct 26, 2026
2f6cdf4
refactor(etcd)!: replace plugin creation macros
nick2781 Oct 26, 2026
ae9b546
chore(integration): combine preceding cleanup with Etcd construction
nick2781 Oct 26, 2026
d38982c
fix(tests): probe Net DSO listener and peer closure
nick2781 Oct 26, 2026
5c621eb
fix(tests): bound the Net listener shutdown probe
nick2781 Oct 26, 2026
dd02b81
chore(integration): retain the Net listener test fix
nick2781 Oct 26, 2026
37a88f3
chore(integration): include the Net listener test fix
nick2781 Oct 26, 2026
ab1a01c
refactor(osssdk)!: use typed plugin construction
nick2781 Oct 26, 2026
663a4bd
refactor(kafka)!: replace plugin creation macros
nick2781 Oct 26, 2026
c3f1423
chore(integration): combine OSS SDK and Kafka construction
nick2781 Oct 26, 2026
377b504
chore(integration): synchronize OSS SDK merge candidate
nick2781 Oct 26, 2026
fb85954
docs(roadmap): align supported behavior and remaining acceptance
nick2781 Oct 26, 2026
2103173
chore(integration): synchronize Kafka merge candidate
nick2781 Oct 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/concepts/application-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ Adding a public header or CMake API target only makes an interface available to

## Ordering and ownership

The manager installs plugins before running the module initialization stages. It does not topologically sort module dependencies or make manifest list order a lifecycle-order contract. Missing-module lookups can return null, and module callback return values are not currently aggregated into a transactional startup result. Verify required plugins/resources and application logs; a running process alone does not prove every service initialized successfully.
The manager installs plugins before running `init()`, `post_init()`, `check_config()` and `pre_update()`. The first `false` return stops startup; a propagated startup exception also reaches the launcher. The launcher reports the failed phase and available module/plugin details, then terminates with exit code `1` before entering the update loop. It does not roll back partially started plugins or run normal shutdown hooks on this failure path. See [startup failure handling](../guides/applications.md#check-startup-and-stop-the-process).

The manager does not topologically sort module dependencies or make manifest list order a lifecycle-order contract. Missing-module lookups can return null. Verify required plugins/resources, initialization logs and application-specific readiness before routing traffic; a running process alone does not prove every service initialized successfully.

Pointers returned by `find_module()` belong to the loaded plugin. Stop asynchronous producers before teardown and do not retain those pointers after unload. Keeping connections and state through an in-flight business-plugin replacement is not an automatic consequence of this composition model.

Expand Down
4 changes: 3 additions & 1 deletion docs/concepts/application-architecture_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ config = ""

## 顺序与所有权

管理器先安装插件,再执行模块初始化阶段。它不按依赖关系排序模块,清单中的插件顺序也不是生命周期顺序保证。查找缺失模块可能返回空指针,模块回调返回值目前没有汇总为可回滚的启动结果。需要核对必需插件、资源和应用日志;进程仍在运行,不代表每个服务都已初始化成功。
管理器先安装插件,再执行 `init()`、`post_init()`、`check_config()` 和 `pre_update()`。首个 `false` 返回值会中止启动;向外传播的启动异常也会到达启动器。启动器报告失败阶段及可用的模块/插件信息,在进入更新循环前以退出码 `1` 终止。这条失败路径不回滚部分启动的插件,也不执行正常停机钩子。见[启动失败处理](../guides/applications_CN.md#确认启动并停止进程)。

管理器不按依赖关系排序模块,清单中的插件顺序也不是生命周期顺序保证。查找缺失模块可能返回空指针。接收流量前,需要核对必需插件、资源、初始化日志与应用就绪状态;进程仍在运行,不代表每个服务都已初始化成功。

`find_module()` 返回的指针属于已加载插件。释放前先停止异步生产者,插件卸载后不再保留这些指针。在业务函数执行期间替换插件,同时保留连接和状态,需要另外的协调机制,不是这种组合方式自动提供的能力。

Expand Down
71 changes: 71 additions & 0 deletions docs/project/roadmap-history.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Historical roadmap

This snapshot preserves the previous roadmap, including its original wording and checkbox states. It is a historical record, not a list of supported APIs, accepted capabilities or current priorities. English and Chinese snapshots retain their original differences. Use the [current roadmap](roadmap.md) for supported behavior and remaining acceptance.

---

## Current modernization

- [x] Complete the `include/ark/`, `src/` and `src/plugins/<name>/` layout and snake_case API migration, including Protobuf source naming.
- [x] Release native single-node MySQL and Redis clients in arknet 0.2.0.
- [ ] Replace ark database plugins' legacy drivers, with Asio coroutine entry points, native arknet owning results and module-thread completion.
- [ ] Integrate the remaining independent official plugins with optional builds and tests.
- [ ] Review Nimbus documentation locally while preserving existing articles and entry points.

Hot-update discussions and implementation are deferred. The original planning list below retains its historical checkbox state; it is not a current API or capability list. Use the current items above, source code and acceptance records to determine implementation status.

## High priority

- [ ] Put all schemas in one Excel workbook and keep other configuration tables separate, while remaining compatible with the existing format.
- [x] Unify code style.
- [ ] Connect to logserver before process startup and fail startup if the connection cannot be established, so logging is available from the beginning.
- [x] Upgrade spdlog.
- [ ] Add a dirty data layer that batches changed data after each client request, instead of sending every change separately in small packets with repeated protocol headers.
- [ ] Complete documentation for concepts, design principles, server architecture and usage examples.
- [x] Align all basic data structures with C++ containers.
- [ ] Add service registry support, considering etcd or consul.
- [ ] Use timers for periodic logs and heartbeats instead of update and HeartBeat.
- [ ] Update configuration packaging: edit in Excel and generate `csv` files for the project to read. Use contributor-specific suffixes such as Item.A.xlsx and Item.B.xlsx to reduce collaboration conflicts.
- [ ] ~~Control plugin loading order through configuration fields or configuration order.~~
- [x] Use the AFXml wrapper instead of accessing rapidxml directly.
- [x] Simplify interface class design.
- [ ] Generate repetitive code (_plugin and module classes_).

## Low priority

- [ ] Update protocol and client handling for Map and Layer (**the concepts have changed; client integration is pending**).
- [ ] Use a different approach to sorting and swapping entries in inventory tables.
- [ ] Reduce data synchronization traffic: remove repeated strings such as `NodeName` and `TableName`, send index-to-name mappings at login, then use indices for updates and names for persistence.
- [ ] Extend DataTable to support more complex structures, such as items containing gems with experience and enchantments, or weapons with random attributes. The existing fixed two-dimensional structure is difficult to extend.
- [ ] Add network library and performance benchmarks under benchmark/unittest.
- [ ] Add kcp.
- [ ] Use SWIG for the scripting module.
- [ ] Evaluate ECS: represent all objects as entities and use GUIDs to identify their group and position for fast lookup. Research references include Overwatch, ET and [ECS-unity](https://github.com/sschmid/Entitas-CSharp).
- [ ] Add coroutines, referring to libgo.
- [ ] Introduce tcmalloc.
- [ ] Add a monitoring web page using vue-admin.
- [ ] Add a Deployment web tool.
- [ ] Add message queue processing.
- [ ] Add operations tools (tcm & deploy).
- [ ] Use multiple threads for selected CPU-intensive work.

## Partially finished

- [x] Add spdlog sinks that organize files by directory and rotate by size or hour (*partially changed; further changes are needed for the tlog format, /data/binlog/1001/20180627/game1_hour.log*).
- [x] Add consistent_hash_map (**added, not yet enabled**).

## Finished

- [x] Implement the new architecture.
- [x] Configure connection relationships instead of setting them manually in code (bus_relation, server_settting). Detect IP addresses and generate ports dynamically instead of specifying them, and express network addresses as URLs such as tcp://0.0.0.0:9001 and wss://0.0.0.0:9001.
- [x] Place Debug and Release binaries together under bin, with separate Debug and Release settings so they can share one configuration set.
- [x] Change guid to an internal pointer type to reduce memory use for other non-guid types. ***Changed to int64_t; the memory concern no longer applies.***
- [x] Add a network plugin to separate network modules from application logic (NetClient and NetServer are still too closely coupled to application logic).
- [x] Add endpoint to the net plugin.
- [x] Merge the kernel and config plugins because kernel depends heavily on config.

## Bugs

- [ ] ClearRow shifts subsequent row indices. Either preserve the indices and clear only the row contents, or have the client update subsequent indices when it receives DeleteRow.
- [x] Fix ConfigPlugin data loading.
- [x] Fix the return values of AFMapEx First and Next.
88 changes: 88 additions & 0 deletions docs/project/roadmap-history_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# 历史路线图

本页保留原路线图的文字与勾选状态,仅供追溯,不作为支持的 API、已验收能力或当前优先级清单。中英文快照保留原有差异。支持范围与剩余验收见[当前路线图](roadmap_CN.md)。

---

## 当前改造

- [x] 完成 `include/ark/`、`src/` 与 `src/plugins/<名称>/` 的目录整理和 snake_case 接口迁移,包含 Protobuf 源码命名。
- [x] 随 arknet 0.2.0 发布原生 MySQL、Redis 单节点客户端。
- [ ] 替换 ark 数据库插件的旧驱动,提供 Asio 协程入口,直接使用 arknet 拥有型结果,并在模块线程恢复。
- [ ] 整合其余独立官方插件,按需构建并补齐测试。
- [ ] 在本地审阅 Nimbus 文档,保留原有文章和入口。

业务热更新的讨论与实现暂缓。下方保留原有规划的历史勾选状态,不作为当前 API 或能力清单;当前实现以以上条目、源码和验收记录为准。

## High priority

- [x] excel格式修改为一张excel里放所有的schema,其他配置表分开来写,兼容现在的格式
- [x] 调整代码风格统一
- [x] spdlog升级
- [x] 增加dirty data layer, 当一个客户端请求处理完成后统一下发变化数据,不能有变有发,会导致小包太碎,并且浪费协议的head(改为非实时数据下一帧统一发送,实时数据有变有发)
- [ ] 文档逐步补齐,概念介绍、设计理念、服务器架构、使用例子
- [x] 所有的基础数据结构向C++容器看齐
- [x] 服务中心注册(考虑etcd/consul来做), 已经使用consul来处理了
- [x] 定时log和心跳改为timer方式,不要再是用update和HeartBeat了
- [x] 修改配置打包工具(用Excel编辑,生成`xml`来给工程读取。为解决多人协作冲突, excel可以用名字后缀区分,类如Item.A.xlsx Item.B.xlsx)
- [x] 修改xml不再直接用rapidxml,用封装后的AFXml
- [x] 接口类重新设计纯粹化
- [x] 增加生成器来生成重复代码(_插件类和模块类_)
- [x] 使用`std::chrono`改造`AFDateTime`
- [x] session id 使用GUID类型
- [x] 增加murmur hash函数用来做consistent hash map
- [x] 增加xoshiro/xoroshiro随机算法
- [x] 增加xxtea, crc16, crc32, crc64加密算法
- [ ] 增加codec类,用来剥离框架对特定协议的依赖,方便外部替换协议类型
- [ ] 增加插件动态热更新
- [ ] 增加工具获取插件动态链接库版本号
- [x] Linux下强杀进程处理(kill -9 xxx)
- [ ] 配置meta和entity meta的区分
- [ ] 网络修改为asio系
- [ ] web serever/client修改为asio/beast系
- [ ] Redis 插件接入 arknet 自主实现的 Redis 客户端

## Low priority

- [x] Map, Layer,对应修改协议和Client的处理(**概念已经修改, 还未对接客户端**)
- [x] 关于背包类的table,整理或者交换,需要改成别的方式
- [x] 优化数据同步的流量,减小属性同步的体积(去掉`NodeName`和`TableName`类似的string同步, 上线先同步index和name的映射,后续全部用index下发,入库用name)
- [x] 拓展DataTable的组成,例如道具包含了宝石(带经验,附魔等)、武器(带随机属性)等东西,DataTable现有的二维结构是特定的,不方便做扩展
- [ ] 增加网络库和性能的基准测试用例,放到目录benchmark/unittest
- [ ] 增加kcp
- [ ] 脚本模块使用SWIG
- [x] 考虑使用ECS,全部对象Entity化,~~通过GUID来确定属于哪个分组的哪个位置,能快速定位和查找(通过守望先锋、ET、[ECS-unity](https://github.com/sschmid/Entitas-CSharp),具体还要再调研)~~
- [ ] 增加coroutine,参考libgo
- [ ] 引入tcmalloc
- [ ] 增加监控web页面(ant-design-for-vue)
- [ ] 增加Deployment web工具
- [ ] ~~增加消息队列处理~~
- [ ] 增加运维工具(tcm & deploy)
- [ ] 部分计算密集的地方使用多线程
- [ ] 增加协议wrapper层,这样框架层包装后,可以甩出来给业务用,无需知道业务层用的协议类型
- [ ] ~~升级至C++17~~
- [ ] ~~`std::string_veiw`/`discard`/...~~
- [ ] ~~插件加载顺序(通过配置中的字段, 或者通过配置的顺序)~~
- [ ] ~~修改进程启动优先链接logserver,如果logserver连不上,则直接不能启动,这样就可以从一开始就能打log了~~

## Part finished

- [x] spdlog增加按照文件夹/大小/小时滚动的sink(*已经修改了一部分,还需要进一步修改成tlog的格式,/data/binlog/1001/20180627/game1_hour.log*)
- [x] 增加consistent_hash_map

## Finished

- [x] 新架构修改
- [x] 增加连接关系的配置,不再通过程序中手动设置关系(bus_relation, server_settting, IP和port不用再指定了, 通过获取IP和动态生成port), 网络地址修改为tcp://0.0.0.0:9001 wss://0.0.0.0:9001这样的URL
- [x] 修改bin文件夹debug和release在一起,debug和release分开配置(方便配置是一套)
- [x] guid改为内部指针类型(降低其他非guid类型的内存占用)***修改为int64_t了,不需要再考虑内存占用了***
- [x] 增加网络插件,这样可以将网络模块和业务逻辑模块拆分开(现在NetClient和NetServer还是跟业务关联太紧密了)
- [x] net plugin增加endpoint
- [x] kernel和config插件还是得合并为一个,因为kernel非常依赖config插件

## Bugs

- [x] ClearRow的时候后面的行号会变化,所以要考虑要么行号不变,只是置空,要么就得客户端来根据DeleteRow消息同步修改后续的row变化
- [x] 现在的ConfigPlugin数据加载有问题
- [x] AFMapEx的First Next返回值有问题
- [ ] 单个进程开多个监听服务,busid会被覆盖和连接管理有问题
Loading
Loading