Update for dedicated server 2022-05-08:

* Remove useless settings of ServerOptions
* Set method deprecated for API version 2022-03-21
* Fix error when trying to get remove GetGameMode Method at start
This commit is contained in:
Beu 2022-05-08 23:11:20 +02:00
parent b0fea31a13
commit 81d9a63a4b
3 changed files with 27 additions and 54 deletions

View File

@ -124,8 +124,14 @@ class ScriptManager implements UsageInformationAble {
*/ */
public function isScriptMode() { public function isScriptMode() {
if (is_null($this->isScriptMode)) { if (is_null($this->isScriptMode)) {
// GetGameMode method has been removed in the API version "2022-03-21". So if the function return a "FaultException", consider it in script mode
try {
$gameMode = $this->maniaControl->getClient()->getGameMode(); $gameMode = $this->maniaControl->getClient()->getGameMode();
$this->isScriptMode = ($gameMode === 0); $this->isScriptMode = ($gameMode === 0 || !is_int($gameMode));
} catch (\Throwable $th) {
$this->isScriptMode = true;
}
} }
return $this->isScriptMode; return $this->isScriptMode;
} }

View File

@ -1725,6 +1725,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Enable or disable peer-to-peer upload from server. * Enable or disable peer-to-peer upload from server.
* Only available to Admin. * Only available to Admin.
* @param bool $enable * @param bool $enable
@ -1741,6 +1742,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Returns if the peer-to-peer upload from server is enabled. * Returns if the peer-to-peer upload from server is enabled.
* @param bool $multicall * @param bool $multicall
* @return bool * @return bool
@ -1751,6 +1753,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Enable or disable peer-to-peer download for server. * Enable or disable peer-to-peer download for server.
* Only available to Admin. * Only available to Admin.
* @param bool $enable * @param bool $enable
@ -1767,6 +1770,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Returns if the peer-to-peer download for server is enabled. * Returns if the peer-to-peer download for server is enabled.
* @param bool $multicall * @param bool $multicall
* @return bool * @return bool
@ -2034,6 +2038,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Enable the autosaving on the server of validation replays, every time a player makes a new time. * Enable the autosaving on the server of validation replays, every time a player makes a new time.
* Only available to SuperAdmin. * Only available to SuperAdmin.
* @param bool $enable * @param bool $enable
@ -2060,6 +2065,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Returns if autosaving of validation replays is enabled on the server. * Returns if autosaving of validation replays is enabled on the server.
* @param bool $multicall * @param bool $multicall
* @return bool * @return bool
@ -2126,6 +2132,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Set a new ladder mode. * Set a new ladder mode.
* Only available to Admin. * Only available to Admin.
* Requires a map restart to be taken into account. * Requires a map restart to be taken into account.
@ -2143,6 +2150,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Get the current and next ladder mode on server. * Get the current and next ladder mode on server.
* @param bool $multicall * @param bool $multicall
* @return int[] {int CurrentValue, int NextValue} * @return int[] {int CurrentValue, int NextValue}
@ -2153,6 +2161,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Get the ladder points limit for the players allowed on this server. * Get the ladder points limit for the players allowed on this server.
* @param bool $multicall * @param bool $multicall
* @return Structures\LadderLimits * @return Structures\LadderLimits
@ -2165,6 +2174,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Set the network vehicle quality. * Set the network vehicle quality.
* Only available to Admin. * Only available to Admin.
* Requires a map restart to be taken into account. * Requires a map restart to be taken into account.
@ -2182,6 +2192,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Get the current and next network vehicle quality on server. * Get the current and next network vehicle quality on server.
* @param bool $multicall * @param bool $multicall
* @return int[] {int CurrentValue, int NextValue} * @return int[] {int CurrentValue, int NextValue}
@ -2418,6 +2429,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Set a new password for the referee mode. * Set a new password for the referee mode.
* Only available to Admin. * Only available to Admin.
* @param string $password * @param string $password
@ -2434,6 +2446,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Get the password for referee mode if called as Admin or Super Admin, else returns if a password is needed or not. * Get the password for referee mode if called as Admin or Super Admin, else returns if a password is needed or not.
* @param bool $multicall * @param bool $multicall
* @return string|bool * @return string|bool
@ -2444,6 +2457,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Set the referee validation mode. * Set the referee validation mode.
* Only available to Admin. * Only available to Admin.
* @param int $mode 0: validate the top3 players, 1: validate all players * @param int $mode 0: validate the top3 players, 1: validate all players
@ -2460,6 +2474,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Get the referee validation mode. * Get the referee validation mode.
* @param bool $multicall * @param bool $multicall
* @return int * @return int
@ -2470,6 +2485,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Set whether the game should use a variable validation seed or not. * Set whether the game should use a variable validation seed or not.
* Only available to Admin. * Only available to Admin.
* Requires a map restart to be taken into account. * Requires a map restart to be taken into account.
@ -2487,6 +2503,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Get the current and next value of UseChangingValidationSeed. * Get the current and next value of UseChangingValidationSeed.
* @param bool $multicall * @param bool $multicall
* @return bool[] {bool CurrentValue, bool NextValue} * @return bool[] {bool CurrentValue, bool NextValue}
@ -2872,6 +2889,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Set a new game mode. * Set a new game mode.
* Only available to Admin. * Only available to Admin.
* Requires a map restart to be taken into account. * Requires a map restart to be taken into account.
@ -2889,6 +2907,7 @@ class Connection
} }
/** /**
* @deprecated since version 2022-03-21
* Get the current game mode. * Get the current game mode.
* @param bool $multicall * @param bool $multicall
* @return int * @return int

View File

@ -17,60 +17,8 @@ class ServerOptions extends AbstractStructure
public $password; public $password;
/** @var string */ /** @var string */
public $passwordForSpectator; public $passwordForSpectator;
/** @var int */
public $hideServer;
/** @var int */
public $currentMaxPlayers;
/** @var int */
public $nextMaxPlayers;
/** @var int */
public $currentMaxSpectators;
/** @var int */
public $nextMaxSpectators;
/** @var bool */
public $isP2PUpload;
/** @var bool */
public $isP2PDownload;
/** @var bool */
public $currentLadderMode;
/** @var int */
public $nextLadderMode;
/** @var float */
public $ladderServerLimitMax;
/** @var float */
public $ladderServerLimitMin;
/** @var int */
public $currentVehicleNetQuality;
/** @var int */
public $nextVehicleNetQuality;
/** @var int */
public $currentCallVoteTimeOut;
/** @var int */
public $nextCallVoteTimeOut;
/** @var float */ /** @var float */
public $callVoteRatio; public $callVoteRatio;
/** @var bool */
public $allowMapDownload;
/** @var bool */
public $autoSaveReplays;
/** @var bool */
public $autoSaveValidationReplays;
/** @var string */
public $refereePassword;
/** @var int */
public $refereeMode;
/** @var bool */
public $currentUseChangingValidationSeed;
/** @var bool */
public $nextUseChangingValidationSeed;
/** @var int */
public $clientInputsMaxLatency;
/** @var bool */
public $keepPlayerSlots;
/** @var bool */
public $disableHorns;
/** @var bool */
public $disableServiceAnnounces;
/** /**
* @internal * @internal