Files
CC-Framework.BriskGameServer/服务参考_临时/README.md

102 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Brisk Game Service
Brisk 游戏服务端工程。
当前已实现模块:
- 客户端初始化 `bootstrap`
- 登录换票 `auth`
- 玩家信息 `player`
- 动态配置 `config`
- 公告 `announcements`
- 排行榜 `ranks`
- 云存档 `archives`
- 玩家空间 `spaces`
- 管理后台认证、项目、配置、公告、排行榜、存档、玩家、空间、审计
- Worker 清理任务与基础限流
## 当前核心模型
- 项目唯一标识只有 `game_key`
- 项目级 `channel / platform` 已移除
- 初始化和动态配置只依赖 `game_key`,配置筛选只看 `client_version`
- 登录模块单独处理第三方身份:
- `login_provider`:如 `tap`
- `login_user_id`:该登录平台返回的稳定唯一用户 ID
- 服务端登录成功后返回内部:
- `player_id`
- `project_account_id`
- `access_token`
- 空间、排行榜后台筛选等模块支持直接使用 `login_provider + login_user_id`
- 内部仍优先解析到 `player_id` 再执行业务查询,便于性能和统一索引
## 本地运行
推荐使用 Docker Compose
```bash
copy .env.example .env
docker compose up --build
```
默认接口:
- `GET /health`
- `GET /api/ping`
- `GET /openapi.yaml`
开发环境默认账号:
- 后台用户名:`admin`
- 后台密码:`admin123456`
- 后台操作员:`operator`
- 操作员密码:`operator123456`
## 接入说明
- 客户端初始化:
- 必填 `game_key`
- 可选 `client_version`
- `device_id` 仅作透传与诊断辅助
- 客户端登录:
- 必填 `game_key`
- 必填 `login_provider`
- `login_user_id``code` 二选一
- 可选透传 `nickname``avatar_url``profile_json`
- 云存档:
- 支持二进制文件上传/下载,适合直接存游戏存档 bytes
- 玩家空间:
- 当前为 `payload_json` 结构,适合资料卡、展示文本等轻量公开数据
## 测试脚本
Windows PowerShell
```powershell
.\scripts\smoke-test.ps1
.\scripts\acceptance.ps1 -Tasks all -ManageStack
```
## 迁移
数据库迁移目录:
- [0001_init.sql](/F:/OtherWork/BriskGameSerivce/internal/platform/db/migrations/0001_init.sql)
- [0008_identity_and_config_simplification.sql](/F:/OtherWork/BriskGameSerivce/internal/platform/db/migrations/0008_identity_and_config_simplification.sql)
服务启动时会自动执行未应用迁移。
## 根目录文档
- [Brisk API接口与示例文档.md](/F:/OtherWork/BriskGameSerivce/Brisk%20API%E6%8E%A5%E5%8F%A3%E4%B8%8E%E7%A4%BA%E4%BE%8B%E6%96%87%E6%A1%A3.md)
- [Brisk Unity SDK接入文档.md](/F:/OtherWork/BriskGameSerivce/Brisk%20Unity%20SDK%E6%8E%A5%E5%85%A5%E6%96%87%E6%A1%A3.md)
- [openapi.yaml](/F:/OtherWork/BriskGameSerivce/openapi.yaml)
## 目录说明
- `cmd/`:启动入口
- `internal/`:内部实现
- `deployments/`:部署配置
- `docs/`:历史设计文档与补充资料
- `scripts/`:脚本