updated dedicated-server-api
This commit is contained in:
parent
8559799907
commit
d44de5f49e
File diff suppressed because it is too large
Load Diff
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/AbstractStructure.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/AbstractStructure.php
Normal file → Executable file
10
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Bill.php
Normal file → Executable file
10
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Bill.php
Normal file → Executable file
@ -10,11 +10,11 @@ namespace Maniaplanet\DedicatedServer\Structures;
|
||||
class Bill extends AbstractStructure
|
||||
{
|
||||
const STATE_CREATING_TRANSACTION = 1;
|
||||
const STATE_ISSUED = 2;
|
||||
const STATE_VALIDATING_PAYMENT = 3;
|
||||
const STATE_PAYED = 4;
|
||||
const STATE_REFUSED = 5;
|
||||
const STATE_ERROR = 6;
|
||||
const STATE_ISSUED = 2;
|
||||
const STATE_VALIDATING_PAYMENT = 3;
|
||||
const STATE_PAYED = 4;
|
||||
const STATE_REFUSED = 5;
|
||||
const STATE_ERROR = 6;
|
||||
|
||||
/** @var int */
|
||||
public $state;
|
||||
|
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Command.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Command.php
Normal file → Executable file
10
application/core/Libs/Maniaplanet/DedicatedServer/Structures/FileDesc.php
Normal file → Executable file
10
application/core/Libs/Maniaplanet/DedicatedServer/Structures/FileDesc.php
Normal file → Executable file
@ -13,4 +13,14 @@ class FileDesc extends AbstractStructure
|
||||
public $fileName;
|
||||
/** @var string */
|
||||
public $checksum;
|
||||
|
||||
/**
|
||||
* @return FileDesc
|
||||
*/
|
||||
public static function fromArray($array)
|
||||
{
|
||||
$object = parent::fromArray($array);
|
||||
$object->fileName = str_replace("\xEF\xBB\xBF", '', $object->fileName);
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/ForcedSkin.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/ForcedSkin.php
Normal file → Executable file
12
application/core/Libs/Maniaplanet/DedicatedServer/Structures/GameInfos.php
Normal file → Executable file
12
application/core/Libs/Maniaplanet/DedicatedServer/Structures/GameInfos.php
Normal file → Executable file
@ -12,13 +12,13 @@ class GameInfos extends AbstractStructure
|
||||
/**
|
||||
* Game Modes
|
||||
*/
|
||||
const GAMEMODE_SCRIPT = 0;
|
||||
const GAMEMODE_ROUNDS = 1;
|
||||
const GAMEMODE_SCRIPT = 0;
|
||||
const GAMEMODE_ROUNDS = 1;
|
||||
const GAMEMODE_TIMEATTACK = 2;
|
||||
const GAMEMODE_TEAM = 3;
|
||||
const GAMEMODE_LAPS = 4;
|
||||
const GAMEMODE_CUP = 5;
|
||||
const GAMEMODE_STUNTS = 6;
|
||||
const GAMEMODE_TEAM = 3;
|
||||
const GAMEMODE_LAPS = 4;
|
||||
const GAMEMODE_CUP = 5;
|
||||
const GAMEMODE_STUNTS = 6;
|
||||
|
||||
/** @var int */
|
||||
public $gameMode;
|
||||
|
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/LadderLimits.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/LadderLimits.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/LadderStats.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/LadderStats.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/LobbyInfo.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/LobbyInfo.php
Normal file → Executable file
10
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Map.php
Normal file → Executable file
10
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Map.php
Normal file → Executable file
@ -41,4 +41,14 @@ class Map extends AbstractStructure
|
||||
public $mapType;
|
||||
/** var string */
|
||||
public $mapStyle;
|
||||
|
||||
/**
|
||||
* @return Map
|
||||
*/
|
||||
public static function fromArray($array)
|
||||
{
|
||||
$object = parent::fromArray($array);
|
||||
$object->fileName = str_replace("\xEF\xBB\xBF", '', $object->fileName);
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Mod.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Mod.php
Normal file → Executable file
10
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Music.php
Normal file → Executable file
10
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Music.php
Normal file → Executable file
@ -15,4 +15,14 @@ class Music extends AbstractStructure
|
||||
public $url;
|
||||
/** var string */
|
||||
public $file;
|
||||
|
||||
/**
|
||||
* @return Music
|
||||
*/
|
||||
public static function fromArray($array)
|
||||
{
|
||||
$object = parent::fromArray($array);
|
||||
$object->file = str_replace("\xEF\xBB\xBF", '', $object->file);
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/NetworkStats.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/NetworkStats.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Player.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Player.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerAnswer.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerAnswer.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerBan.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerBan.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerDetailedInfo.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerDetailedInfo.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerInfo.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerInfo.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerNetInfo.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerNetInfo.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerRanking.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerRanking.php
Normal file → Executable file
5
application/core/Libs/Maniaplanet/DedicatedServer/Structures/ScriptInfo.php
Normal file → Executable file
5
application/core/Libs/Maniaplanet/DedicatedServer/Structures/ScriptInfo.php
Normal file → Executable file
@ -22,7 +22,10 @@ class ScriptInfo extends AbstractStructure
|
||||
/** @var Command[] */
|
||||
public $commandDescs = array();
|
||||
|
||||
static public function fromArray($array)
|
||||
/**
|
||||
* @return ScriptInfo
|
||||
*/
|
||||
public static function fromArray($array)
|
||||
{
|
||||
$object = parent::fromArray($array);
|
||||
$object->paramDescs = ScriptSettings::fromArrayOfArray($object->paramDescs);
|
||||
|
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/ScriptSettings.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/ScriptSettings.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/ServerOptions.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/ServerOptions.php
Normal file → Executable file
5
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Skin.php
Normal file → Executable file
5
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Skin.php
Normal file → Executable file
@ -14,7 +14,10 @@ class Skin extends AbstractStructure
|
||||
/** @var FileDesc */
|
||||
public $packDesc;
|
||||
|
||||
static function fromArray($array)
|
||||
/**
|
||||
* @return Skin
|
||||
*/
|
||||
public static function fromArray($array)
|
||||
{
|
||||
$object = parent::fromArray($array);
|
||||
$object->packDesc = FileDesc::fromArray($object->packDesc);
|
||||
|
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Status.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Status.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/SystemInfos.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/SystemInfos.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Tag.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Tag.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Team.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Team.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/TokenInfos.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/TokenInfos.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Version.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Version.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Vote.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/Vote.php
Normal file → Executable file
14
application/core/Libs/Maniaplanet/DedicatedServer/Structures/VoteRatio.php
Normal file → Executable file
14
application/core/Libs/Maniaplanet/DedicatedServer/Structures/VoteRatio.php
Normal file → Executable file
@ -10,13 +10,13 @@ namespace Maniaplanet\DedicatedServer\Structures;
|
||||
class VoteRatio extends AbstractStructure
|
||||
{
|
||||
const COMMAND_SCRIPT_SETTINGS = 'SetModeScriptSettingsAndCommands';
|
||||
const COMMAND_NEXT_MAP = 'NextMap';
|
||||
const COMMAND_JUMP_MAP = 'JumpToMapIdent';
|
||||
const COMMAND_SET_NEXT_MAP = 'SetNextMapIdent';
|
||||
const COMMAND_RESTART_MAP = 'RestartMap';
|
||||
const COMMAND_TEAM_BALANCE = 'AutoTeamBalance';
|
||||
const COMMAND_KICK = 'Kick';
|
||||
const COMMAND_BAN = 'Ban';
|
||||
const COMMAND_NEXT_MAP = 'NextMap';
|
||||
const COMMAND_JUMP_MAP = 'JumpToMapIdent';
|
||||
const COMMAND_SET_NEXT_MAP = 'SetNextMapIdent';
|
||||
const COMMAND_RESTART_MAP = 'RestartMap';
|
||||
const COMMAND_TEAM_BALANCE = 'AutoTeamBalance';
|
||||
const COMMAND_KICK = 'Kick';
|
||||
const COMMAND_BAN = 'Ban';
|
||||
|
||||
/** @var string '*' for default */
|
||||
public $command;
|
||||
|
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/ZoneRanking.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Structures/ZoneRanking.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/Base64.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/Base64.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/Exception.php
Normal file → Executable file
0
application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/Exception.php
Normal file → Executable file
75
application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php
Normal file → Executable file
75
application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php
Normal file → Executable file
@ -34,35 +34,26 @@ class FaultException extends Exception
|
||||
return new LockedFeatureException($faultString, $faultCode);
|
||||
case 'Login or Uid unknown.':
|
||||
case 'Login unknown.':
|
||||
return new LoginUnknownException($faultString, $faultCode); //@todo remove this line
|
||||
//return new UnknownPlayerException($faultString, $faultCode);
|
||||
return new UnknownPlayerException($faultString, $faultCode);
|
||||
case 'The player is not a spectator':
|
||||
case 'The player is not a spectator.':
|
||||
return new PlayerIsNotSpectatorException($faultString, $faultCode); //@todo remove this line
|
||||
case 'Not a network player.':
|
||||
case 'Player is not a fake player':
|
||||
return new PlayerStateException($faultString, $faultCode);
|
||||
case 'Player already ignored.':
|
||||
return new PlayerAlreadyIgnoredException($faultString, $faultCode); //@todo remove this line
|
||||
case 'Player already black listed.':
|
||||
case 'Player already on guest list.':
|
||||
case 'Map already added.':
|
||||
return new AlreadyInListException($faultString, $faultCode);
|
||||
case 'Login not banned.':
|
||||
return new NotInListException($faultString, $faultCode); //@todo remove this line
|
||||
case 'Player not ignored.':
|
||||
return new PlayerNotIgnoredException($faultString, $faultCode); //@todo remove this line
|
||||
case 'Player not black listed.':
|
||||
case 'Player not on guest list.':
|
||||
return new NotInListException($faultString, $faultCode); //@todo remove this line
|
||||
case 'Map not in the selection.':
|
||||
case 'The map isn\'t in the current selection.':
|
||||
return new MapNotInCurrentSelectionException($faultString, $faultCode); //@todo remove this line
|
||||
case 'Map not found.':
|
||||
return new MapNotFoundException($faultString, $faultCode); //@todo remove this line
|
||||
//return new NotInListException($faultString, $faultCode);
|
||||
return new NotInListException($faultString, $faultCode);
|
||||
case 'Start index out of bound.':
|
||||
return new StartIndexOutOfBoundException($faultString, $faultCode); //@todo remove this line
|
||||
case 'invalid index':
|
||||
return new IndexOutOfBoundException($faultString, $faultCode);
|
||||
case 'the next map must be different from the current one.':
|
||||
@ -71,7 +62,6 @@ class FaultException extends Exception
|
||||
return new ChangeInProgressException($faultString, $faultCode);
|
||||
case 'Incompatible map type.':
|
||||
case 'Map not complete.':
|
||||
return new MapNotCompatibleOrCompleteException($faultString, $faultCode); //@todo remove this line
|
||||
case 'The map doesn\'t match the server packmask.':
|
||||
return new InvalidMapException($faultString, $faultCode);
|
||||
case 'Ladder mode unknown.':
|
||||
@ -80,19 +70,14 @@ class FaultException extends Exception
|
||||
return new ServerOptionsException($faultString, $faultCode);
|
||||
case 'New mode unknown.':
|
||||
case 'You need to stop the server to change to/from script mode.':
|
||||
return new GameModeException($faultString, $faultCode); //@todo remove this line
|
||||
case 'Not in script mode.':
|
||||
return new NotInScriptModeException($faultString, $faultCode); //@todo remove this line
|
||||
case 'Not in Team mode.':
|
||||
return new NotInTeamModeException($faultString, $faultCode); //@todo remove this line
|
||||
case 'Not in Rounds or Laps mode.':
|
||||
case 'The scores must be decreasing.':
|
||||
return new GameModeException($faultString, $faultCode);
|
||||
case 'Unable to write the black list file.':
|
||||
case 'Unable to write the guest list file.':
|
||||
return new FileException($faultString, $faultCode); //@todo remove this line
|
||||
case 'Unable to write the playlist file.':
|
||||
return new CouldNotWritePlaylistFileException($faultString, $faultCode); //@todo remove this line
|
||||
case 'Could not save file.':
|
||||
case 'Map unknown.':
|
||||
case 'The playlist file does not exist.':
|
||||
@ -123,59 +108,3 @@ class InvalidMapException extends FaultException{}
|
||||
class GameModeException extends FaultException {}
|
||||
class ServerOptionsException extends FaultException {}
|
||||
class FileException extends FaultException {}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see UnknownPlayerException
|
||||
*/
|
||||
class LoginUnknownException extends UnknownPlayerException {}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see FileException
|
||||
*/
|
||||
class CouldNotWritePlaylistFileException extends FileException {}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see IndexOutOfBoundException
|
||||
*/
|
||||
class StartIndexOutOfBoundException extends IndexOutOfBoundException {}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see GameModeException
|
||||
*/
|
||||
class NotInScriptModeException extends GameModeException {}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see PlayerStateException
|
||||
*/
|
||||
class PlayerIsNotSpectatorException extends PlayerStateException {}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see AlreadyInListException
|
||||
*/
|
||||
class PlayerAlreadyIgnoredException extends AlreadyInListException {}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see NotInListException
|
||||
*/
|
||||
class PlayerNotIgnoredException extends NotInListException {}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see GameModeException
|
||||
*/
|
||||
class NotInTeamModeException extends GameModeException {}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see NotInListException
|
||||
*/
|
||||
class MapNotInCurrentSelectionException extends NotInListException {}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see InvalidMapException
|
||||
*/
|
||||
class MapNotCompatibleOrCompleteException extends InvalidMapException {}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see NotInListException
|
||||
*/
|
||||
class MapNotFoundException extends NotInListException {}
|
||||
|
@ -150,12 +150,17 @@ class GbxRemote
|
||||
switch(count($this->multicallBuffer))
|
||||
{
|
||||
case 0:
|
||||
return;
|
||||
return array();
|
||||
case 1:
|
||||
$call = array_shift($this->multicallBuffer);
|
||||
return $this->query($call['methodName'], $call['params']);
|
||||
return array($this->query($call['methodName'], $call['params']));
|
||||
default:
|
||||
$result = $this->query('system.multicall', array($this->multicallBuffer));
|
||||
foreach($result as &$value)
|
||||
if(isset($value['faultCode']))
|
||||
$value = FaultException::create($value['faultString'], $value['faultCode']);
|
||||
else
|
||||
$value = $value[0];
|
||||
$this->multicallBuffer = array();
|
||||
return $result;
|
||||
}
|
||||
|
16
application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/Request.php
Normal file → Executable file
16
application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/Request.php
Normal file → Executable file
@ -13,7 +13,7 @@ if(extension_loaded('xmlrpc'))
|
||||
{
|
||||
private static $options = array(
|
||||
'encoding' => 'utf-8',
|
||||
'escaping' => 'cdata',
|
||||
'escaping' => 'markup',
|
||||
'verbosity' => 'no_white_space'
|
||||
);
|
||||
|
||||
@ -83,11 +83,11 @@ else
|
||||
switch(gettype($v))
|
||||
{
|
||||
case 'boolean':
|
||||
return '<boolean>'.self::escape((int) $v, $escape).'</boolean>';
|
||||
return '<boolean>'.((int) $v).'</boolean>';
|
||||
case 'integer':
|
||||
return '<int>'.self::escape($v, $escape).'</int>';
|
||||
return '<int>'.$v.'</int>';
|
||||
case 'double':
|
||||
return '<double>'.self::escape($v, $escape).'</double>';
|
||||
return '<double>'.$v.'</double>';
|
||||
case 'string':
|
||||
case 'NULL':
|
||||
if(!$v)
|
||||
@ -98,17 +98,17 @@ else
|
||||
{
|
||||
if(!$v->scalar)
|
||||
return '<base64/>';
|
||||
return '<base64>'.self::escape(base64_encode($v->scalar), $escape).'</base64>';
|
||||
return '<base64>'.base64_encode($v->scalar).'</base64>';
|
||||
}
|
||||
if($v instanceof \DateTime)
|
||||
return '<dateTime.iso8601>'.self::escape($v->format(self::DATE_FORMAT), $escape).'</dateTime.iso8601>';
|
||||
return '<dateTime.iso8601>'.$v->format(self::DATE_FORMAT).'</dateTime.iso8601>';
|
||||
$v = get_object_vars($v);
|
||||
// fallthrough
|
||||
case 'array':
|
||||
$return = '';
|
||||
// empty array case
|
||||
if(!$v)
|
||||
return '<array><data/></array>';
|
||||
$return = '';
|
||||
// pure array case
|
||||
if(array_keys($v) === range(0, count($v) - 1))
|
||||
{
|
||||
@ -132,7 +132,7 @@ else
|
||||
private static function escape($str, $escape=true)
|
||||
{
|
||||
if($escape)
|
||||
return '<![CDATA['.$str.']]>';
|
||||
return '<![CDATA['.str_replace(']]>', ']]]]><![CDATA[>', $str).']]>';
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user