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

55 lines
1.1 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 float */
2014-01-16 16:56:24 +01:00
public $callVoteRatio;
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
}