To install dependencies:
bun installTo run:
bun run main.jsThis repo is divided into 2 parts: the frontend and backend server. The backend server is separated into 2 processes:
- Server logic which deals with game logic, api and session management.
- Frontend serving which deals with serving react javascript and html,
This describes the steps backend takes to establish a connection from a new player
- Received get request to
/api/connect - Establish websocket connection with client by storing in
connectionsarray inws.ts - Send
new_playermessage kind to worker - Worker returns
new_player_idmessage - Player id gets sent back to client