OptionalanswerOptionalanswer?: stringProvided only for PlayerPicksGame. The answer the player selected.
OptionalanswerIndex?: numberProvided only for MultipleChoiceGame. The index of the question the player selected.
The relative time in ms a player took to answer a round question.
The absolute time in ms where the player answered a round question.
The points the player got for the current question.
The player's color
ReadonlyconnWhether this player is an admin
Whether the player is marked as online.
Whether this player is a spectator.
OptionalkickHolds the Timeout which will kick the player after inactivity.
How many points the player had in the last round.
ReadonlyroomThe player's username
ReadonlyuuidChanges the username for this player.
The new username to set
true if the username was successfully changed, false if it's already in use
Handles a username change requested by the player.
The message with the username change request.
The new username.
Kicks this player from the room and mark it as offline.
the code to use when closing the socket.
the message to send with the code.
Must be called when this player connects to the room.
false if the room is full.
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.
Resets the inactivity timer for a specific player connection. If the timer expires before being refreshed again, the connection is closed.
Removes current answer data from a connection.
whether to also reset the points of a player.
Safely sends a JSON-serialized message to an online player.
The message object to be stringified and transmitted to the client.
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.
Whether to log the sent message
Sends a confirmation or error message to the player.
The source/type of the confirmation message
URL to load music from.
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.
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: stringAn optional error message to include in the confirmation
Constructs and sends an update message with the current room/connection states to the player.
Constructs a player update message.
whether to always return the full player message, including the answer data, ignoring game phase. default: false
a JSON string of the constructed PlayerMessage
OptionalanswerData?: {The current answer of this player.
Optionalanswer?: stringProvided only for PlayerPicksGame. The answer the player selected.
OptionalanswerIndex?: numberProvided only for MultipleChoiceGame. The index of the question the player selected.
The relative time in ms a player took to answer a round question.
The absolute time in ms where the player answered a round question.
The points the player got for the current question.
The player's color
True, if the receiver is the host
True, if this player is just spectating
How many points the player had in the last round.
The player's username
Serializes this player to a PersistedPlayer object.
StaticfromCreates a new Player object.
a reference to the ValidRoom object this player belongs to
the serialized PersistedPlayer to create this player from
The current answer of this player.