removed 'application' folder to have everything in the root directory
This commit is contained in:
54
libs/Maniaplanet/DedicatedServer/Structures/AbstractStructure.php
Executable file
54
libs/Maniaplanet/DedicatedServer/Structures/AbstractStructure.php
Executable file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
abstract class AbstractStructure
|
||||
{
|
||||
static public function fromArray($array)
|
||||
{
|
||||
if(!is_array($array))
|
||||
return $array;
|
||||
|
||||
$object = new static;
|
||||
foreach($array as $key => $value)
|
||||
$object->{lcfirst($key)} = $value;
|
||||
return $object;
|
||||
}
|
||||
|
||||
static public function fromArrayOfArray($array)
|
||||
{
|
||||
if(!is_array($array))
|
||||
return $array;
|
||||
|
||||
$result = array();
|
||||
foreach($array as $key => $value)
|
||||
$result[$key] = static::fromArray($value);
|
||||
return $result;
|
||||
}
|
||||
|
||||
static public function getPropertyFromArray($array, $property)
|
||||
{
|
||||
return array_map(get_called_class().'::extractProperty', $array, array_fill(0, count($array), $property));
|
||||
}
|
||||
|
||||
static protected function extractProperty($element, $property)
|
||||
{
|
||||
if(!is_a($element, get_called_class()) || !property_exists($element, $property))
|
||||
throw new \InvalidArgumentException('property '.$property.' does not exists in class: '.get_called_class());
|
||||
|
||||
return $element->$property;
|
||||
}
|
||||
|
||||
function toArray()
|
||||
{
|
||||
$out = array();
|
||||
foreach(get_object_vars($this) as $key => $value)
|
||||
$out[ucfirst($key)] = $value;
|
||||
return $out;
|
||||
}
|
||||
}
|
25
libs/Maniaplanet/DedicatedServer/Structures/Bill.php
Executable file
25
libs/Maniaplanet/DedicatedServer/Structures/Bill.php
Executable file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
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;
|
||||
|
||||
/** @var int */
|
||||
public $state;
|
||||
/** @var string */
|
||||
public $stateName;
|
||||
/** @var int */
|
||||
public $transactionId;
|
||||
}
|
20
libs/Maniaplanet/DedicatedServer/Structures/Command.php
Executable file
20
libs/Maniaplanet/DedicatedServer/Structures/Command.php
Executable file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class Command extends AbstractStructure
|
||||
{
|
||||
/** @var string */
|
||||
public $name;
|
||||
/** @var string */
|
||||
public $desc;
|
||||
/** @var string */
|
||||
public $type;
|
||||
/** @var string */
|
||||
public $default;
|
||||
}
|
26
libs/Maniaplanet/DedicatedServer/Structures/FileDesc.php
Executable file
26
libs/Maniaplanet/DedicatedServer/Structures/FileDesc.php
Executable file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class FileDesc extends AbstractStructure
|
||||
{
|
||||
/** @var string */
|
||||
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;
|
||||
}
|
||||
}
|
20
libs/Maniaplanet/DedicatedServer/Structures/ForcedSkin.php
Executable file
20
libs/Maniaplanet/DedicatedServer/Structures/ForcedSkin.php
Executable file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class ForcedSkin extends AbstractStructure
|
||||
{
|
||||
/** @var string */
|
||||
public $orig;
|
||||
/** @var string */
|
||||
public $name;
|
||||
/** @var string */
|
||||
public $checksum;
|
||||
/** @var string */
|
||||
public $url;
|
||||
}
|
71
libs/Maniaplanet/DedicatedServer/Structures/GameInfos.php
Executable file
71
libs/Maniaplanet/DedicatedServer/Structures/GameInfos.php
Executable file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class GameInfos extends AbstractStructure
|
||||
{
|
||||
/**
|
||||
* Game Modes
|
||||
*/
|
||||
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;
|
||||
|
||||
/** @var int */
|
||||
public $gameMode;
|
||||
/** @var string */
|
||||
public $scriptName;
|
||||
/** @var int */
|
||||
public $nbMaps;
|
||||
/** @var int */
|
||||
public $chatTime;
|
||||
/** @var int */
|
||||
public $finishTimeout;
|
||||
/** @var int */
|
||||
public $allWarmUpDuration;
|
||||
/** @var bool */
|
||||
public $disableRespawn;
|
||||
/** @var int */
|
||||
public $forceShowAllOpponents;
|
||||
/** @var int */
|
||||
public $roundsPointsLimit;
|
||||
/** @var int */
|
||||
public $roundsForcedLaps;
|
||||
/** @var bool */
|
||||
public $roundsUseNewRules;
|
||||
/** @var int */
|
||||
public $roundsPointsLimitNewRules;
|
||||
/** @var int */
|
||||
public $teamPointsLimit;
|
||||
/** @var int */
|
||||
public $teamMaxPoints;
|
||||
/** @var bool */
|
||||
public $teamUseNewRules;
|
||||
/** @var int */
|
||||
public $teamPointsLimitNewRules;
|
||||
/** @var int */
|
||||
public $timeAttackLimit;
|
||||
/** @var int */
|
||||
public $timeAttackSynchStartPeriod;
|
||||
/** @var int */
|
||||
public $lapsNbLaps;
|
||||
/** @var int */
|
||||
public $lapsTimeLimit;
|
||||
/** @var int */
|
||||
public $cupPointsLimit;
|
||||
/** @var int */
|
||||
public $cupRoundsPerMap;
|
||||
/** @var int */
|
||||
public $cupNbWinners;
|
||||
/** @var int */
|
||||
public $cupWarmUpDuration;
|
||||
}
|
16
libs/Maniaplanet/DedicatedServer/Structures/LadderLimits.php
Executable file
16
libs/Maniaplanet/DedicatedServer/Structures/LadderLimits.php
Executable file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class LadderLimits extends AbstractStructure
|
||||
{
|
||||
/** @var float */
|
||||
public $ladderServerLimitMin;
|
||||
/** @var float */
|
||||
public $ladderServerLimitMax;
|
||||
}
|
36
libs/Maniaplanet/DedicatedServer/Structures/LadderStats.php
Executable file
36
libs/Maniaplanet/DedicatedServer/Structures/LadderStats.php
Executable file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class LadderStats extends AbstractStructure
|
||||
{
|
||||
/** @var float */
|
||||
public $lastMatchScore;
|
||||
/** @var int */
|
||||
public $nbrMatchWins;
|
||||
/** @var int */
|
||||
public $nbrMatchDraws;
|
||||
/** @var int */
|
||||
public $nbrMatchLosses;
|
||||
/** @var string */
|
||||
public $teamName;
|
||||
/** @var ZoneRanking[] */
|
||||
public $playerRankings;
|
||||
/** @var array */
|
||||
public $teamRankings;
|
||||
|
||||
/**
|
||||
* @return LadderStats
|
||||
*/
|
||||
static function fromArray($array)
|
||||
{
|
||||
$object = parent::fromArray($array);
|
||||
$object->playerRankings = ZoneRanking::fromArrayOfArray($object->playerRankings);
|
||||
return $object;
|
||||
}
|
||||
}
|
20
libs/Maniaplanet/DedicatedServer/Structures/LobbyInfo.php
Executable file
20
libs/Maniaplanet/DedicatedServer/Structures/LobbyInfo.php
Executable file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class LobbyInfo extends AbstractStructure
|
||||
{
|
||||
/** var bool */
|
||||
public $isLobby;
|
||||
/** var int */
|
||||
public $lobbyPlayers;
|
||||
/** var int */
|
||||
public $lobbyMaxPlayers;
|
||||
/** var float */
|
||||
public $lobbyPlayersLevel;
|
||||
}
|
54
libs/Maniaplanet/DedicatedServer/Structures/Map.php
Executable file
54
libs/Maniaplanet/DedicatedServer/Structures/Map.php
Executable file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class Map extends AbstractStructure
|
||||
{
|
||||
/** var string */
|
||||
public $uId;
|
||||
/** var string */
|
||||
public $name;
|
||||
/** var string */
|
||||
public $fileName;
|
||||
/** var string */
|
||||
public $author;
|
||||
/** var string */
|
||||
public $environnement;
|
||||
/** var string */
|
||||
public $mood;
|
||||
/** var int */
|
||||
public $bronzeTime;
|
||||
/** var int */
|
||||
public $silverTime;
|
||||
/** var int */
|
||||
public $goldTime;
|
||||
/** var int */
|
||||
public $authorTime;
|
||||
/** var int */
|
||||
public $copperPrice;
|
||||
/** var bool */
|
||||
public $lapRace;
|
||||
/** var int */
|
||||
public $nbLaps;
|
||||
/** var int */
|
||||
public $nbCheckpoints;
|
||||
/** var string */
|
||||
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;
|
||||
}
|
||||
}
|
16
libs/Maniaplanet/DedicatedServer/Structures/Mod.php
Executable file
16
libs/Maniaplanet/DedicatedServer/Structures/Mod.php
Executable file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class Mod extends AbstractStructure
|
||||
{
|
||||
/** var string */
|
||||
public $env;
|
||||
/** var string */
|
||||
public $url;
|
||||
}
|
28
libs/Maniaplanet/DedicatedServer/Structures/Music.php
Executable file
28
libs/Maniaplanet/DedicatedServer/Structures/Music.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class Music extends AbstractStructure
|
||||
{
|
||||
/** var bool */
|
||||
public $override;
|
||||
/** var string */
|
||||
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;
|
||||
}
|
||||
}
|
37
libs/Maniaplanet/DedicatedServer/Structures/NetworkStats.php
Executable file
37
libs/Maniaplanet/DedicatedServer/Structures/NetworkStats.php
Executable file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class NetworkStats extends AbstractStructure
|
||||
{
|
||||
/** @var int */
|
||||
public $uptime;
|
||||
/** @var int */
|
||||
public $nbrConnection;
|
||||
/** @var int */
|
||||
public $meanConnectionTime;
|
||||
/** @var int */
|
||||
public $meanNbrPlayer;
|
||||
/** @var int */
|
||||
public $recvNetRate;
|
||||
/** @var int */
|
||||
public $sendNetRate;
|
||||
/** @var int */
|
||||
public $totalReceivingSize;
|
||||
/** @var int */
|
||||
public $totalSendingSize;
|
||||
/** @var PlayerNetInfo[] */
|
||||
public $playerNetInfos;
|
||||
|
||||
static public function fromArray($array)
|
||||
{
|
||||
$object = parent::fromArray($array);
|
||||
$object->playerNetInfos = PlayerNetInfo::fromArrayOfArray($object->playerNetInfos);
|
||||
return $object;
|
||||
}
|
||||
}
|
13
libs/Maniaplanet/DedicatedServer/Structures/Player.php
Executable file
13
libs/Maniaplanet/DedicatedServer/Structures/Player.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class Player extends AbstractStructure
|
||||
{
|
||||
/** @var string */
|
||||
public $login;
|
||||
}
|
16
libs/Maniaplanet/DedicatedServer/Structures/PlayerAnswer.php
Executable file
16
libs/Maniaplanet/DedicatedServer/Structures/PlayerAnswer.php
Executable file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class PlayerAnswer extends Player
|
||||
{
|
||||
/** @var int */
|
||||
public $playerId;
|
||||
/** @var int */
|
||||
public $result;
|
||||
}
|
16
libs/Maniaplanet/DedicatedServer/Structures/PlayerBan.php
Executable file
16
libs/Maniaplanet/DedicatedServer/Structures/PlayerBan.php
Executable file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class PlayerBan extends Player
|
||||
{
|
||||
/** @var string */
|
||||
public $clientName;
|
||||
/** @var string */
|
||||
public $iPAddress;
|
||||
}
|
72
libs/Maniaplanet/DedicatedServer/Structures/PlayerDetailedInfo.php
Executable file
72
libs/Maniaplanet/DedicatedServer/Structures/PlayerDetailedInfo.php
Executable file
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class PlayerDetailedInfo extends Player
|
||||
{
|
||||
/** @var string */
|
||||
public $nickName;
|
||||
/** @var int */
|
||||
public $playerId;
|
||||
/** @var int */
|
||||
public $teamId;
|
||||
/** @var string */
|
||||
public $path;
|
||||
/** @var string */
|
||||
public $language;
|
||||
/** @var string */
|
||||
public $clientVersion;
|
||||
/** @var string */
|
||||
public $clientTitleVersion;
|
||||
/** @var string */
|
||||
public $iPAddress;
|
||||
/** @var int */
|
||||
public $downloadRate;
|
||||
/** @var int */
|
||||
public $uploadRate;
|
||||
/** @var bool */
|
||||
public $isSpectator;
|
||||
/** @var bool */
|
||||
public $isInOfficialMode;
|
||||
/** @var bool */
|
||||
public $isReferee;
|
||||
/** @var FileDesc */
|
||||
public $avatar;
|
||||
/** @var Skin[] */
|
||||
public $skins;
|
||||
/** @var LadderStats */
|
||||
public $ladderStats;
|
||||
/** @var int */
|
||||
public $hoursSinceZoneInscription;
|
||||
/** @var string */
|
||||
public $broadcasterLogin;
|
||||
/** @var string[] */
|
||||
public $allies = array();
|
||||
/** @var string */
|
||||
public $clubLink;
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
function getArrayFromPath()
|
||||
{
|
||||
return explode('|', $this->path);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PlayerDetailedInfo
|
||||
*/
|
||||
static public function fromArray($array)
|
||||
{
|
||||
$object = parent::fromArray($array);
|
||||
$object->avatar = FileDesc::fromArray($object->avatar);
|
||||
$object->skins = Skin::fromArrayOfArray($object->skins);
|
||||
$object->ladderStats = LadderStats::fromArray($object->ladderStats);
|
||||
return $object;
|
||||
}
|
||||
}
|
87
libs/Maniaplanet/DedicatedServer/Structures/PlayerInfo.php
Executable file
87
libs/Maniaplanet/DedicatedServer/Structures/PlayerInfo.php
Executable file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class PlayerInfo extends Player
|
||||
{
|
||||
/** @var string */
|
||||
public $nickName;
|
||||
/** @var int */
|
||||
public $playerId;
|
||||
/** @var int */
|
||||
public $teamId;
|
||||
/** @var bool */
|
||||
public $isSpectator;
|
||||
/** @var bool */
|
||||
public $isInOfficialMode;
|
||||
/** @var int */
|
||||
public $ladderRanking;
|
||||
/** @var int */
|
||||
public $spectatorStatus;
|
||||
/** @var int */
|
||||
public $flags;
|
||||
|
||||
//Flags details
|
||||
/** @var int */
|
||||
public $forceSpectator;
|
||||
/** @var bool */
|
||||
public $isReferee;
|
||||
/** @var bool */
|
||||
public $isPodiumReady;
|
||||
/** @var bool */
|
||||
public $isUsingStereoscopy;
|
||||
/** @var bool */
|
||||
public $isManagedByAnOtherServer;
|
||||
/** @var bool */
|
||||
public $isServer;
|
||||
/** @var bool */
|
||||
public $hasPlayerSlot;
|
||||
/** @var bool */
|
||||
public $isBroadcasting;
|
||||
/** @var bool */
|
||||
public $hasJoinedGame;
|
||||
|
||||
//SpectatorStatus details
|
||||
/** @var bool */
|
||||
public $spectator;
|
||||
/** @var bool */
|
||||
public $temporarySpectator;
|
||||
/** @var bool */
|
||||
public $pureSpectator;
|
||||
/** @var bool */
|
||||
public $autoTarget;
|
||||
/** @var int */
|
||||
public $currentTargetId;
|
||||
|
||||
/**
|
||||
* @return PlayerInfo
|
||||
*/
|
||||
static public function fromArray($array)
|
||||
{
|
||||
$object = parent::fromArray($array);
|
||||
|
||||
//Detail flags
|
||||
$object->forceSpectator = $object->flags % 10; // 0, 1 or 2
|
||||
$object->isReferee = (bool) (intval($object->flags / 10) % 10);
|
||||
$object->isPodiumReady = (bool) (intval($object->flags / 100) % 10);
|
||||
$object->isUsingStereoscopy = (bool) (intval($object->flags / 1000) % 10);
|
||||
$object->isManagedByAnOtherServer = (bool) (intval($object->flags / 10000) % 10);
|
||||
$object->isServer = (bool) (intval($object->flags / 100000) % 10);
|
||||
$object->hasPlayerSlot = (bool) (intval($object->flags / 1000000) % 10);
|
||||
$object->isBroadcasting = (bool) (intval($object->flags / 10000000) % 10);
|
||||
$object->hasJoinedGame = (bool) (intval($object->flags / 100000000) % 10);
|
||||
//Details spectatorStatus
|
||||
$object->spectator = (bool) ($object->spectatorStatus % 10);
|
||||
$object->temporarySpectator = (bool) (intval($object->spectatorStatus / 10) % 10);
|
||||
$object->pureSpectator = (bool) (intval($object->spectatorStatus / 100) % 10);
|
||||
$object->autoTarget = (bool) (intval($object->spectatorStatus / 1000) % 10);
|
||||
$object->currentTargetId = intval($object->spectatorStatus / 10000);
|
||||
|
||||
return $object;
|
||||
}
|
||||
}
|
22
libs/Maniaplanet/DedicatedServer/Structures/PlayerNetInfo.php
Executable file
22
libs/Maniaplanet/DedicatedServer/Structures/PlayerNetInfo.php
Executable file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class PlayerNetInfo extends Player
|
||||
{
|
||||
/** @var string */
|
||||
public $iPAddress;
|
||||
/** @var int */
|
||||
public $stateUpdateLatency;
|
||||
/** @var int */
|
||||
public $stateUpdatePeriod;
|
||||
/** @var int */
|
||||
public $latestNetworkActivity;
|
||||
/** @var float */
|
||||
public $packetLossRate;
|
||||
}
|
28
libs/Maniaplanet/DedicatedServer/Structures/PlayerRanking.php
Executable file
28
libs/Maniaplanet/DedicatedServer/Structures/PlayerRanking.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class PlayerRanking extends Player
|
||||
{
|
||||
/** @var string */
|
||||
public $nickName;
|
||||
/** @var int */
|
||||
public $playerId;
|
||||
/** @var int */
|
||||
public $rank;
|
||||
/** @var int */
|
||||
public $bestTime;
|
||||
/** @var int[] */
|
||||
public $bestCheckpoints;
|
||||
/** @var int */
|
||||
public $score;
|
||||
/** @var int */
|
||||
public $nbrLapsFinished;
|
||||
/** @var float */
|
||||
public $ladderScore;
|
||||
}
|
35
libs/Maniaplanet/DedicatedServer/Structures/ScriptInfo.php
Executable file
35
libs/Maniaplanet/DedicatedServer/Structures/ScriptInfo.php
Executable file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class ScriptInfo extends AbstractStructure
|
||||
{
|
||||
/** @var string */
|
||||
public $name;
|
||||
/** @var string */
|
||||
public $compatibleMapTypes;
|
||||
/** @var string */
|
||||
public $description;
|
||||
/** @var string */
|
||||
public $version;
|
||||
/** @var ScriptSettings[] */
|
||||
public $paramDescs = array();
|
||||
/** @var Command[] */
|
||||
public $commandDescs = array();
|
||||
|
||||
/**
|
||||
* @return ScriptInfo
|
||||
*/
|
||||
public static function fromArray($array)
|
||||
{
|
||||
$object = parent::fromArray($array);
|
||||
$object->paramDescs = ScriptSettings::fromArrayOfArray($object->paramDescs);
|
||||
$object->commandDescs = Command::fromArrayOfArray($object->commandDescs);
|
||||
return $object;
|
||||
}
|
||||
}
|
20
libs/Maniaplanet/DedicatedServer/Structures/ScriptSettings.php
Executable file
20
libs/Maniaplanet/DedicatedServer/Structures/ScriptSettings.php
Executable file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class ScriptSettings extends AbstractStructure
|
||||
{
|
||||
/** @var string */
|
||||
public $name;
|
||||
/** @var string */
|
||||
public $desc;
|
||||
/** @var string */
|
||||
public $type;
|
||||
/** @var string */
|
||||
public $default;
|
||||
}
|
106
libs/Maniaplanet/DedicatedServer/Structures/ServerOptions.php
Executable file
106
libs/Maniaplanet/DedicatedServer/Structures/ServerOptions.php
Executable file
@ -0,0 +1,106 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class ServerOptions extends AbstractStructure
|
||||
{
|
||||
/** @var string */
|
||||
public $name;
|
||||
/** @var string */
|
||||
public $comment;
|
||||
/** @var string */
|
||||
public $password;
|
||||
/** @var string */
|
||||
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 */
|
||||
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
|
||||
* @return bool
|
||||
*/
|
||||
function isValid()
|
||||
{
|
||||
return is_string($this->name)
|
||||
&& is_string($this->comment)
|
||||
&& is_string($this->password)
|
||||
&& is_string($this->passwordForSpectator)
|
||||
&& is_int($this->nextCallVoteTimeOut)
|
||||
&& 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;
|
||||
}
|
||||
}
|
26
libs/Maniaplanet/DedicatedServer/Structures/Skin.php
Executable file
26
libs/Maniaplanet/DedicatedServer/Structures/Skin.php
Executable file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class Skin extends AbstractStructure
|
||||
{
|
||||
/** @var string */
|
||||
public $environnement;
|
||||
/** @var FileDesc */
|
||||
public $packDesc;
|
||||
|
||||
/**
|
||||
* @return Skin
|
||||
*/
|
||||
public static function fromArray($array)
|
||||
{
|
||||
$object = parent::fromArray($array);
|
||||
$object->packDesc = FileDesc::fromArray($object->packDesc);
|
||||
return $object;
|
||||
}
|
||||
}
|
24
libs/Maniaplanet/DedicatedServer/Structures/Status.php
Executable file
24
libs/Maniaplanet/DedicatedServer/Structures/Status.php
Executable file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class Status extends AbstractStructure
|
||||
{
|
||||
const UNKNOWN = 0;
|
||||
const WAITING = 1;
|
||||
const LAUNCHING = 2;
|
||||
const SYNCHRONIZATION = 3;
|
||||
const PLAY = 4;
|
||||
const EXITING = 6;
|
||||
const LOCAL = 7;
|
||||
|
||||
/** @var int */
|
||||
public $code;
|
||||
/** @var string */
|
||||
public $name;
|
||||
}
|
32
libs/Maniaplanet/DedicatedServer/Structures/SystemInfos.php
Executable file
32
libs/Maniaplanet/DedicatedServer/Structures/SystemInfos.php
Executable file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class SystemInfos extends AbstractStructure
|
||||
{
|
||||
/** @var string */
|
||||
public $publishedIp;
|
||||
/** @var int */
|
||||
public $port;
|
||||
/** @var int */
|
||||
public $p2PPort;
|
||||
/** @var string */
|
||||
public $titleId;
|
||||
/** @var string */
|
||||
public $serverLogin;
|
||||
/** @var int */
|
||||
public $serverPlayerId;
|
||||
/** @var int */
|
||||
public $connectionDownloadRate;
|
||||
/** @var int */
|
||||
public $connectionUploadRate;
|
||||
/** @var bool */
|
||||
public $isServer;
|
||||
/** @var bool */
|
||||
public $isDedicated;
|
||||
}
|
16
libs/Maniaplanet/DedicatedServer/Structures/Tag.php
Executable file
16
libs/Maniaplanet/DedicatedServer/Structures/Tag.php
Executable file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class Tag extends AbstractStructure
|
||||
{
|
||||
/** @var string */
|
||||
public $name;
|
||||
/** @var string */
|
||||
public $value;
|
||||
}
|
28
libs/Maniaplanet/DedicatedServer/Structures/Team.php
Executable file
28
libs/Maniaplanet/DedicatedServer/Structures/Team.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class Team extends AbstractStructure
|
||||
{
|
||||
/** @var string */
|
||||
public $name;
|
||||
/** @var string */
|
||||
public $zonePath;
|
||||
/** @var string */
|
||||
public $city;
|
||||
/** @var string */
|
||||
public $emblemUrl;
|
||||
/** @var float */
|
||||
public $huePrimary;
|
||||
/** @var float */
|
||||
public $hueSecondary;
|
||||
/** @var string */
|
||||
public $rGB;
|
||||
/** @var string */
|
||||
public $clubLinkUrl;
|
||||
}
|
16
libs/Maniaplanet/DedicatedServer/Structures/TokenInfos.php
Executable file
16
libs/Maniaplanet/DedicatedServer/Structures/TokenInfos.php
Executable file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class TokenInfos extends AbstractStructure
|
||||
{
|
||||
/** @var int */
|
||||
public $tokenCost;
|
||||
/** @var bool */
|
||||
public $canPayToken;
|
||||
}
|
22
libs/Maniaplanet/DedicatedServer/Structures/Version.php
Executable file
22
libs/Maniaplanet/DedicatedServer/Structures/Version.php
Executable file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class Version extends AbstractStructure
|
||||
{
|
||||
/** @var string */
|
||||
public $name;
|
||||
/** @var string */
|
||||
public $titleId;
|
||||
/** @var string */
|
||||
public $version;
|
||||
/** @var string */
|
||||
public $build;
|
||||
/** @var string */
|
||||
public $apiVersion;
|
||||
}
|
45
libs/Maniaplanet/DedicatedServer/Structures/Vote.php
Executable file
45
libs/Maniaplanet/DedicatedServer/Structures/Vote.php
Executable file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class Vote extends AbstractStructure
|
||||
{
|
||||
const STATE_NEW = 'NewVote';
|
||||
const STATE_CANCELLED = 'VoteCancelled';
|
||||
const STATE_PASSED = 'VotePassed';
|
||||
const STATE_FAILED = 'VoteFailed';
|
||||
|
||||
/** @var string */
|
||||
public $status;
|
||||
/** @var string */
|
||||
public $callerLogin;
|
||||
/** @var string */
|
||||
public $cmdName;
|
||||
/** @var mixed[] */
|
||||
public $cmdParam;
|
||||
|
||||
/**
|
||||
* @param string $cmdName
|
||||
* @param mixed[] $cmdParam
|
||||
*/
|
||||
function __construct($cmdName='', $cmdParam=array())
|
||||
{
|
||||
$this->cmdName = $cmdName;
|
||||
$this->cmdParam = $cmdParam;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @return bool
|
||||
*/
|
||||
function isValid()
|
||||
{
|
||||
return is_string($this->cmdName)
|
||||
&& is_array($this->cmdParam);
|
||||
}
|
||||
}
|
60
libs/Maniaplanet/DedicatedServer/Structures/VoteRatio.php
Executable file
60
libs/Maniaplanet/DedicatedServer/Structures/VoteRatio.php
Executable file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class VoteRatio extends AbstractStructure
|
||||
{
|
||||
const COMMAND_DEFAULT = '*';
|
||||
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';
|
||||
|
||||
/** @var string '*' for default */
|
||||
public $command;
|
||||
/** @var string Empty to match all votes for the command */
|
||||
public $param;
|
||||
/** @var float Must be in range [0,1] or -1 to disable */
|
||||
public $ratio;
|
||||
|
||||
/**
|
||||
* @param string $command
|
||||
* @param float $ratio
|
||||
*/
|
||||
public function __construct($command = '', $ratio = 0.)
|
||||
{
|
||||
$this->command = $command;
|
||||
$this->ratio = $ratio;
|
||||
$this->param = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @return bool
|
||||
*/
|
||||
function isValid()
|
||||
{
|
||||
return is_string($this->command)
|
||||
&& is_string($this->param)
|
||||
&& self::isRatio($this->ratio);
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param float $ratio
|
||||
* @return bool
|
||||
*/
|
||||
static function isRatio($ratio)
|
||||
{
|
||||
return is_float($ratio) && ($ratio === -1. || ($ratio >= 0. && $ratio <= 1.));
|
||||
}
|
||||
}
|
28
libs/Maniaplanet/DedicatedServer/Structures/ZoneRanking.php
Executable file
28
libs/Maniaplanet/DedicatedServer/Structures/ZoneRanking.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Structures;
|
||||
|
||||
class ZoneRanking extends AbstractStructure
|
||||
{
|
||||
/** @var string */
|
||||
public $path;
|
||||
/** @var float */
|
||||
public $score;
|
||||
/** @var int */
|
||||
public $ranking;
|
||||
/** @var int */
|
||||
public $totalCount;
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
function getArrayFromPath()
|
||||
{
|
||||
return explode('|', $this->path);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user