This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Omar Saad edited this page Feb 26, 2019
·
3 revisions
Currently there is no working prototype.
Server acts like a master while clients act like slaves. This has a few implications:
- Inventory and player-state etc. should all be handled by the server. Client requests to view it.
- Changes to the game-state should be broadcast and the players should update their own game instance to stay up-to-date.
- To execute an action, the client tells the server what it wants to do, and the server does it for the client if it's allowed. Then the change is broadcast.
Server will handle creation and joining of rooms. The game logic should be implemented in the GameRoom class.
- Clients can create or join rooms by signaling their intention to the server.
API Documentation:
Communication happens through websocket rawtext channel. The format for the commands are as such:
<COMMAND> [json-data]
Supported client commands:
creates a room and automatically joins it.
takes no data
Joins an existing room by a roomId
Data:
property | Type |
---|---|
roomId | String |