SongGuess
    Preparing search index...

    Class BaseConfig

    Hierarchy (View Summary)

    Implements

    Index
    • Parameters

      • Optionalmsg: {
            advancedSongFiltering: boolean;
            allowChangingAnswer: boolean;
            audioStartPosition: number | null;
            distractionsPreferSameArtist: boolean;
            endWhenAnswered: boolean;
            gameMode: "multiple_choice" | "player_picks";
            multipleChoiceAnswersCount: number;
            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.

        • allowChangingAnswer: boolean

          Whether to allow changing answer in multiple choice.

        • audioStartPosition: number | null

          The music start position for a game.

          Must be a float between

          • 0.0: start of audio

          and

          • 1.0: close to end of audio (audio duration minus max play time determined by config + round padding)

          Can be null to use random position (multiple choice) / let picker decide (player picks)

        • 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.
        • multipleChoiceAnswersCount: number

          The amount of multiple choice answers to add.

        • 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"

      Returns BaseConfig

    advancedSongFiltering: boolean = true

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

    allowChangingAnswer: boolean = false

    Whether to allow changing answer in multiple choice.

    audioStartPosition: number | null = null

    The music start position for a game.

    Must be a float between

    • 0.0: start of audio

    and

    • 1.0: close to end of audio (audio duration minus max play time determined by config + round padding)

    Can be null to use random position (multiple choice) / let picker decide (player picks)

    distractionsPreferSameArtist: boolean = true

    Whether to prefer distractions by the same artist.

    endWhenAnswered: boolean = false

    Whether to directly end the round after all players answered.

    gameMode: "multiple_choice" | "player_picks" = "multiple_choice"

    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.
    multipleChoiceAnswersCount: number = 4

    The amount of multiple choice answers to add.

    playerPickTimeout: number = 180

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

    roundsCount: number = 10

    The amount of rounds to play.

    timePerQuestion: number = 25

    The time per question in each round.

    type: "room_config"
    • Applys a RoomConfigMessage to this config instance.

      Parameters

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

        the message to apply.

        • advancedSongFiltering: boolean

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

        • allowChangingAnswer: boolean

          Whether to allow changing answer in multiple choice.

        • audioStartPosition: number | null

          The music start position for a game.

          Must be a float between

          • 0.0: start of audio

          and

          • 1.0: close to end of audio (audio duration minus max play time determined by config + round padding)

          Can be null to use random position (multiple choice) / let picker decide (player picks)

        • 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.
        • multipleChoiceAnswersCount: number

          The amount of multiple choice answers to add.

        • 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"
      • _firstInit: boolean = false

        whether the applied message is the first init after e.g. load of saved state from storage

      Returns void

    • The tick count when a question song was picked.

      Returns number

    • The tick count when the answer gets revealed.

      Returns number

    • The tick count when a new round shall be started.

      Returns number

    • Constructs a configuration update message.

      Returns {
          advancedSongFiltering: boolean;
          allowChangingAnswer: boolean;
          audioStartPosition: number | null;
          distractionsPreferSameArtist: boolean;
          endWhenAnswered: boolean;
          gameMode: "multiple_choice" | "player_picks";
          multipleChoiceAnswersCount: number;
          playerPickTimeout: number;
          roundsCount: number;
          timePerQuestion: number;
          type: "room_config";
      }

      a JSON string of the constructed RoomConfigMessage

      • advancedSongFiltering: boolean

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

      • allowChangingAnswer: boolean

        Whether to allow changing answer in multiple choice.

      • audioStartPosition: number | null

        The music start position for a game.

        Must be a float between

        • 0.0: start of audio

        and

        • 1.0: close to end of audio (audio duration minus max play time determined by config + round padding)

        Can be null to use random position (multiple choice) / let picker decide (player picks)

      • 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.
      • multipleChoiceAnswersCount: number

        The amount of multiple choice answers to add.

      • 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"