Files
AIGame/Doc/NetProtocol.md
T
udxandCursor 6550b8df4b Add AIServer, character art pipeline, and Art package boot integration.
Bring in MaleExplorer assets/shaders, model tooling and Hunyuan updates, plus boot/YooAsset Art package support.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 17:06:59 +08:00

1.1 KiB
Raw Blame History

游戏服协议

生产

Base: https://game.xworld.ren(Caddy → 后端)

本地 AIServer(推荐开发)

路径:AIServer/(C++ + SQLite)

| Base | http://127.0.0.1:8080 | | WS | ws://127.0.0.1:8080/ws?pid={pid}&token={token} |

构建与运行见 AIServer/README.md。

HTTP

方法 路径 Body 成功 失败
POST /register {"username","password"} {token,pid} invalid_input / user_exists
POST /login {"username","password"} {token,pid} invalid_credentials
GET /health — {ok,service} —

WebSocket

/ws?pid={pid}&token={token}
  • 无 token / token 无效 → HTTP 401
  • 应用层:{"op":"hello"} → {"op":"hello_ack","ok":true};{"op":"ping"} → {"op":"pong"}
  • 协议层 Ping/Pong 由服务端应答

客户端

  • HotUpdate.Net.AuthApi / GameNet / WsClient
  • Boot:HttpBase + WsUrlTemplate
  • 菜单:AIGame/Boot/Server/Local AIServer :8080 或 Production
  • 编辑器自动 guest_{deviceId} 账号