更新文档

This commit is contained in:
flswld
2023-01-29 23:09:01 +08:00
parent 5fbe66113e
commit c753dc53cd

View File

@@ -1,6 +1,16 @@
# hk4e
#### hk4e game server
## 简介
#### 『原神』 Game Server But Golang Ver.
#### 代号hk4e中的hk起源于『Honkai Impact 3rd』
#### 项目的客户端协议和配置表主要基于3.2版本修改而来因此请尽量使用3.2版本的客户端,但不是必须的
[3.2.0国际服客户端下载链接](https://autopatchhk.yuanshen.com/client_app/download/pc_zip/20221024103618_h2e3o3zijYKEqHnQ/GenshinImpact_3.2.0.zip)
#### 客户端需要本地https代理和打破解补丁才能正常使用详情请参考目前主流私服连接方法
## 编译和运行环境
@@ -10,6 +20,8 @@
* Docker >= 20.10
* Docker Compose >= 1.29
#### 本项目未使用CGO构建理论上Windows、Linux、MaxOS系统都可以编译运行
## 快速启动
* 首次需要安装工具
@@ -23,7 +35,7 @@ make dev_tool
```shell
make gen_natsrpc # 生成natsrpc协议
make gen_proto # 生成客户端协议
make gen_client_proto # 生成客户端协议代理(非必要)
make gen_client_proto # 生成客户端协议代理(非必要 详见gate/client_proto/README.md)
```
* 构建
@@ -37,7 +49,7 @@ make docker_build # 构建镜像
```shell
make gen_csv # 生成配置表
# 启动前请先确保各服务器的配置文件正确
# 启动前请先确保各服务器的配置文件正确(如docker/node/bin/application.toml)
docker-compose up -d # 启动服务器
```
@@ -52,15 +64,21 @@ docker-compose up -d # 启动服务器
* node 节点服务器 (仅单节点 有状态)
* dispatch 登录服务器 (可多节点 无状态)
* gate 网关服务器 (可多节点 有状态)
* fight 战斗服务器 (可多节点 有状态 非必要)
* pathfinding 寻路服务器 (可多节点 无状态 非必要)
* fight 战斗服务器 (可多节点 有状态 非必要 未启动由gs接管)
* pathfinding 寻路服务器 (可多节点 无状态 非必要 未启动由gs接管)
* gs 游戏服务器 (可多节点 有状态)
* gm 游戏管理服务器 (仅单节点 无状态)
#### 其它
* 配置运行时环境变量
* 独立运行需要配置环境变量
```shell
GOLANG_PROTOBUF_REGISTRATION_CONFLICT=ignore
```
## 代码提交规范
* 提交前**必须**进行go fmt(GoLand可在commit窗口的设置里勾选默认是启用的)
* 单行注释的注释符与注释内容之间需要加一个空格(GoLand可在设置Editor/CodeStyle/Go/Other里打开)
* 导入包时需要将标准库、本地包、第三方包用空行分开(GoLand可在设置Editor/CodeStyle/Go/Imports里打开)