This project provides a server for virtual "hats" to support Name Game as it is typically played by SWIL. It does not provide voice chat or anything else; it just simulates names in a hat that can be tossed on the floor when they're gotten.
This project is not intended for end users; you will need to create a front end in order to use it.
To see the endpoints and objects provided, check out the openapi-namegame.json file in this repository. You can use this to generate client code with any OpenAPI v3 compatible generator, and/or look at auto-generated documentation by loading it into editor.swagger.io.
-
Setup
- Create a new Hat (POST /api/hats)
- Create a new Player for each Player (POST /api/players)
- Add names to the hat by creating new Names specifying the Hat ID from step 1, and Player ID (owner) from step 3. (POST /api/names)
-
Gameplay
- Draw a name from the hat by fetching all the ungotten names from a hat (POST /api/hats/{id}/names isGotten=false) THE CLIENT IS RESPONSIBLE FOR CHOOSING A RANDOM NAME FROM THE RESULT SET.
- If the name is gotten:
- update the name setting isGotten=true (PUT /api/names/{id} set isGotten=true)
- fetch a new name (see above)
- If the name is NOT gotten, do nothing!