You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.
Proper thought needs to be applied to the game data / state. This needs to be a highly portable body of data in order to syncronise with clients quickly and efficently.
Data objects can be kept small by ensuring that card data (the text within the cards themeselves) is kept seperate from game data.
Full Game state
A lite version will be made available for the homepage game list. This is the full fat version.
{"id": "magnum-detroit","name": "Pigs DO fly!","status": "playing","locked": true,// Server still maintains authority on this. It will ignore the client when checking they can join the game."validToJoin": true,// Denotes whether the game is accessible from the server itself to render for the client. Note the server has authority, it will ignore the client when joining the game."roundCount": 1,// How many rounds this game has played"people": {// Expanded array of player objects without their sessionIds"host": {"id": "UUID4","name": "Maelstromeous","score": 1,"ready": true// Denotes if the player has all cards loaded etc, reported from the client"chosenCard": "UUID4",// Player's card choice, if they have one yet},"players": [{"id": "UUID4","name": "SomeAwesomeDude","score": 2,"ready": true,"chosenCard": "UUID4",}],"spectators": [{}]},"options": {"gameType": "tsar",// Denotes game's type, quite important"scoreToWin": 5,"maxPlayers": 6,// Impose hard limit?"maxSpectators": 10,// Impose hard limit?"packs": [123,1234,12345]// Packs enabled for the game"chatEnabled": true,"roundTimer": 30,// Seconds to give players to make choices before random selection"idleTimer": 120// Seconds before booting players from the session},"typeSpecificData": {// Made this mode specific as it depends on game type. Signifies who's the tsar."tsar": {"currentTsar": "Player3 UUID","previousTsars": [// The updating of this has to be done carefully, otherwise a player might have tsar multiple times."Player1 UUID","Player2 UUID","Player3 UUID"],"nextTsar": "Player4 UUID"}},"cards": {// Holds state of cards in play, this'll be a bit tricky. Card text etc will be exposed via API calls"black": {"id": "UUID4"},"white": [{"player1 UUID": {"cards": ["UUID4","UUID4"]// Array of 10 cards}}]},"serverSide": {// Details not to be exposed to the client to prevent cheating etc, could be done at API level rather than an object like this."gamePassword": "foobar",// Stored as a hash obvs"bannedPlayers": [],// List of player IDs who are banned from the game"cards": {"played": {// List of card IDs already played so the server doesn't give players the same cards"white": ["UUID4"],"black": ["UUID4"]}}},}
Lite Game Data
Bare minimum needed to render the homepage, this will be requested via an API call with a certain flag.
{id: 'shark-tale',name: 'A medium game',status: 'lobby',locked: true,validToJoin: true,people: {host: {name: "Warcore"},players: [{name: "SomeAwesomeDude"},{name: "SomeAnnoyingDude"},{name: "A lady in red"},{name: "A dude in blue"},{name: "A gentlemen in blue"},]},options: {pointsToWin: 5,maxPlayers: 7,},winConditions: {type: 'tsar',}},
Proper thought needs to be applied to the game data / state. This needs to be a highly portable body of data in order to syncronise with clients quickly and efficently.
Data objects can be kept small by ensuring that card data (the text within the cards themeselves) is kept seperate from game data.
Full Game state
A lite version will be made available for the homepage game list. This is the full fat version.
Lite Game Data
Bare minimum needed to render the homepage, this will be requested via an API call with a certain flag.
Player Data
Card Pack data
White card data
Black card data
Note here there's an extra
pick
attribute.The text was updated successfully, but these errors were encountered: