TrackManiaControl/libs/Maniaplanet/DedicatedServer/Structures/ServerOptions.php

107 lines
2.3 KiB
PHP
Raw Normal View History

2014-01-16 16:56:24 +01:00
<?php
/**
* ManiaPlanet dedicated server Xml-RPC client
*
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
*/
2014-01-20 09:24:17 +01:00
2014-01-16 16:56:24 +01:00
namespace Maniaplanet\DedicatedServer\Structures;
class ServerOptions extends AbstractStructure
{
2014-05-08 19:38:15 +02:00
/** @var string */
2014-01-16 16:56:24 +01:00
public $name;
2014-05-08 19:38:15 +02:00
/** @var string */
2014-01-16 16:56:24 +01:00
public $comment;
2014-05-08 19:38:15 +02:00
/** @var string */
2014-01-16 16:56:24 +01:00
public $password;
2014-05-08 19:38:15 +02:00
/** @var string */
2014-01-16 16:56:24 +01:00
public $passwordForSpectator;
2014-05-08 19:38:15 +02:00
/** @var int */
2014-01-16 16:56:24 +01:00
public $hideServer;
2014-05-08 19:38:15 +02:00
/** @var int */
2014-01-16 16:56:24 +01:00
public $currentMaxPlayers;
2014-05-08 19:38:15 +02:00
/** @var int */
2014-01-16 16:56:24 +01:00
public $nextMaxPlayers;
2014-05-08 19:38:15 +02:00
/** @var int */
2014-01-16 16:56:24 +01:00
public $currentMaxSpectators;
2014-05-08 19:38:15 +02:00
/** @var int */
2014-01-16 16:56:24 +01:00
public $nextMaxSpectators;
2014-05-08 19:38:15 +02:00
/** @var bool */
2014-01-16 16:56:24 +01:00
public $isP2PUpload;
2014-05-08 19:38:15 +02:00
/** @var bool */
2014-01-16 16:56:24 +01:00
public $isP2PDownload;
2014-05-08 19:38:15 +02:00
/** @var bool */
2014-01-16 16:56:24 +01:00
public $currentLadderMode;
2014-05-08 19:38:15 +02:00
/** @var int */
2014-01-16 16:56:24 +01:00
public $nextLadderMode;
2014-05-08 19:38:15 +02:00
/** @var float */
2014-01-16 16:56:24 +01:00
public $ladderServerLimitMax;
2014-05-08 19:38:15 +02:00
/** @var float */
2014-01-16 16:56:24 +01:00
public $ladderServerLimitMin;
2014-05-08 19:38:15 +02:00
/** @var int */
2014-01-16 16:56:24 +01:00
public $currentVehicleNetQuality;
2014-05-08 19:38:15 +02:00
/** @var int */
2014-01-16 16:56:24 +01:00
public $nextVehicleNetQuality;
2014-05-08 19:38:15 +02:00
/** @var int */
2014-01-16 16:56:24 +01:00
public $currentCallVoteTimeOut;
2014-05-08 19:38:15 +02:00
/** @var int */
2014-01-16 16:56:24 +01:00
public $nextCallVoteTimeOut;
2014-05-08 19:38:15 +02:00
/** @var float */
2014-01-16 16:56:24 +01:00
public $callVoteRatio;
2014-05-08 19:38:15 +02:00
/** @var bool */
2014-01-16 16:56:24 +01:00
public $allowMapDownload;
2014-05-08 19:38:15 +02:00
/** @var bool */
2014-01-16 16:56:24 +01:00
public $autoSaveReplays;
2014-05-08 19:38:15 +02:00
/** @var bool */
2014-01-16 16:56:24 +01:00
public $autoSaveValidationReplays;
2014-05-08 19:38:15 +02:00
/** @var string */
2014-01-16 16:56:24 +01:00
public $refereePassword;
2014-05-08 19:38:15 +02:00
/** @var int */
2014-01-16 16:56:24 +01:00
public $refereeMode;
2014-05-08 19:38:15 +02:00
/** @var bool */
2014-01-16 16:56:24 +01:00
public $currentUseChangingValidationSeed;
2014-05-08 19:38:15 +02:00
/** @var bool */
2014-01-16 16:56:24 +01:00
public $nextUseChangingValidationSeed;
2014-05-08 19:38:15 +02:00
/** @var int */
2014-01-16 16:56:24 +01:00
public $clientInputsMaxLatency;
2014-05-08 19:38:15 +02:00
/** @var bool */
2014-01-16 16:56:24 +01:00
public $keepPlayerSlots;
2014-05-08 19:38:15 +02:00
/** @var bool */
2014-01-20 09:24:17 +01:00
public $disableHorns;
2014-05-08 19:38:15 +02:00
/** @var bool */
2014-01-20 09:24:17 +01:00
public $disableServiceAnnounces;
2014-05-20 15:20:16 +02:00
/**
* @internal
* @return bool
*/
function isValid()
{
return is_string($this->name)
&& is_string($this->comment)
&& is_string($this->password)
&& is_string($this->passwordForSpectator)
2014-07-19 21:50:54 +02:00
&& is_int($this->nextCallVoteTimeOut)
&& VoteRatio::isRatio($this->callVoteRatio);
2014-05-20 15:20:16 +02:00
}
/**
* @internal
* @return mixed[]
*/
function toSetterArray()
{
$out = array();
foreach(get_object_vars($this) as $key => $value)
{
if(substr($key, 0, 7) == 'current' || $value === null)
continue;
if($key == 'nextUseChangingValidationSeed')
$key = 'useChangingValidationSeed';
$out[ucfirst($key)] = $value;
}
return $out;
}
2014-05-08 19:38:15 +02:00
}