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
ReadonlyuuidTrue, if this player has picked a song in player picks. Ommitted otherwise.
True, if the receiver is the host
Changes 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 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, SoundCloud and YT 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.
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.
The new playlist to add.
The playlist index to remove.
The new username.
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 for a game.
Must be a float between
and
Can be null to use random position (multiple choice) / let picker decide (player picks)
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 multiple choice answers to add.
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.
The name of the player that should get host.
Where to send the player to.
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.
The duration of the progressbar.
The number of seconds to offset the progress bar start point.
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 for a game.
Must be a float between
and
Can be null to use random position (multiple choice) / let picker decide (player picks)
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 multiple choice answers to add.
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.
The added log message.
The log level of the added message.
The current game phase.
Optionalquestion?: The round number.
URL to load music from.
The current countdown number. 0 to hide.
The songs that were played in this round.
The count of filtered songs.
Optionalplaylists?: {Currently selected playlist(s)
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!
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
The duration of the progressbar.
The number of seconds to offset the progress bar start point.
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, SoundCloud and YT 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.
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.
The new playlist to add.
The playlist index to remove.
The new username.
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 for a game.
Must be a float between
and
Can be null to use random position (multiple choice) / let picker decide (player picks)
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 multiple choice answers to add.
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.
The name of the player that should get host.
Where to send the player to.
The added log message.
The log level of the added message.
The current game phase.
Optionalquestion?: The round number.
URL to load music from.
The current countdown number. 0 to hide.
The songs that were played in this round.
The count of filtered songs.
Optionalplaylists?: {Currently selected playlist(s)
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!
Optionalerror: string
An 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
OptionalhasPicked?: booleanTrue, if this player has picked a song in player picks. Ommitted otherwise.
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
The server generated uuid, NOT the connection id.
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.