The current game phase
Whether the game has a picking phase.
Whether the game currently is running
The list of questions for the current game.
The timestamp when the current question started.
The current question round tick (in seconds).
A list of songs still available for use in the next round. This pool is used to avoid repeating songs within a single game session.
The name of the song artist.
A URL to the audio file of the song. Currently only audio previews from Apple Music and SoundCloud are allowed.
Cover URL of the song.
The URL users will be redirected to when clicking.
The name of the song.
ReadonlyroomCurrent round number. 1 based.
The current question.
ProtectedbaseProtectedSerializes only this base class to a PersistedAbstractGame object.
Should calculate the points for this question for all players that selected the correct answer.
Updates the derived classes with data from storage.
the serialized PersistedGame to update the derived game with
Destorys this Game object.
Ends the current game without returning to lobby and transitions to the results state.
whether to send an update that the game ended to the players.
Constructs an audio control load message.
must be "load" for a load message.
OptionalaudioURL: stringan ["audioURL"] to a music file that the client should preload.
a JSON string of the constructed AudioControlMessage
URL to load music from.
Constructs an audio control message.
the ["action"] that should be performed.
OptionalaudioURL: undefinedcan only be provided for load action.
a JSON string of the constructed AudioControlMessage
URL to load music from.
Should return an array of all required ServerMessages so clients know about the current game state.
OptionalsendPrevious: booleanwhether to include all messages for the question. Useful when client joins.
Optional_player: Playeran optional player that requested the game messages
URL to load music from.
Whether to perform advanced filtering tactics when generating the songs array. Currently just ignores parens when filtering for identical song names.
The music start position.
Used as default value in PlayerPicksGame, used as forced position in MultipleChoiceGame.
Whether to prefer distractions by the same artist.
Whether to directly end the round after all players answered.
The game mode being played.
The amount of time a player should have to pick a song.
The amount of rounds to play.
The time per question in each round.
A map of all active (online, non-spectating) players. Key is server generated uuid, NOT connection id.
The current game state
The player's unique identifier generated by the server. Not connection id!
The current version of the server.
The count of filtered songs.
Optionalplaylists?: {Currently selected playlist(s)
The current countdown number. 0 to hide.
The current game phase.
Optionalquestion?: The round number.
The songs that were played in this round.
The added log message.
The log level of the added message.
The duration of the progressbar.
The number of seconds to offset the progress bar start point.
Optionalerror?: stringOptional error message if the requested action could not be performed.
The message that is being confirmed.
The sequence number the pong should respond with
The sequence number asked for in the ping packet.
ProtectedgetCreates a random question for the next round.
Constructs a played songs update message with the songs played in the game.
a JSON string of the constructed UpdatePlayedSongsMessage
The songs that were played in this round.
Generates a progress bar update message based on the current game phase.
ProgressbarUpdateMessage with duration, startAt, and elapsed time for the progress bar.
The duration of the progressbar.
The number of seconds to offset the progress bar start point.
ProtectedgetCalled every time the game phase changed but before the game messages are sent.
the game state before the update.
Handles incoming client messages
the player that sent the message
the sent message
The new username.
The new playlist to add.
The playlist index to remove.
Whether to perform advanced filtering tactics when generating the songs array. Currently just ignores parens when filtering for identical song names.
The music start position.
Used as default value in PlayerPicksGame, used as forced position in MultipleChoiceGame.
Whether to prefer distractions by the same artist.
Whether to directly end the round after all players answered.
The game mode being played.
The amount of time a player should have to pick a song.
The amount of rounds to play.
The time per question in each round.
Optionalanswer?: stringProvided only for PlayerPicksGame. The string of the song name the player guessed.
OptionalanswerIndex?: numberProvided only for MultipleChoiceGame. The index of the selected answer.
Where to send the player to.
The name of the player that should get host.
The song the player picked in the choose step.
The name of the song artist.
A URL to the audio file of the song. Currently only audio previews from Apple Music and SoundCloud are allowed.
Cover URL of the song.
The URL users will be redirected to when clicking.
The name of the song.
The selected start pos for the song.
Optionalerror?: stringOptional error message if the requested action could not be performed.
The message that is being confirmed.
The sequence number the pong should respond with
The sequence number asked for in the ping packet.
whether the message was handled by this listener.
Called every time the tick loop of ValidRoom is run.
Save timestamp and answer, when user selects an answer.
the player that selected an answer.
Optionalanswer?: stringProvided only for PlayerPicksGame. The string of the song name the player guessed.
OptionalanswerIndex?: numberProvided only for MultipleChoiceGame. The index of the selected answer.
Starts a countdown, then starts the game loop. Also resets the game before starting. You must set/regenerate questions before calling this.
Serializes this game to a PersistedGame object.
Updates the game with data from storage.
the serialized PersistedGame to update the game with
The index of the current question. 0 based.