dedicated-server-api update
This commit is contained in:
@ -71,4 +71,35 @@ class ServerOptions extends AbstractStructure
|
||||
public $disableHorns;
|
||||
/** @var bool */
|
||||
public $disableServiceAnnounces;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @return bool
|
||||
*/
|
||||
function isValid()
|
||||
{
|
||||
return is_string($this->name)
|
||||
&& is_string($this->comment)
|
||||
&& is_string($this->password)
|
||||
&& is_string($this->passwordForSpectator)
|
||||
&& VoteRatio::isRatio($this->callVoteRatio);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ class Status extends AbstractStructure
|
||||
const SYNCHRONIZATION = 3;
|
||||
const PLAY = 4;
|
||||
const EXITING = 6;
|
||||
const LOCAL = 7;
|
||||
|
||||
/** @var int */
|
||||
public $code;
|
||||
|
@ -34,6 +34,7 @@ class Vote extends AbstractStructure
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @return bool
|
||||
*/
|
||||
function isValid()
|
||||
|
@ -37,6 +37,7 @@ class VoteRatio extends AbstractStructure
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @return bool
|
||||
*/
|
||||
function isValid()
|
||||
@ -47,6 +48,7 @@ class VoteRatio extends AbstractStructure
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param float $ratio
|
||||
* @return bool
|
||||
*/
|
||||
|
Reference in New Issue
Block a user