Class: ServerManager

ServerManager

Manages server configurations and actions.

new ServerManager()

Extends

Members

clientRCONClient

Methods

inherited _validateParameter(value, name, conditions)

Checks if a parameter satisfies specific conditions.

Name Type Description
value any

The actual value of the parameter.

name string

The name of the parameter.

conditions Object optional

Conditions to be met.

Name Type Default Description
defined boolean true optional

Parameter must not be null or undefined.

nonEmptyString boolean true optional

Parameter must be a non-empty string.

positiveInteger boolean false optional

Parameter must be a positive integer.

integer boolean false optional

Parameter must be an integer.

boolean boolean false optional

Parameter must be a boolean.

inherited _validateResponse(response, additionalErrors){Object}

Validates RCON response by checking status code.

Name Type Description
response ResponseMessage
additionalErrors Object
Throws:
Error
Returns:
Type Description
Object

asyncaddBannedWords(words){Promise.<void>}

Adds a word to the banned words list.

Name Type Description
words Array.<string>
Returns:
Type Description
Promise.<void>

asyncfetchAutoBalanceEnabled(){Promise.<boolean>}

Fetches the auto balance on/off status.

Returns:
Type Description
Promise.<boolean>

asyncfetchAutoBalanceThreshold(){Promise.<number>}

Fetches the auto balance threshold.

Returns:
Type Description
Promise.<number>

asyncfetchBannedWordsList(){Promise.<Array.<string>>}

Fetches all banned words.

Returns:
Type Description
Promise.<Array.<string>>

asyncfetchChangelist(){Promise.<string>}

Fetches the server changelist number.

Returns:
Type Description
Promise.<string>

asyncfetchConfig(){Promise.<ServerConfiguration>}

Fetches the server configuration.

Returns:
Type Description
Promise.<ServerConfiguration>

asyncfetchHighPingThreshold(){Promise.<number>}

Fetches the high ping threshold in milliseconds.

Returns:
Type Description
Promise.<number>

asyncfetchIdleKickDuration(){Promise.<number>}

Fetches the idle kick duration in minutes.

Returns:
Type Description
Promise.<number>

asyncfetchTeamSwitchCooldown(){Promise.<number>}

Fetches the team switch cooldown in minutes.

Returns:
Type Description
Promise.<number>

asyncfetchVoteKickEnabled(){Promise.<boolean>}

Fetches if vote kick is enabled.

Returns:
Type Description
Promise.<boolean>

asyncfetchVoteKickThresholds(){Promise.<void>}

Fetches the vote kick thresholds.

Returns:
Type Description
Promise.<void>

asyncremoveBannedWords(words){Promise.<void>}

Removes banned words from the server ban list.

Name Type Description
words Array.<string>
Returns:
Type Description
Promise.<void>

asyncremoveMatchTimer(gamemode){Promise.<void>}

Removes a custom timer for a gamemode.

Name Type Description
gamemode "Warfare" | "Offensive" | "Skirmish"
Returns:
Type Description
Promise.<void>

asyncremoveWarmupTimer(gamemode){Promise.<void>}

Removes a custom warmup timer for a gamemode.

Name Type Description
gamemode "Warfare" | "Offensive" | "Skirmish"
Returns:
Type Description
Promise.<void>

asyncresetVoteKickThresholds(){Promise.<void>}

Resets vote kick thresholds to an empty list.

Returns:
Type Description
Promise.<void>

asyncsetAutoBalanceEnabled(enable){Promise.<void>}

Enables/Disables auto balance.

Name Type Description
enable boolean
Returns:
Type Description
Promise.<void>

asyncsetAutoBalanceThreshold(threshold){Promise.<void>}

Set the threshold for auto balance to take effect.

Name Type Description
threshold number

Player difference

Returns:
Type Description
Promise.<void>

asyncsetHighPingThreshold(threshold){Promise.<void>}

Sets high ping threshold.

Name Type Description
threshold number

Threshold in milliseconds

Returns:
Type Description
Promise.<void>

asyncsetIdleKickDuration(duration){Promise.<void>}

Sets the idle kick duration.

Name Type Description
duration number

The duration in minutes.

Returns:
Type Description
Promise.<void>

asyncsetMatchTimer(gamemode, duration){Promise.<void>}

Set the match timer for gamemodes.

Name Type Description
gamemode "Warfare" | "Offensive" | "Skirmish"
duration number

Duration in minutes

Returns:
Type Description
Promise.<void>

asyncsetMaxQueuedPlayers(count){Promise.<void>}

Sets the maximum queue count.

Name Type Description
count number

Between 1 and 6

Returns:
Type Description
Promise.<void>

asyncsetTeamSwitchCooldown(cooldown){Promise.<void>}

Set the team switch cooldown.

Name Type Description
cooldown number

Cooldown in minutes.

Returns:
Type Description
Promise.<void>

asyncsetVipSlotCount(count){Promise.<void>}

Sets the VIP slot count.

Name Type Description
count number
Returns:
Type Description
Promise.<void>

asyncsetVoteKickEnabled(enable){Promise.<void>}

Enables/disables vote kick.

Name Type Description
enable boolean
Returns:
Type Description
Promise.<void>

asyncsetVoteKickThresholds(thresholds){Promise.<void>}

Sets the vote kick thresholds.

Name Type Description
thresholds Array.<{playerCount: number, voteThreshold: number}>

Array of threshold objects.

Returns:
Type Description
Promise.<void>

asyncsetWarmupTimer(gamemode, length){Promise.<void>}

Set the match timer for gamemodes.

Name Type Description
gamemode "Warfare" | "Offensive" | "Skirmish"
length number

Length in minutes between 1 and 10

Returns:
Type Description
Promise.<void>

asyncsetWelcomeMessage(message){Promise.<void>}

Sets the welcome message for the server.

Name Type Description
message string optional
Returns:
Type Description
Promise.<void>