SongGuess
    Preparing search index...

    Implements

    Index

    Constructors

    Properties

    answerData?: {
        answer?: string;
        answerIndex?: number;
        answerSpeed: number;
        answerTimestamp: number;
        questionPoints: number;
    }

    The current answer of this player.

    Type Declaration

    • Optionalanswer?: string

      Provided only for PlayerPicksGame. The answer the player selected.

    • OptionalanswerIndex?: number

      Provided only for MultipleChoiceGame. The index of the question the player selected.

    • answerSpeed: number

      The relative time in ms a player took to answer a round question.

    • answerTimestamp: number

      The absolute time in ms where the player answered a round question.

    • questionPoints: number

      The points the player got for the current question.

    color: string = ""

    The player's color

    conn: Connection<string> | null
    connID: string
    isAdmin: boolean

    Whether this player is an admin

    isOnline: boolean = false

    Whether the player is marked as online.

    isSpectator: boolean = false

    Whether this player is a spectator.

    kickPlayerTimeout?: Timeout

    Holds the Timeout which will kick the player after inactivity.

    points: number = 0

    How many points the player had in the last round.

    room: ValidRoom
    username: string = ""

    The player's username

    uuid: string

    Accessors

    • get isHost(): boolean

      Whether this player is host.

      Returns boolean

    Methods

    • Changes the username for this player.

      Parameters

      • username: string

        The new username to set

      Returns boolean

      true if the username was successfully changed, false if it's already in use

    • Handles a username change requested by the player.

      Parameters

      • msg: { type: "change_username"; username: string }

        The message with the username change request.

        • type: "change_username"
        • username: string

          The new username.

      Returns void

    • Kicks this player from the room and mark it as offline.

      Parameters

      • code: number

        the code to use when closing the socket.

      • msg: string

        the message to send with the code.

      Returns void

    • Must be called when this player connects to the room.

      Parameters

      • ctx: ConnectionContext

      Returns boolean

      false if the room is full.

    • Handles incoming client messages

      Parameters

      • player: Player

        the player that sent the message

      • msg:
            | { type: "change_username"; username: string }
            | {
                playlists: {
                    cover: string | null;
                    hrefURL: string;
                    name: string;
                    songs: {
                        artist: string;
                        audioURL: string;
                        cover: string | null;
                        hrefURL: string;
                        name: string;
                    }[];
                    subtitle?: string;
                }[];
                type: "add_playlists";
            }
            | { index: number
            | null; type: "remove_playlist" }
            | {
                advancedSongFiltering: boolean;
                audioStartPosition: number;
                distractionsPreferSameArtist: boolean;
                endWhenAnswered: boolean;
                gameMode: "multiple_choice" | "player_picks";
                playerPickTimeout: number;
                roundsCount: number;
                timePerQuestion: number;
                type: "room_config";
            }
            | { type: "start_game" }
            | { answer?: string; answerIndex?: number; type: "select_answer" }
            | { type: "return_to"; where: "lobby" | "results" }
            | { playerName: string; type: "transfer_host" }
            | {
                song: {
                    artist: string;
                    audioURL: string;
                    cover: string | null;
                    hrefURL: string;
                    name: string;
                };
                startPos: number;
                type: "player_pick_song";
            }
            | {
                error?: string;
                sourceMessage: | {
                    action: "load";
                    audioURL: string;
                    type: "audio_control";
                }
                | {
                    action: | "play"
                    | "pause"
                    | "play_countdown_running"
                    | "play_countdown_end";
                    type: "audio_control";
                }
                | { type: "change_username"; username: string }
                | {
                    playlists: {
                        cover: string | null;
                        hrefURL: string;
                        name: string;
                        songs: {
                            artist: string;
                            audioURL: string;
                            cover: string | null;
                            hrefURL: string;
                            name: string;
                        }[];
                        subtitle?: string;
                    }[];
                    type: "add_playlists";
                }
                | { index: number
                | null; type: "remove_playlist" }
                | {
                    advancedSongFiltering: boolean;
                    audioStartPosition: number;
                    distractionsPreferSameArtist: boolean;
                    endWhenAnswered: boolean;
                    gameMode: "multiple_choice" | "player_picks";
                    playerPickTimeout: number;
                    roundsCount: number;
                    timePerQuestion: number;
                    type: "room_config";
                }
                | { type: "start_game" }
                | { answer?: string; answerIndex?: number; type: "select_answer" }
                | { type: "return_to"; where: "lobby" | "results" }
                | { playerName: string; type: "transfer_host" }
                | {
                    song: {
                        artist: string;
                        audioURL: string;
                        cover: string | null;
                        hrefURL: string;
                        name: string;
                    };
                    startPos: number;
                    type: "player_pick_song";
                }
                | {
                    players: Record<
                        string,
                        {
                            answerData?: {
                                answer?: string;
                                answerIndex?: number;
                                answerSpeed: number;
                                answerTimestamp: number;
                                questionPoints: number;
                            };
                            color: string;
                            isHost: boolean;
                            isSpectator: boolean;
                            points: number;
                            username: string;
                        },
                    >;
                    state: "lobby"
                    | "results"
                    | "ingame";
                    type: "room_state";
                    uuid: string;
                    version: string;
                }
                | {
                    filteredSongsCount: number;
                    playlists?: {
                        cover: string
                        | null;
                        hrefURL: string;
                        name: string;
                        songs: {
                            artist: string;
                            audioURL: string;
                            cover: string | null;
                            hrefURL: string;
                            name: string;
                        }[];
                        subtitle?: string;
                    }[];
                    type: "update_playlists";
                }
                | { countdown: number; type: "countdown" }
                | {
                    gamePhase: GamePhase;
                    question?:
                        | {
                            answerOptions: string[];
                            correctAnswerIndex?: number;
                            questionType: "multiple_choice";
                            startPos: number;
                        }
                        | {
                            correctAnswer?: {
                                artist: string;
                                audioURL: string;
                                cover: string
                                | null;
                                hrefURL: string;
                                name: string;
                            };
                            pickerId: string;
                            questionCount: number;
                            questionCurrent: number;
                            questionType: "player_picks";
                            startPos: number;
                        };
                    roundCurrent: number;
                    type: "round_state";
                }
                | {
                    songs: {
                        artist: string;
                        audioURL: string;
                        cover: string
                        | null;
                        hrefURL: string;
                        name: string;
                    }[];
                    type: "update_played_songs";
                }
                | {
                    entry: LogEntry;
                    level: "error"
                    | "info"
                    | "warn"
                    | "debug";
                    type: "add_log_message";
                }
                | { messages: LoggerStorage; type: "update_log_messages" }
                | { duration: number; offset: number; type: "progressbar_update" }
                | { type: "other" };
                type: "confirmation";
            }
            | { seq: number; type: "ping" }
            | { seq: number; type: "pong" }

        the sent message

        • { type: "change_username"; username: string }
          • type: "change_username"
          • username: string

            The new username.

        • {
              playlists: {
                  cover: string | null;
                  hrefURL: string;
                  name: string;
                  songs: {
                      artist: string;
                      audioURL: string;
                      cover: string | null;
                      hrefURL: string;
                      name: string;
                  }[];
                  subtitle?: string;
              }[];
              type: "add_playlists";
          }
          • playlists: {
                cover: string | null;
                hrefURL: string;
                name: string;
                songs: {
                    artist: string;
                    audioURL: string;
                    cover: string | null;
                    hrefURL: string;
                    name: string;
                }[];
                subtitle?: string;
            }[]

            The new playlist to add.

          • type: "add_playlists"
        • { index: number | null; type: "remove_playlist" }
          • index: number | null

            The playlist index to remove.

          • type: "remove_playlist"
        • {
              advancedSongFiltering: boolean;
              audioStartPosition: number;
              distractionsPreferSameArtist: boolean;
              endWhenAnswered: boolean;
              gameMode: "multiple_choice" | "player_picks";
              playerPickTimeout: number;
              roundsCount: number;
              timePerQuestion: number;
              type: "room_config";
          }
          • advancedSongFiltering: boolean

            Whether to perform advanced filtering tactics when generating the songs array. Currently just ignores parens when filtering for identical song names.

          • audioStartPosition: number

            The music start position.

            • 0: start of audio
            • 1: close to middle of audio
            • 2: close to end of audio
            • 3: random of the above

            Used as default value in PlayerPicksGame, used as forced position in MultipleChoiceGame.

          • distractionsPreferSameArtist: boolean

            Whether to prefer distractions by the same artist.

          • endWhenAnswered: boolean

            Whether to directly end the round after all players answered.

          • gameMode: "multiple_choice" | "player_picks"

            The game mode being played.

            • multiple_choice: the server selects random songs from the provided playlist and provides a multiple choice question with distractions.
            • player_picks: a player from the room picks a song for other players to guess each round. other players have to guess the song title by typing.
          • playerPickTimeout: number

            The amount of time a player should have to pick a song.

          • roundsCount: number

            The amount of rounds to play.

          • timePerQuestion: number

            The time per question in each round.

          • type: "room_config"
        • { type: "start_game" }
        • { answer?: string; answerIndex?: number; type: "select_answer" }
          • Optionalanswer?: string

            Provided only for PlayerPicksGame. The string of the song name the player guessed.

          • OptionalanswerIndex?: number

            Provided only for MultipleChoiceGame. The index of the selected answer.

          • type: "select_answer"
        • { type: "return_to"; where: "lobby" | "results" }
          • type: "return_to"
          • where: "lobby" | "results"

            Where to send the player to.

        • { playerName: string; type: "transfer_host" }
          • playerName: string

            The name of the player that should get host.

          • type: "transfer_host"
        • {
              song: {
                  artist: string;
                  audioURL: string;
                  cover: string | null;
                  hrefURL: string;
                  name: string;
              };
              startPos: number;
              type: "player_pick_song";
          }
          • song: {
                artist: string;
                audioURL: string;
                cover: string | null;
                hrefURL: string;
                name: string;
            }

            The song the player picked in the choose step.

            • artist: string

              The name of the song artist.

            • audioURL: string

              A URL to the audio file of the song. Currently only audio previews from Apple Music and SoundCloud are allowed.

            • cover: string | null

              Cover URL of the song.

            • hrefURL: string

              The URL users will be redirected to when clicking.

            • name: string

              The name of the song.

          • startPos: number

            The selected start pos for the song.

            RoomConfigMessageSchema.audioStartPosition

          • type: "player_pick_song"
        • {
              error?: string;
              sourceMessage:
                  | { action: "load"; audioURL: string; type: "audio_control" }
                  | {
                      action:
                          | "play"
                          | "pause"
                          | "play_countdown_running"
                          | "play_countdown_end";
                      type: "audio_control";
                  }
                  | { type: "change_username"; username: string }
                  | {
                      playlists: {
                          cover: string | null;
                          hrefURL: string;
                          name: string;
                          songs: {
                              artist: string;
                              audioURL: string;
                              cover: string | null;
                              hrefURL: string;
                              name: string;
                          }[];
                          subtitle?: string;
                      }[];
                      type: "add_playlists";
                  }
                  | { index: number
                  | null; type: "remove_playlist" }
                  | {
                      advancedSongFiltering: boolean;
                      audioStartPosition: number;
                      distractionsPreferSameArtist: boolean;
                      endWhenAnswered: boolean;
                      gameMode: "multiple_choice" | "player_picks";
                      playerPickTimeout: number;
                      roundsCount: number;
                      timePerQuestion: number;
                      type: "room_config";
                  }
                  | { type: "start_game" }
                  | { answer?: string; answerIndex?: number; type: "select_answer" }
                  | { type: "return_to"; where: "lobby" | "results" }
                  | { playerName: string; type: "transfer_host" }
                  | {
                      song: {
                          artist: string;
                          audioURL: string;
                          cover: string | null;
                          hrefURL: string;
                          name: string;
                      };
                      startPos: number;
                      type: "player_pick_song";
                  }
                  | {
                      players: Record<
                          string,
                          {
                              answerData?: {
                                  answer?: string;
                                  answerIndex?: number;
                                  answerSpeed: number;
                                  answerTimestamp: number;
                                  questionPoints: number;
                              };
                              color: string;
                              isHost: boolean;
                              isSpectator: boolean;
                              points: number;
                              username: string;
                          },
                      >;
                      state: "lobby"
                      | "results"
                      | "ingame";
                      type: "room_state";
                      uuid: string;
                      version: string;
                  }
                  | {
                      filteredSongsCount: number;
                      playlists?: {
                          cover: string
                          | null;
                          hrefURL: string;
                          name: string;
                          songs: {
                              artist: string;
                              audioURL: string;
                              cover: string | null;
                              hrefURL: string;
                              name: string;
                          }[];
                          subtitle?: string;
                      }[];
                      type: "update_playlists";
                  }
                  | { countdown: number; type: "countdown" }
                  | {
                      gamePhase: GamePhase;
                      question?:
                          | {
                              answerOptions: string[];
                              correctAnswerIndex?: number;
                              questionType: "multiple_choice";
                              startPos: number;
                          }
                          | {
                              correctAnswer?: {
                                  artist: string;
                                  audioURL: string;
                                  cover: string
                                  | null;
                                  hrefURL: string;
                                  name: string;
                              };
                              pickerId: string;
                              questionCount: number;
                              questionCurrent: number;
                              questionType: "player_picks";
                              startPos: number;
                          };
                      roundCurrent: number;
                      type: "round_state";
                  }
                  | {
                      songs: {
                          artist: string;
                          audioURL: string;
                          cover: string
                          | null;
                          hrefURL: string;
                          name: string;
                      }[];
                      type: "update_played_songs";
                  }
                  | {
                      entry: LogEntry;
                      level: "error"
                      | "info"
                      | "warn"
                      | "debug";
                      type: "add_log_message";
                  }
                  | { messages: LoggerStorage; type: "update_log_messages" }
                  | { duration: number; offset: number; type: "progressbar_update" }
                  | { type: "other" };
              type: "confirmation";
          }
          • Optionalerror?: string

            Optional error message if the requested action could not be performed.

          • sourceMessage:
                | { action: "load"; audioURL: string; type: "audio_control" }
                | {
                    action:
                        | "play"
                        | "pause"
                        | "play_countdown_running"
                        | "play_countdown_end";
                    type: "audio_control";
                }
                | { type: "change_username"; username: string }
                | {
                    playlists: {
                        cover: string | null;
                        hrefURL: string;
                        name: string;
                        songs: {
                            artist: string;
                            audioURL: string;
                            cover: string | null;
                            hrefURL: string;
                            name: string;
                        }[];
                        subtitle?: string;
                    }[];
                    type: "add_playlists";
                }
                | { index: number
                | null; type: "remove_playlist" }
                | {
                    advancedSongFiltering: boolean;
                    audioStartPosition: number;
                    distractionsPreferSameArtist: boolean;
                    endWhenAnswered: boolean;
                    gameMode: "multiple_choice" | "player_picks";
                    playerPickTimeout: number;
                    roundsCount: number;
                    timePerQuestion: number;
                    type: "room_config";
                }
                | { type: "start_game" }
                | { answer?: string; answerIndex?: number; type: "select_answer" }
                | { type: "return_to"; where: "lobby" | "results" }
                | { playerName: string; type: "transfer_host" }
                | {
                    song: {
                        artist: string;
                        audioURL: string;
                        cover: string | null;
                        hrefURL: string;
                        name: string;
                    };
                    startPos: number;
                    type: "player_pick_song";
                }
                | {
                    players: Record<
                        string,
                        {
                            answerData?: {
                                answer?: string;
                                answerIndex?: number;
                                answerSpeed: number;
                                answerTimestamp: number;
                                questionPoints: number;
                            };
                            color: string;
                            isHost: boolean;
                            isSpectator: boolean;
                            points: number;
                            username: string;
                        },
                    >;
                    state: "lobby"
                    | "results"
                    | "ingame";
                    type: "room_state";
                    uuid: string;
                    version: string;
                }
                | {
                    filteredSongsCount: number;
                    playlists?: {
                        cover: string
                        | null;
                        hrefURL: string;
                        name: string;
                        songs: {
                            artist: string;
                            audioURL: string;
                            cover: string | null;
                            hrefURL: string;
                            name: string;
                        }[];
                        subtitle?: string;
                    }[];
                    type: "update_playlists";
                }
                | { countdown: number; type: "countdown" }
                | {
                    gamePhase: GamePhase;
                    question?:
                        | {
                            answerOptions: string[];
                            correctAnswerIndex?: number;
                            questionType: "multiple_choice";
                            startPos: number;
                        }
                        | {
                            correctAnswer?: {
                                artist: string;
                                audioURL: string;
                                cover: string
                                | null;
                                hrefURL: string;
                                name: string;
                            };
                            pickerId: string;
                            questionCount: number;
                            questionCurrent: number;
                            questionType: "player_picks";
                            startPos: number;
                        };
                    roundCurrent: number;
                    type: "round_state";
                }
                | {
                    songs: {
                        artist: string;
                        audioURL: string;
                        cover: string
                        | null;
                        hrefURL: string;
                        name: string;
                    }[];
                    type: "update_played_songs";
                }
                | {
                    entry: LogEntry;
                    level: "error"
                    | "info"
                    | "warn"
                    | "debug";
                    type: "add_log_message";
                }
                | { messages: LoggerStorage; type: "update_log_messages" }
                | { duration: number; offset: number; type: "progressbar_update" }
                | { type: "other" }

            The message that is being confirmed.

          • type: "confirmation"
        • { seq: number; type: "ping" }
          • seq: number

            The sequence number the pong should respond with

          • type: "ping"
        • { seq: number; type: "pong" }
          • seq: number

            The sequence number asked for in the ping packet.

          • type: "pong"

      Returns boolean

      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.

      Returns void

    • Removes current answer data from a connection.

      Parameters

      • resetPoints: boolean = false

        whether to also reset the points of a player.

      Returns void

    • Safely sends a JSON-serialized message to an online player.

      Parameters

      • msg:
            | { action: "load"; audioURL: string; type: "audio_control" }
            | {
                action:
                    | "play"
                    | "pause"
                    | "play_countdown_running"
                    | "play_countdown_end";
                type: "audio_control";
            }
            | {
                advancedSongFiltering: boolean;
                audioStartPosition: number;
                distractionsPreferSameArtist: boolean;
                endWhenAnswered: boolean;
                gameMode: "multiple_choice"
                | "player_picks";
                playerPickTimeout: number;
                roundsCount: number;
                timePerQuestion: number;
                type: "room_config";
            }
            | {
                players: Record<
                    string,
                    {
                        answerData?: {
                            answer?: string;
                            answerIndex?: number;
                            answerSpeed: number;
                            answerTimestamp: number;
                            questionPoints: number;
                        };
                        color: string;
                        isHost: boolean;
                        isSpectator: boolean;
                        points: number;
                        username: string;
                    },
                >;
                state: "lobby"
                | "results"
                | "ingame";
                type: "room_state";
                uuid: string;
                version: string;
            }
            | {
                filteredSongsCount: number;
                playlists?: {
                    cover: string
                    | null;
                    hrefURL: string;
                    name: string;
                    songs: {
                        artist: string;
                        audioURL: string;
                        cover: string | null;
                        hrefURL: string;
                        name: string;
                    }[];
                    subtitle?: string;
                }[];
                type: "update_playlists";
            }
            | { countdown: number; type: "countdown" }
            | {
                gamePhase: GamePhase;
                question?:
                    | {
                        answerOptions: string[];
                        correctAnswerIndex?: number;
                        questionType: "multiple_choice";
                        startPos: number;
                    }
                    | {
                        correctAnswer?: {
                            artist: string;
                            audioURL: string;
                            cover: string
                            | null;
                            hrefURL: string;
                            name: string;
                        };
                        pickerId: string;
                        questionCount: number;
                        questionCurrent: number;
                        questionType: "player_picks";
                        startPos: number;
                    };
                roundCurrent: number;
                type: "round_state";
            }
            | {
                songs: {
                    artist: string;
                    audioURL: string;
                    cover: string
                    | null;
                    hrefURL: string;
                    name: string;
                }[];
                type: "update_played_songs";
            }
            | {
                entry: LogEntry;
                level: "error"
                | "info"
                | "warn"
                | "debug";
                type: "add_log_message";
            }
            | { messages: LoggerStorage; type: "update_log_messages" }
            | { duration: number; offset: number; type: "progressbar_update" }
            | {
                error?: string;
                sourceMessage:
                    | { action: "load"; audioURL: string; type: "audio_control" }
                    | {
                        action:
                            | "play"
                            | "pause"
                            | "play_countdown_running"
                            | "play_countdown_end";
                        type: "audio_control";
                    }
                    | { type: "change_username"; username: string }
                    | {
                        playlists: {
                            cover: string | null;
                            hrefURL: string;
                            name: string;
                            songs: {
                                artist: string;
                                audioURL: string;
                                cover: string | null;
                                hrefURL: string;
                                name: string;
                            }[];
                            subtitle?: string;
                        }[];
                        type: "add_playlists";
                    }
                    | { index: number
                    | null; type: "remove_playlist" }
                    | {
                        advancedSongFiltering: boolean;
                        audioStartPosition: number;
                        distractionsPreferSameArtist: boolean;
                        endWhenAnswered: boolean;
                        gameMode: "multiple_choice" | "player_picks";
                        playerPickTimeout: number;
                        roundsCount: number;
                        timePerQuestion: number;
                        type: "room_config";
                    }
                    | { type: "start_game" }
                    | { answer?: string; answerIndex?: number; type: "select_answer" }
                    | { type: "return_to"; where: "lobby" | "results" }
                    | { playerName: string; type: "transfer_host" }
                    | {
                        song: {
                            artist: string;
                            audioURL: string;
                            cover: string | null;
                            hrefURL: string;
                            name: string;
                        };
                        startPos: number;
                        type: "player_pick_song";
                    }
                    | {
                        players: Record<
                            string,
                            {
                                answerData?: {
                                    answer?: string;
                                    answerIndex?: number;
                                    answerSpeed: number;
                                    answerTimestamp: number;
                                    questionPoints: number;
                                };
                                color: string;
                                isHost: boolean;
                                isSpectator: boolean;
                                points: number;
                                username: string;
                            },
                        >;
                        state: "lobby"
                        | "results"
                        | "ingame";
                        type: "room_state";
                        uuid: string;
                        version: string;
                    }
                    | {
                        filteredSongsCount: number;
                        playlists?: {
                            cover: string
                            | null;
                            hrefURL: string;
                            name: string;
                            songs: {
                                artist: string;
                                audioURL: string;
                                cover: string | null;
                                hrefURL: string;
                                name: string;
                            }[];
                            subtitle?: string;
                        }[];
                        type: "update_playlists";
                    }
                    | { countdown: number; type: "countdown" }
                    | {
                        gamePhase: GamePhase;
                        question?:
                            | {
                                answerOptions: string[];
                                correctAnswerIndex?: number;
                                questionType: "multiple_choice";
                                startPos: number;
                            }
                            | {
                                correctAnswer?: {
                                    artist: string;
                                    audioURL: string;
                                    cover: string
                                    | null;
                                    hrefURL: string;
                                    name: string;
                                };
                                pickerId: string;
                                questionCount: number;
                                questionCurrent: number;
                                questionType: "player_picks";
                                startPos: number;
                            };
                        roundCurrent: number;
                        type: "round_state";
                    }
                    | {
                        songs: {
                            artist: string;
                            audioURL: string;
                            cover: string
                            | null;
                            hrefURL: string;
                            name: string;
                        }[];
                        type: "update_played_songs";
                    }
                    | {
                        entry: LogEntry;
                        level: "error"
                        | "info"
                        | "warn"
                        | "debug";
                        type: "add_log_message";
                    }
                    | { messages: LoggerStorage; type: "update_log_messages" }
                    | { duration: number; offset: number; type: "progressbar_update" }
                    | { type: "other" };
                type: "confirmation";
            }
            | { seq: number; type: "ping" }
            | { seq: number; type: "pong" }

        The message object to be stringified and transmitted to the client.

        • { action: "load"; audioURL: string; type: "audio_control" }
          • action: "load"
            • "load": Downloads the music.
          • audioURL: string

            URL to load music from.

          • type: "audio_control"
        • {
              action:
                  | "play"
                  | "pause"
                  | "play_countdown_running"
                  | "play_countdown_end";
              type: "audio_control";
          }
          • action: "play" | "pause" | "play_countdown_running" | "play_countdown_end"
            • "play": Starts playback of the music.
            • "pause": Pauses playback of the music.
            • "play_countdown_running": Plays the countdown_running sound effect on a secondary audio player.
            • "play_countdown_end": Plays the countdown_end sound effect on a secondary audio player.
          • type: "audio_control"
        • {
              advancedSongFiltering: boolean;
              audioStartPosition: number;
              distractionsPreferSameArtist: boolean;
              endWhenAnswered: boolean;
              gameMode: "multiple_choice" | "player_picks";
              playerPickTimeout: number;
              roundsCount: number;
              timePerQuestion: number;
              type: "room_config";
          }
          • advancedSongFiltering: boolean

            Whether to perform advanced filtering tactics when generating the songs array. Currently just ignores parens when filtering for identical song names.

          • audioStartPosition: number

            The music start position.

            • 0: start of audio
            • 1: close to middle of audio
            • 2: close to end of audio
            • 3: random of the above

            Used as default value in PlayerPicksGame, used as forced position in MultipleChoiceGame.

          • distractionsPreferSameArtist: boolean

            Whether to prefer distractions by the same artist.

          • endWhenAnswered: boolean

            Whether to directly end the round after all players answered.

          • gameMode: "multiple_choice" | "player_picks"

            The game mode being played.

            • multiple_choice: the server selects random songs from the provided playlist and provides a multiple choice question with distractions.
            • player_picks: a player from the room picks a song for other players to guess each round. other players have to guess the song title by typing.
          • playerPickTimeout: number

            The amount of time a player should have to pick a song.

          • roundsCount: number

            The amount of rounds to play.

          • timePerQuestion: number

            The time per question in each round.

          • type: "room_config"
        • {
              players: Record<
                  string,
                  {
                      answerData?: {
                          answer?: string;
                          answerIndex?: number;
                          answerSpeed: number;
                          answerTimestamp: number;
                          questionPoints: number;
                      };
                      color: string;
                      isHost: boolean;
                      isSpectator: boolean;
                      points: number;
                      username: string;
                  },
              >;
              state: "lobby"
              | "results"
              | "ingame";
              type: "room_state";
              uuid: string;
              version: string;
          }
          • players: Record<
                string,
                {
                    answerData?: {
                        answer?: string;
                        answerIndex?: number;
                        answerSpeed: number;
                        answerTimestamp: number;
                        questionPoints: number;
                    };
                    color: string;
                    isHost: boolean;
                    isSpectator: boolean;
                    points: number;
                    username: string;
                },
            >

            A map of all active (online, non-spectating) players. Key is server generated uuid, NOT connection id.

          • state: "lobby" | "results" | "ingame"

            The current game state

          • type: "room_state"
          • uuid: string

            The player's unique identifier generated by the server. Not connection id!

          • version: string

            The current version of the server.

        • {
              filteredSongsCount: number;
              playlists?: {
                  cover: string | null;
                  hrefURL: string;
                  name: string;
                  songs: {
                      artist: string;
                      audioURL: string;
                      cover: string | null;
                      hrefURL: string;
                      name: string;
                  }[];
                  subtitle?: string;
              }[];
              type: "update_playlists";
          }
          • filteredSongsCount: number

            The count of filtered songs.

            filterSongs

          • Optionalplaylists?: {
                cover: string | null;
                hrefURL: string;
                name: string;
                songs: {
                    artist: string;
                    audioURL: string;
                    cover: string | null;
                    hrefURL: string;
                    name: string;
                }[];
                subtitle?: string;
            }[]

            Currently selected playlist(s)

          • type: "update_playlists"
        • { countdown: number; type: "countdown" }
          • countdown: number

            The current countdown number. 0 to hide.

          • type: "countdown"
        • {
              gamePhase: GamePhase;
              question?:
                  | {
                      answerOptions: string[];
                      correctAnswerIndex?: number;
                      questionType: "multiple_choice";
                      startPos: number;
                  }
                  | {
                      correctAnswer?: {
                          artist: string;
                          audioURL: string;
                          cover: string
                          | null;
                          hrefURL: string;
                          name: string;
                      };
                      pickerId: string;
                      questionCount: number;
                      questionCurrent: number;
                      questionType: "player_picks";
                      startPos: number;
                  };
              roundCurrent: number;
              type: "round_state";
          }
          • gamePhase: GamePhase

            The current game phase.

            GamePhase

          • Optionalquestion?:
                | {
                    answerOptions: string[];
                    correctAnswerIndex?: number;
                    questionType: "multiple_choice";
                    startPos: number;
                }
                | {
                    correctAnswer?: {
                        artist: string;
                        audioURL: string;
                        cover: string
                        | null;
                        hrefURL: string;
                        name: string;
                    };
                    pickerId: string;
                    questionCount: number;
                    questionCurrent: number;
                    questionType: "player_picks";
                    startPos: number;
                }
          • roundCurrent: number

            The round number.

          • type: "round_state"
        • {
              songs: {
                  artist: string;
                  audioURL: string;
                  cover: string | null;
                  hrefURL: string;
                  name: string;
              }[];
              type: "update_played_songs";
          }
          • songs: {
                artist: string;
                audioURL: string;
                cover: string | null;
                hrefURL: string;
                name: string;
            }[]

            The songs that were played in this round.

          • type: "update_played_songs"
        • {
              entry: LogEntry;
              level: "error" | "info" | "warn" | "debug";
              type: "add_log_message";
          }
          • entry: LogEntry

            The added log message.

          • level: "error" | "info" | "warn" | "debug"

            The log level of the added message.

          • type: "add_log_message"
        • { messages: LoggerStorage; type: "update_log_messages" }
        • { duration: number; offset: number; type: "progressbar_update" }
          • duration: number

            The duration of the progressbar.

          • offset: number

            The number of seconds to offset the progress bar start point.

          • type: "progressbar_update"
        • {
              error?: string;
              sourceMessage:
                  | { action: "load"; audioURL: string; type: "audio_control" }
                  | {
                      action:
                          | "play"
                          | "pause"
                          | "play_countdown_running"
                          | "play_countdown_end";
                      type: "audio_control";
                  }
                  | { type: "change_username"; username: string }
                  | {
                      playlists: {
                          cover: string | null;
                          hrefURL: string;
                          name: string;
                          songs: {
                              artist: string;
                              audioURL: string;
                              cover: string | null;
                              hrefURL: string;
                              name: string;
                          }[];
                          subtitle?: string;
                      }[];
                      type: "add_playlists";
                  }
                  | { index: number
                  | null; type: "remove_playlist" }
                  | {
                      advancedSongFiltering: boolean;
                      audioStartPosition: number;
                      distractionsPreferSameArtist: boolean;
                      endWhenAnswered: boolean;
                      gameMode: "multiple_choice" | "player_picks";
                      playerPickTimeout: number;
                      roundsCount: number;
                      timePerQuestion: number;
                      type: "room_config";
                  }
                  | { type: "start_game" }
                  | { answer?: string; answerIndex?: number; type: "select_answer" }
                  | { type: "return_to"; where: "lobby" | "results" }
                  | { playerName: string; type: "transfer_host" }
                  | {
                      song: {
                          artist: string;
                          audioURL: string;
                          cover: string | null;
                          hrefURL: string;
                          name: string;
                      };
                      startPos: number;
                      type: "player_pick_song";
                  }
                  | {
                      players: Record<
                          string,
                          {
                              answerData?: {
                                  answer?: string;
                                  answerIndex?: number;
                                  answerSpeed: number;
                                  answerTimestamp: number;
                                  questionPoints: number;
                              };
                              color: string;
                              isHost: boolean;
                              isSpectator: boolean;
                              points: number;
                              username: string;
                          },
                      >;
                      state: "lobby"
                      | "results"
                      | "ingame";
                      type: "room_state";
                      uuid: string;
                      version: string;
                  }
                  | {
                      filteredSongsCount: number;
                      playlists?: {
                          cover: string
                          | null;
                          hrefURL: string;
                          name: string;
                          songs: {
                              artist: string;
                              audioURL: string;
                              cover: string | null;
                              hrefURL: string;
                              name: string;
                          }[];
                          subtitle?: string;
                      }[];
                      type: "update_playlists";
                  }
                  | { countdown: number; type: "countdown" }
                  | {
                      gamePhase: GamePhase;
                      question?:
                          | {
                              answerOptions: string[];
                              correctAnswerIndex?: number;
                              questionType: "multiple_choice";
                              startPos: number;
                          }
                          | {
                              correctAnswer?: {
                                  artist: string;
                                  audioURL: string;
                                  cover: string
                                  | null;
                                  hrefURL: string;
                                  name: string;
                              };
                              pickerId: string;
                              questionCount: number;
                              questionCurrent: number;
                              questionType: "player_picks";
                              startPos: number;
                          };
                      roundCurrent: number;
                      type: "round_state";
                  }
                  | {
                      songs: {
                          artist: string;
                          audioURL: string;
                          cover: string
                          | null;
                          hrefURL: string;
                          name: string;
                      }[];
                      type: "update_played_songs";
                  }
                  | {
                      entry: LogEntry;
                      level: "error"
                      | "info"
                      | "warn"
                      | "debug";
                      type: "add_log_message";
                  }
                  | { messages: LoggerStorage; type: "update_log_messages" }
                  | { duration: number; offset: number; type: "progressbar_update" }
                  | { type: "other" };
              type: "confirmation";
          }
          • Optionalerror?: string

            Optional error message if the requested action could not be performed.

          • sourceMessage:
                | { action: "load"; audioURL: string; type: "audio_control" }
                | {
                    action:
                        | "play"
                        | "pause"
                        | "play_countdown_running"
                        | "play_countdown_end";
                    type: "audio_control";
                }
                | { type: "change_username"; username: string }
                | {
                    playlists: {
                        cover: string | null;
                        hrefURL: string;
                        name: string;
                        songs: {
                            artist: string;
                            audioURL: string;
                            cover: string | null;
                            hrefURL: string;
                            name: string;
                        }[];
                        subtitle?: string;
                    }[];
                    type: "add_playlists";
                }
                | { index: number
                | null; type: "remove_playlist" }
                | {
                    advancedSongFiltering: boolean;
                    audioStartPosition: number;
                    distractionsPreferSameArtist: boolean;
                    endWhenAnswered: boolean;
                    gameMode: "multiple_choice" | "player_picks";
                    playerPickTimeout: number;
                    roundsCount: number;
                    timePerQuestion: number;
                    type: "room_config";
                }
                | { type: "start_game" }
                | { answer?: string; answerIndex?: number; type: "select_answer" }
                | { type: "return_to"; where: "lobby" | "results" }
                | { playerName: string; type: "transfer_host" }
                | {
                    song: {
                        artist: string;
                        audioURL: string;
                        cover: string | null;
                        hrefURL: string;
                        name: string;
                    };
                    startPos: number;
                    type: "player_pick_song";
                }
                | {
                    players: Record<
                        string,
                        {
                            answerData?: {
                                answer?: string;
                                answerIndex?: number;
                                answerSpeed: number;
                                answerTimestamp: number;
                                questionPoints: number;
                            };
                            color: string;
                            isHost: boolean;
                            isSpectator: boolean;
                            points: number;
                            username: string;
                        },
                    >;
                    state: "lobby"
                    | "results"
                    | "ingame";
                    type: "room_state";
                    uuid: string;
                    version: string;
                }
                | {
                    filteredSongsCount: number;
                    playlists?: {
                        cover: string
                        | null;
                        hrefURL: string;
                        name: string;
                        songs: {
                            artist: string;
                            audioURL: string;
                            cover: string | null;
                            hrefURL: string;
                            name: string;
                        }[];
                        subtitle?: string;
                    }[];
                    type: "update_playlists";
                }
                | { countdown: number; type: "countdown" }
                | {
                    gamePhase: GamePhase;
                    question?:
                        | {
                            answerOptions: string[];
                            correctAnswerIndex?: number;
                            questionType: "multiple_choice";
                            startPos: number;
                        }
                        | {
                            correctAnswer?: {
                                artist: string;
                                audioURL: string;
                                cover: string
                                | null;
                                hrefURL: string;
                                name: string;
                            };
                            pickerId: string;
                            questionCount: number;
                            questionCurrent: number;
                            questionType: "player_picks";
                            startPos: number;
                        };
                    roundCurrent: number;
                    type: "round_state";
                }
                | {
                    songs: {
                        artist: string;
                        audioURL: string;
                        cover: string
                        | null;
                        hrefURL: string;
                        name: string;
                    }[];
                    type: "update_played_songs";
                }
                | {
                    entry: LogEntry;
                    level: "error"
                    | "info"
                    | "warn"
                    | "debug";
                    type: "add_log_message";
                }
                | { messages: LoggerStorage; type: "update_log_messages" }
                | { duration: number; offset: number; type: "progressbar_update" }
                | { type: "other" }

            The message that is being confirmed.

          • type: "confirmation"
        • { seq: number; type: "ping" }
          • seq: number

            The sequence number the pong should respond with

          • type: "ping"
        • { seq: number; type: "pong" }
          • seq: number

            The sequence number asked for in the ping packet.

          • type: "pong"
      • log: boolean = true

        Whether to log the sent message

      Returns void

    • Sends a confirmation or error message to the player.

      Parameters

      • source:
            | { action: "load"; audioURL: string; type: "audio_control" }
            | {
                action:
                    | "play"
                    | "pause"
                    | "play_countdown_running"
                    | "play_countdown_end";
                type: "audio_control";
            }
            | { type: "change_username"; username: string }
            | {
                playlists: {
                    cover: string | null;
                    hrefURL: string;
                    name: string;
                    songs: {
                        artist: string;
                        audioURL: string;
                        cover: string | null;
                        hrefURL: string;
                        name: string;
                    }[];
                    subtitle?: string;
                }[];
                type: "add_playlists";
            }
            | { index: number
            | null; type: "remove_playlist" }
            | {
                advancedSongFiltering: boolean;
                audioStartPosition: number;
                distractionsPreferSameArtist: boolean;
                endWhenAnswered: boolean;
                gameMode: "multiple_choice" | "player_picks";
                playerPickTimeout: number;
                roundsCount: number;
                timePerQuestion: number;
                type: "room_config";
            }
            | { type: "start_game" }
            | { answer?: string; answerIndex?: number; type: "select_answer" }
            | { type: "return_to"; where: "lobby" | "results" }
            | { playerName: string; type: "transfer_host" }
            | {
                song: {
                    artist: string;
                    audioURL: string;
                    cover: string | null;
                    hrefURL: string;
                    name: string;
                };
                startPos: number;
                type: "player_pick_song";
            }
            | {
                players: Record<
                    string,
                    {
                        answerData?: {
                            answer?: string;
                            answerIndex?: number;
                            answerSpeed: number;
                            answerTimestamp: number;
                            questionPoints: number;
                        };
                        color: string;
                        isHost: boolean;
                        isSpectator: boolean;
                        points: number;
                        username: string;
                    },
                >;
                state: "lobby"
                | "results"
                | "ingame";
                type: "room_state";
                uuid: string;
                version: string;
            }
            | {
                filteredSongsCount: number;
                playlists?: {
                    cover: string
                    | null;
                    hrefURL: string;
                    name: string;
                    songs: {
                        artist: string;
                        audioURL: string;
                        cover: string | null;
                        hrefURL: string;
                        name: string;
                    }[];
                    subtitle?: string;
                }[];
                type: "update_playlists";
            }
            | { countdown: number; type: "countdown" }
            | {
                gamePhase: GamePhase;
                question?:
                    | {
                        answerOptions: string[];
                        correctAnswerIndex?: number;
                        questionType: "multiple_choice";
                        startPos: number;
                    }
                    | {
                        correctAnswer?: {
                            artist: string;
                            audioURL: string;
                            cover: string
                            | null;
                            hrefURL: string;
                            name: string;
                        };
                        pickerId: string;
                        questionCount: number;
                        questionCurrent: number;
                        questionType: "player_picks";
                        startPos: number;
                    };
                roundCurrent: number;
                type: "round_state";
            }
            | {
                songs: {
                    artist: string;
                    audioURL: string;
                    cover: string
                    | null;
                    hrefURL: string;
                    name: string;
                }[];
                type: "update_played_songs";
            }
            | {
                entry: LogEntry;
                level: "error"
                | "info"
                | "warn"
                | "debug";
                type: "add_log_message";
            }
            | { messages: LoggerStorage; type: "update_log_messages" }
            | { duration: number; offset: number; type: "progressbar_update" }
            | { type: "other" }

        The source/type of the confirmation message

        • { action: "load"; audioURL: string; type: "audio_control" }
          • action: "load"
            • "load": Downloads the music.
          • audioURL: string

            URL to load music from.

          • type: "audio_control"
        • {
              action:
                  | "play"
                  | "pause"
                  | "play_countdown_running"
                  | "play_countdown_end";
              type: "audio_control";
          }
          • action: "play" | "pause" | "play_countdown_running" | "play_countdown_end"
            • "play": Starts playback of the music.
            • "pause": Pauses playback of the music.
            • "play_countdown_running": Plays the countdown_running sound effect on a secondary audio player.
            • "play_countdown_end": Plays the countdown_end sound effect on a secondary audio player.
          • type: "audio_control"
        • { type: "change_username"; username: string }
          • type: "change_username"
          • username: string

            The new username.

        • {
              playlists: {
                  cover: string | null;
                  hrefURL: string;
                  name: string;
                  songs: {
                      artist: string;
                      audioURL: string;
                      cover: string | null;
                      hrefURL: string;
                      name: string;
                  }[];
                  subtitle?: string;
              }[];
              type: "add_playlists";
          }
          • playlists: {
                cover: string | null;
                hrefURL: string;
                name: string;
                songs: {
                    artist: string;
                    audioURL: string;
                    cover: string | null;
                    hrefURL: string;
                    name: string;
                }[];
                subtitle?: string;
            }[]

            The new playlist to add.

          • type: "add_playlists"
        • { index: number | null; type: "remove_playlist" }
          • index: number | null

            The playlist index to remove.

          • type: "remove_playlist"
        • {
              advancedSongFiltering: boolean;
              audioStartPosition: number;
              distractionsPreferSameArtist: boolean;
              endWhenAnswered: boolean;
              gameMode: "multiple_choice" | "player_picks";
              playerPickTimeout: number;
              roundsCount: number;
              timePerQuestion: number;
              type: "room_config";
          }
          • advancedSongFiltering: boolean

            Whether to perform advanced filtering tactics when generating the songs array. Currently just ignores parens when filtering for identical song names.

          • audioStartPosition: number

            The music start position.

            • 0: start of audio
            • 1: close to middle of audio
            • 2: close to end of audio
            • 3: random of the above

            Used as default value in PlayerPicksGame, used as forced position in MultipleChoiceGame.

          • distractionsPreferSameArtist: boolean

            Whether to prefer distractions by the same artist.

          • endWhenAnswered: boolean

            Whether to directly end the round after all players answered.

          • gameMode: "multiple_choice" | "player_picks"

            The game mode being played.

            • multiple_choice: the server selects random songs from the provided playlist and provides a multiple choice question with distractions.
            • player_picks: a player from the room picks a song for other players to guess each round. other players have to guess the song title by typing.
          • playerPickTimeout: number

            The amount of time a player should have to pick a song.

          • roundsCount: number

            The amount of rounds to play.

          • timePerQuestion: number

            The time per question in each round.

          • type: "room_config"
        • { type: "start_game" }
        • { answer?: string; answerIndex?: number; type: "select_answer" }
          • Optionalanswer?: string

            Provided only for PlayerPicksGame. The string of the song name the player guessed.

          • OptionalanswerIndex?: number

            Provided only for MultipleChoiceGame. The index of the selected answer.

          • type: "select_answer"
        • { type: "return_to"; where: "lobby" | "results" }
          • type: "return_to"
          • where: "lobby" | "results"

            Where to send the player to.

        • { playerName: string; type: "transfer_host" }
          • playerName: string

            The name of the player that should get host.

          • type: "transfer_host"
        • {
              song: {
                  artist: string;
                  audioURL: string;
                  cover: string | null;
                  hrefURL: string;
                  name: string;
              };
              startPos: number;
              type: "player_pick_song";
          }
          • song: {
                artist: string;
                audioURL: string;
                cover: string | null;
                hrefURL: string;
                name: string;
            }

            The song the player picked in the choose step.

            • artist: string

              The name of the song artist.

            • audioURL: string

              A URL to the audio file of the song. Currently only audio previews from Apple Music and SoundCloud are allowed.

            • cover: string | null

              Cover URL of the song.

            • hrefURL: string

              The URL users will be redirected to when clicking.

            • name: string

              The name of the song.

          • startPos: number

            The selected start pos for the song.

            RoomConfigMessageSchema.audioStartPosition

          • type: "player_pick_song"
        • {
              players: Record<
                  string,
                  {
                      answerData?: {
                          answer?: string;
                          answerIndex?: number;
                          answerSpeed: number;
                          answerTimestamp: number;
                          questionPoints: number;
                      };
                      color: string;
                      isHost: boolean;
                      isSpectator: boolean;
                      points: number;
                      username: string;
                  },
              >;
              state: "lobby"
              | "results"
              | "ingame";
              type: "room_state";
              uuid: string;
              version: string;
          }
          • players: Record<
                string,
                {
                    answerData?: {
                        answer?: string;
                        answerIndex?: number;
                        answerSpeed: number;
                        answerTimestamp: number;
                        questionPoints: number;
                    };
                    color: string;
                    isHost: boolean;
                    isSpectator: boolean;
                    points: number;
                    username: string;
                },
            >

            A map of all active (online, non-spectating) players. Key is server generated uuid, NOT connection id.

          • state: "lobby" | "results" | "ingame"

            The current game state

          • type: "room_state"
          • uuid: string

            The player's unique identifier generated by the server. Not connection id!

          • version: string

            The current version of the server.

        • {
              filteredSongsCount: number;
              playlists?: {
                  cover: string | null;
                  hrefURL: string;
                  name: string;
                  songs: {
                      artist: string;
                      audioURL: string;
                      cover: string | null;
                      hrefURL: string;
                      name: string;
                  }[];
                  subtitle?: string;
              }[];
              type: "update_playlists";
          }
          • filteredSongsCount: number

            The count of filtered songs.

            filterSongs

          • Optionalplaylists?: {
                cover: string | null;
                hrefURL: string;
                name: string;
                songs: {
                    artist: string;
                    audioURL: string;
                    cover: string | null;
                    hrefURL: string;
                    name: string;
                }[];
                subtitle?: string;
            }[]

            Currently selected playlist(s)

          • type: "update_playlists"
        • { countdown: number; type: "countdown" }
          • countdown: number

            The current countdown number. 0 to hide.

          • type: "countdown"
        • {
              gamePhase: GamePhase;
              question?:
                  | {
                      answerOptions: string[];
                      correctAnswerIndex?: number;
                      questionType: "multiple_choice";
                      startPos: number;
                  }
                  | {
                      correctAnswer?: {
                          artist: string;
                          audioURL: string;
                          cover: string
                          | null;
                          hrefURL: string;
                          name: string;
                      };
                      pickerId: string;
                      questionCount: number;
                      questionCurrent: number;
                      questionType: "player_picks";
                      startPos: number;
                  };
              roundCurrent: number;
              type: "round_state";
          }
          • gamePhase: GamePhase

            The current game phase.

            GamePhase

          • Optionalquestion?:
                | {
                    answerOptions: string[];
                    correctAnswerIndex?: number;
                    questionType: "multiple_choice";
                    startPos: number;
                }
                | {
                    correctAnswer?: {
                        artist: string;
                        audioURL: string;
                        cover: string
                        | null;
                        hrefURL: string;
                        name: string;
                    };
                    pickerId: string;
                    questionCount: number;
                    questionCurrent: number;
                    questionType: "player_picks";
                    startPos: number;
                }
          • roundCurrent: number

            The round number.

          • type: "round_state"
        • {
              songs: {
                  artist: string;
                  audioURL: string;
                  cover: string | null;
                  hrefURL: string;
                  name: string;
              }[];
              type: "update_played_songs";
          }
          • songs: {
                artist: string;
                audioURL: string;
                cover: string | null;
                hrefURL: string;
                name: string;
            }[]

            The songs that were played in this round.

          • type: "update_played_songs"
        • {
              entry: LogEntry;
              level: "error" | "info" | "warn" | "debug";
              type: "add_log_message";
          }
          • entry: LogEntry

            The added log message.

          • level: "error" | "info" | "warn" | "debug"

            The log level of the added message.

          • type: "add_log_message"
        • { messages: LoggerStorage; type: "update_log_messages" }
        • { duration: number; offset: number; type: "progressbar_update" }
          • duration: number

            The duration of the progressbar.

          • offset: number

            The number of seconds to offset the progress bar start point.

          • type: "progressbar_update"
        • { type: "other" }
      • Optionalerror: string

        An optional error message to include in the confirmation

      Returns void

    • Constructs and sends an update message with the current room/connection states to the player.

      Returns void

    • Constructs a player update message.

      Parameters

      • forceFullMessage: boolean = false

        whether to always return the full player message, including the answer data, ignoring game phase. default: false

      Returns {
          answerData?: {
              answer?: string;
              answerIndex?: number;
              answerSpeed: number;
              answerTimestamp: number;
              questionPoints: number;
          };
          color: string;
          isHost: boolean;
          isSpectator: boolean;
          points: number;
          username: string;
      }

      a JSON string of the constructed PlayerMessage

      • OptionalanswerData?: {
            answer?: string;
            answerIndex?: number;
            answerSpeed: number;
            answerTimestamp: number;
            questionPoints: number;
        }

        The current answer of this player.

        • Optionalanswer?: string

          Provided only for PlayerPicksGame. The answer the player selected.

        • OptionalanswerIndex?: number

          Provided only for MultipleChoiceGame. The index of the question the player selected.

        • answerSpeed: number

          The relative time in ms a player took to answer a round question.

        • answerTimestamp: number

          The absolute time in ms where the player answered a round question.

        • questionPoints: number

          The points the player got for the current question.

      • color: string

        The player's color

      • isHost: boolean

        True, if the receiver is the host

      • isSpectator: boolean

        True, if this player is just spectating

      • points: number

        How many points the player had in the last round.

      • username: string

        The player's username