Skip to content

Firebase Overview

Subtlemon edited this page Apr 26, 2019 · 6 revisions

JSON Tree Overview

Node Descriptions

/rooms/{roomName}

Contains all data associated with a given room.

Children

/rooms/{roomName}/users

Contains presence of all users in the room, regardless of whether or not they're in game.

Data

  • User ID and nickname of all users.

Listeners

  • onDelete
    • Cloud Function Trigger to delete the parent room.
  • 'value'
    • Client listener to update lobby.

/rooms/{roomName}/game

Contains information associated with an active game. Games cannot start if this node already exists.

Children

/rooms/{roomName}/game/activePlayers

Contains presence of all users in game.

Listeners

  • onDelete
    • Cloud Function Trigger to delete the parent game.

/rooms/{roomName}/game/chains

Contains all chain data in the current game.

Data

  • A list of chains, which each contain a list of chain links. Each chain link contains a word/phrase or image, and the ID of the user that guessed/drew it.

/rooms/{roomName}/game/notReady

Contains presence of all users not ready to progress.

Listeners

  • 'value'
    • Client listener to progress through the game.

/rooms/{roomName}/game/settings

Contains settings for the current game.

Data

  • order (the order in which players will progress through the chains)
  • players (list of players that started the game)
  • Misc data (such as drawTime, the maximum allocated time to draw your word/phrase)

Listener

  • 'value'