Engagement Lab
- Learning Games Core Functionality Developed by Engagement Lab, 2016 ============== Common functionality game controller for the Lab's socket-based learning games
Initialize this game's session.
- Object gameSession Player socket ID
- Function callback Function to fire after session initialized
Gets a player's object given their socket ID
- String Player socket ID
- Boolean Player object, if found
Gets the game's type
- String Game's Type
Gets if session is resetting
- Boolean Is session restarting?
Gets if game is full of players
- Boolean Is game entirely full?
Is username a player entered available?
- String name Username
- Boolean Is username available?
Is player whose UID is provided still active?
- String Player UID
- Boolean Is player active?
Get if session is currently active.
- Boolean _game_in_session Is session active?
Flag the session as in restarting state
Reset session's state to default0
Begin the game's tutorial.
- Object Group moderator socket
Begin a cooldown clock for the session
- Object Group moderator socket
- Object Data object w/ duration, name of countdown
Pause or resume session's current cooldown clock. For debug purposes only and disabled for production.
Stop session's current cooldown clock.
Signaled when group moderator joins/re-joins session, setting up group socket and resuming game (if applicable)
- Object Group moderator's socket
Reset and delete this session, and force all players to disconnect. Optionally, wait a bit to end game in case moderator re-connects.
- Object Socket for group
- Boolean Wait xx seconds before ending game?
Join player to session, or re-connect them and sync s/he to session.
- Object The player object
- Object The player's socket
Deactivate player for now and start cooldown for them to re-join within, after which they're removed from session.
- String The player's socket ID
Remove the given player from the game and broadcast new player list.
- Object The player
Advance session's round while saving its data to DB.
Calculate/tally player's current round and total score.
- Object The player
- Boolean Current points value
Save the current 'state' of all players. When a player re-joins, we retrieve this state for them.
- String Event ID
- Object The event's rendered template
Save the session's current data to Mongo