mirror of
https://github.com/tiennm99/caro.git
synced 2026-06-04 02:13:02 +00:00
ecc617790e
Phase 04 of the WebSocket protobuf migration:
- Add protobufjs@7.5.4 runtime dep and protobufjs-cli@1.1.3 devDep
- Add proto:gen npm script that runs pbjs + pbts against server/src/main/proto/
- Commit static-module output at client/src/generated/protocol.{js,d.ts}
- Rewrite connection-service.js:
* Set binaryType='arraybuffer' and default URL to ws://localhost:1999/ratel
* Replace string-keyed send(code, data) with 13 typed send helpers
(sendNickname, sendGameMove, sendCreatePveRoom, ...)
* Decode incoming BinaryWebSocketFrame via Response.decode and map
each oneof case to a ClientEventCode for the event bus
- Update 14 call sites across menu-ui, game-ui, game-scene
- game-state-service CLIENT_CONNECT now reads data.clientId
- menu-ui NICKNAME_SET toast only triggers when invalidLength > 0
- Drop ServerEventCode enum from protocol-constants.js
Gomoku Web Client
Phaser 3 web client for the Gomoku game server.
Setup
npm install
npm run dev
Open http://localhost:5173 in your browser.
Requirements
- Node.js 22+
- Game server running on
localhost:1024(WebSocket on port1025)
Server Connection
The client connects via WebSocket to ws://localhost:1025/ratel by default.
To connect to a remote server, update the URL in src/services/connection-service.js.
Scripts
| Command | Description |
|---|---|
npm run dev |
Start development server with HMR |
npm run build |
Build for production (dist/) |
npm run preview |
Preview production build locally |