Village message protocol examples

Server-to-logger message examples

Server-to-client morning.jsonld

Server-to-client myMessageOnChat.jsonld

Client-to-server nightVote.jsonld

Flow

System outline

Receipt system

Once a robot/browser receives a chat message,

Once a robot/browser receives a flavor test message,

Once a robot/browser receives a systemMessage,

Finalization flow

A host player starts the next game

  • push the "Next game" button

  • (client to server) villageMessage/ buildVillage.json

  • (server to all the clients) villageMessage/ nextGameInvitation.json

  • save a next game village id in the indexeddb

  • move from villageMessage to lobbyMessage

  • (client to server) lobbyMessage/ selectVillage.json

  • (server to client) lobbyMessage/ waitingPage.json

  • remove the next game village id in the indexeddb

  • push the "Play" button

  • (client to server) lobbyMessage/ play.json

  • (server to client) lobbyMessage/ played.json

  • move lobbyMessage to villageMessage

  • (client to server) villageMessage/ ready.json

  • (server to other clients) villageMessage/ nextGameInvitaionIsClosed.json

  • (other clients) undisplay the "Next game" button

A guest player joins the next game

  • (server to all the clients) villageMessage/ nextGameInvitation.json

  • save a next game village id in the indexeddb

  • move villageMessage to lobbyMessage

  • display the "Next game" button

  • push the "Next game" button

  • (client to server) lobbyMessage/ selectVillage.json

  • (server to client) lobbyMessage/ waitingPage.json

  • remove the next game village id in the indexeddb

A host player returns to the lobby

  • set isHost true in the indexeddb

  • save buildVillage.json in the indexeddb

  • (play the game)

  • push the "Return to the lobby"

  • remove the next village id if it is existed

  • set isPushReturnToLobbyButton true in the indexeddb

  • (client to server) villageMessage/ leaveWaitingPage.json

  • move from villageMessage to lobbyMessage

  • (client to server) lobbyMessage/ leaveWaitingPage.json

  • remove isHost from the indexeddb

  • remove buildVillage.json in the indexeddb

  • set isPushReturnToLobbyButton false in the indexeddb

A guest player returns to the lobby

  • set isHost false in the indexeddb

  • save buildVillage.json in the indexeddb

  • (play the game)

  • push the "Return to the lobby"

  • remove the next village id if it is existed

  • set isPushReturnToLobbyButton true in the indexeddb

  • move from villageMessage to lobbyMessage

  • remove isHost from the indexeddb

  • remove buildVillage.json in the indexeddb

  • set isPushReturnToLobbyButton false in the indexeddb

A guest player when the host player is returning to the lobby but they are still in the village

  • (client to server) the host player sends villageMessage/ leaveWaitingPage.json

  • (server to client) the guest players receives villageMessage/ nextGameInvitationIsClosed.json

  • undisplay the "Next game" button

  • remove nextGameVillageId from the indexeddb if it is existed.

Village message protocol examples for unit testing

Village message protocol schemata

Village message protocol contexts and IRIs

Context

Simply speaking, a context is used to map terms to IRIs. Terms are case sensitive and most valid strings that are not reserved JSON-LD keywords can be used as a term.

References

IRI (Internationalized Resource Identifiers [RFC3987])

IRIs (Internationalized Resource Identifiers [RFC3987]) are fundamental to Linked Data as that is how most nodes and properties are identified.

IRIs in the flavorText(.jsonld) context

IRIs in the vote(.jsonld) context

References