Merge remote-tracking branch 'origin/master'

This commit is contained in:
Max Klaversma 2014-05-08 19:40:58 +02:00
commit c149e696b1
43 changed files with 2477 additions and 2430 deletions

View File

@ -52,5 +52,3 @@ abstract class AbstractStructure
return $out; return $out;
} }
} }
?>

View File

@ -4,6 +4,7 @@
* *
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3 * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
*/ */
namespace Maniaplanet\DedicatedServer\Structures; namespace Maniaplanet\DedicatedServer\Structures;
class Bill extends AbstractStructure class Bill extends AbstractStructure
@ -15,8 +16,10 @@ class Bill extends AbstractStructure
const STATE_REFUSED = 5; const STATE_REFUSED = 5;
const STATE_ERROR = 6; const STATE_ERROR = 6;
/** @var int */
public $state; public $state;
/** @var string */
public $stateName; public $stateName;
/** @var int */
public $transactionId; public $transactionId;
} }
?>

View File

@ -1,18 +1,20 @@
<?php <?php
/** /**
* @version $Revision: $: * ManiaPlanet dedicated server Xml-RPC client
* @author $Author: $: *
* @date $Date: $: * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
*/ */
namespace Maniaplanet\DedicatedServer\Structures; namespace Maniaplanet\DedicatedServer\Structures;
class Command extends AbstractStructure class Command extends AbstractStructure
{ {
/** @var string */
public $name; public $name;
/** @var string */
public $desc; public $desc;
/** @var string */
public $type; public $type;
/** @var string */
public $default; public $default;
} }
?>

View 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 FileDesc extends AbstractStructure
{
/** @var string */
public $fileName;
/** @var string */
public $checksum;
}

View 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;
}

View File

@ -4,6 +4,7 @@
* *
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3 * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
*/ */
namespace Maniaplanet\DedicatedServer\Structures; namespace Maniaplanet\DedicatedServer\Structures;
class GameInfos extends AbstractStructure class GameInfos extends AbstractStructure
@ -19,29 +20,52 @@ class GameInfos extends AbstractStructure
const GAMEMODE_CUP = 5; const GAMEMODE_CUP = 5;
const GAMEMODE_STUNTS = 6; const GAMEMODE_STUNTS = 6;
/** @var int */
public $gameMode; public $gameMode;
/** @var string */
public $scriptName; public $scriptName;
/** @var int */
public $nbMaps; public $nbMaps;
/** @var int */
public $chatTime; public $chatTime;
/** @var int */
public $finishTimeout; public $finishTimeout;
/** @var int */
public $allWarmUpDuration; public $allWarmUpDuration;
/** @var bool */
public $disableRespawn; public $disableRespawn;
/** @var int */
public $forceShowAllOpponents; public $forceShowAllOpponents;
/** @var int */
public $roundsPointsLimit; public $roundsPointsLimit;
/** @var int */
public $roundsForcedLaps; public $roundsForcedLaps;
/** @var bool */
public $roundsUseNewRules; public $roundsUseNewRules;
/** @var int */
public $roundsPointsLimitNewRules; public $roundsPointsLimitNewRules;
/** @var int */
public $teamPointsLimit; public $teamPointsLimit;
/** @var int */
public $teamMaxPoints; public $teamMaxPoints;
/** @var bool */
public $teamUseNewRules; public $teamUseNewRules;
/** @var int */
public $teamPointsLimitNewRules; public $teamPointsLimitNewRules;
/** @var int */
public $timeAttackLimit; public $timeAttackLimit;
/** @var int */
public $timeAttackSynchStartPeriod; public $timeAttackSynchStartPeriod;
/** @var int */
public $lapsNbLaps; public $lapsNbLaps;
/** @var int */
public $lapsTimeLimit; public $lapsTimeLimit;
/** @var int */
public $cupPointsLimit; public $cupPointsLimit;
/** @var int */
public $cupRoundsPerMap; public $cupRoundsPerMap;
/** @var int */
public $cupNbWinners; public $cupNbWinners;
/** @var int */
public $cupWarmUpDuration; public $cupWarmUpDuration;
} }
?>

View 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;
}

View 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;
}
}

View File

@ -4,14 +4,17 @@
* *
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3 * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
*/ */
namespace Maniaplanet\DedicatedServer\Structures; namespace Maniaplanet\DedicatedServer\Structures;
class LobbyInfo extends AbstractStructure class LobbyInfo extends AbstractStructure
{ {
/** var bool */
public $isLobby; public $isLobby;
/** var int */
public $lobbyPlayers; public $lobbyPlayers;
/** var int */
public $lobbyMaxPlayers; public $lobbyMaxPlayers;
/** var float */
public $lobbyPlayersLevel; public $lobbyPlayersLevel;
} }
?>

View File

@ -4,24 +4,41 @@
* *
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3 * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
*/ */
namespace Maniaplanet\DedicatedServer\Structures; namespace Maniaplanet\DedicatedServer\Structures;
class Map extends AbstractStructure class Map extends AbstractStructure
{ {
/** var string */
public $uId; public $uId;
/** var string */
public $name; public $name;
/** var string */
public $fileName; public $fileName;
/** var string */
public $author; public $author;
/** var string */
public $environnement; public $environnement;
/** var string */
public $mood; public $mood;
/** var int */
public $bronzeTime; public $bronzeTime;
/** var int */
public $silverTime; public $silverTime;
/** var int */
public $goldTime; public $goldTime;
/** var int */
public $authorTime; public $authorTime;
/** var int */
public $copperPrice; public $copperPrice;
/** var bool */
public $lapRace; public $lapRace;
/** var int */
public $nbLaps; public $nbLaps;
/** var int */
public $nbCheckpoints; public $nbCheckpoints;
/** var string */
public $mapType; public $mapType;
/** var string */
public $mapStyle; public $mapStyle;
} }

View File

@ -4,15 +4,13 @@
* *
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3 * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
*/ */
namespace Maniaplanet\DedicatedServer\Structures; namespace Maniaplanet\DedicatedServer\Structures;
class Mod extends AbstractStructure class Mod extends AbstractStructure
{ {
/** var string */
public $env; public $env;
/** var string */
public $url; public $url;
function toArray()
{
return array('Env'=>$this->env,'Url'=>$this->url);
}
} }

View File

@ -4,11 +4,15 @@
* *
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3 * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
*/ */
namespace Maniaplanet\DedicatedServer\Structures; namespace Maniaplanet\DedicatedServer\Structures;
class Music extends AbstractStructure class Music extends AbstractStructure
{ {
/** var bool */
public $override; public $override;
/** var string */
public $url; public $url;
/** var string */
public $file; public $file;
} }

View File

@ -4,24 +4,34 @@
* *
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3 * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
*/ */
namespace Maniaplanet\DedicatedServer\Structures; namespace Maniaplanet\DedicatedServer\Structures;
class NetworkStats extends AbstractStructure class NetworkStats extends AbstractStructure
{ {
/** @var int */
public $uptime; public $uptime;
/** @var int */
public $nbrConnection; public $nbrConnection;
/** @var int */
public $meanConnectionTime; public $meanConnectionTime;
/** @var int */
public $meanNbrPlayer; public $meanNbrPlayer;
/** @var int */
public $recvNetRate; public $recvNetRate;
/** @var int */
public $sendNetRate; public $sendNetRate;
/** @var int */
public $totalReceivingSize; public $totalReceivingSize;
/** @var int */
public $totalSendingSize; public $totalSendingSize;
/** @var PlayerNetInfo[] */
public $playerNetInfos; public $playerNetInfos;
static public function fromArray($array) static public function fromArray($array)
{ {
$object = parent::fromArray($array); $object = parent::fromArray($array);
$object->playerNetInfos = Player::fromArrayOfArray($object->playerNetInfos); $object->playerNetInfos = PlayerNetInfo::fromArrayOfArray($object->playerNetInfos);
return $object; return $object;
} }
} }

View File

@ -8,90 +8,6 @@ namespace Maniaplanet\DedicatedServer\Structures;
class Player extends AbstractStructure class Player extends AbstractStructure
{ {
public $playerId; /** @var string */
public $login; public $login;
public $nickName;
public $teamId;
public $path;
public $language;
public $clientVersion;
public $clientName;
public $iPAddress;
public $downloadRate;
public $uploadRate;
public $isSpectator;
public $isInOfficialMode;
public $avatar;
public $skins;
public $ladderStats;
public $hoursSinceZoneInscription;
public $onlineRights;
public $rank;
public $bestTime;
public $bestCheckpoints;
public $score;
public $nbrLapsFinished;
public $ladderScore;
public $stateUpdateLatency;
public $stateUpdatePeriod;
public $latestNetworkActivity;
public $packetLossRate;
public $spectatorStatus;
public $ladderRanking;
public $flags;
public $isConnected = true;
public $allies = array();
public $clubLink;
//Flags details
public $forceSpectator;
public $isReferee;
public $isPodiumReady;
public $isUsingStereoscopy;
public $isManagedByAnOtherServer;
public $isServer;
public $hasPlayerSlot;
public $isBroadcasting;
public $hasJoinedGame;
//SpectatorStatus details
public $spectator;
public $temporarySpectator;
public $pureSpectator;
public $autoTarget;
public $currentTargetId;
function getArrayFromPath()
{
return explode('|', $this->path);
} }
/**
* @return Player
*/
static public function fromArray($array)
{
$object = parent::fromArray($array);
$object->skins = Skin::fromArrayOfArray($object->skins);
//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;
}
}
?>

View 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;
}

View 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;
}

View 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;
}
}

View 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;
}
}

View 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;
}

View 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;
}

View File

@ -9,29 +9,24 @@ namespace Maniaplanet\DedicatedServer\Structures;
class ScriptInfo extends AbstractStructure class ScriptInfo extends AbstractStructure
{ {
/** @var string */
public $name; public $name;
/** @var string */
public $compatibleMapTypes; public $compatibleMapTypes;
/** @var string */
public $description; public $description;
/** @var string */
public $version; public $version;
/** @var ScriptSettings[] */
public $paramDescs = array(); public $paramDescs = array();
/** @var Command[] */
public $commandDescs = array(); public $commandDescs = array();
static public function fromArray($array) static public function fromArray($array)
{ {
$object = parent::fromArray($array); $object = parent::fromArray($array);
if($object->paramDescs)
{
$object->paramDescs = ScriptSettings::fromArrayOfArray($object->paramDescs); $object->paramDescs = ScriptSettings::fromArrayOfArray($object->paramDescs);
}
if($object->commandDescs)
{
$object->commandDescs = Command::fromArrayOfArray($object->commandDescs); $object->commandDescs = Command::fromArrayOfArray($object->commandDescs);
}
return $object; return $object;
} }
} }
?>

View File

@ -7,14 +7,14 @@
namespace Maniaplanet\DedicatedServer\Structures; namespace Maniaplanet\DedicatedServer\Structures;
final class ScriptSettings extends AbstractStructure class ScriptSettings extends AbstractStructure
{ {
/** @var string */
public $name; public $name;
/** @var string */
public $desc; public $desc;
/** @var string */
public $type; public $type;
/** @var string */
public $default; public $default;
} }
?>

View File

@ -9,36 +9,66 @@ namespace Maniaplanet\DedicatedServer\Structures;
class ServerOptions extends AbstractStructure class ServerOptions extends AbstractStructure
{ {
/** @var string */
public $name; public $name;
/** @var string */
public $comment; public $comment;
/** @var string */
public $password; public $password;
/** @var string */
public $passwordForSpectator; public $passwordForSpectator;
/** @var int */
public $hideServer; public $hideServer;
/** @var int */
public $currentMaxPlayers; public $currentMaxPlayers;
/** @var int */
public $nextMaxPlayers; public $nextMaxPlayers;
/** @var int */
public $currentMaxSpectators; public $currentMaxSpectators;
/** @var int */
public $nextMaxSpectators; public $nextMaxSpectators;
/** @var bool */
public $isP2PUpload; public $isP2PUpload;
/** @var bool */
public $isP2PDownload; public $isP2PDownload;
/** @var bool */
public $currentLadderMode; public $currentLadderMode;
/** @var int */
public $nextLadderMode; public $nextLadderMode;
/** @var float */
public $ladderServerLimitMax; public $ladderServerLimitMax;
/** @var float */
public $ladderServerLimitMin; public $ladderServerLimitMin;
/** @var int */
public $currentVehicleNetQuality; public $currentVehicleNetQuality;
/** @var int */
public $nextVehicleNetQuality; public $nextVehicleNetQuality;
/** @var int */
public $currentCallVoteTimeOut; public $currentCallVoteTimeOut;
/** @var int */
public $nextCallVoteTimeOut; public $nextCallVoteTimeOut;
/** @var float */
public $callVoteRatio; public $callVoteRatio;
/** @var bool */
public $allowMapDownload; public $allowMapDownload;
/** @var bool */
public $autoSaveReplays; public $autoSaveReplays;
/** @var bool */
public $autoSaveValidationReplays; public $autoSaveValidationReplays;
/** @var string */
public $refereePassword; public $refereePassword;
/** @var int */
public $refereeMode; public $refereeMode;
/** @var bool */
public $currentUseChangingValidationSeed; public $currentUseChangingValidationSeed;
public $useChangingValidationSeed; /** @var bool */
public $nextUseChangingValidationSeed; public $nextUseChangingValidationSeed;
/** @var int */
public $clientInputsMaxLatency; public $clientInputsMaxLatency;
/** @var bool */
public $keepPlayerSlots; public $keepPlayerSlots;
/** @var bool */
public $disableHorns; public $disableHorns;
/** @var bool */
public $disableServiceAnnounces; public $disableServiceAnnounces;
} }

View File

@ -9,8 +9,15 @@ namespace Maniaplanet\DedicatedServer\Structures;
class Skin extends AbstractStructure class Skin extends AbstractStructure
{ {
public $orig; /** @var string */
public $name; public $environnement;
public $checksum; /** @var FileDesc */
public $url; public $packDesc;
static function fromArray($array)
{
$object = parent::fromArray($array);
$object->packDesc = FileDesc::fromArray($object->packDesc);
return $object;
}
} }

View File

@ -4,6 +4,7 @@
* *
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3 * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
*/ */
namespace Maniaplanet\DedicatedServer\Structures; namespace Maniaplanet\DedicatedServer\Structures;
class Status extends AbstractStructure class Status extends AbstractStructure
@ -15,6 +16,8 @@ class Status extends AbstractStructure
const PLAY = 4; const PLAY = 4;
const EXITING = 6; const EXITING = 6;
/** @var int */
public $code; public $code;
/** @var string */
public $name; public $name;
} }

View File

@ -4,19 +4,29 @@
* *
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3 * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
*/ */
namespace Maniaplanet\DedicatedServer\Structures; namespace Maniaplanet\DedicatedServer\Structures;
class SystemInfos extends AbstractStructure class SystemInfos extends AbstractStructure
{ {
/** @var string */
public $publishedIp; public $publishedIp;
/** @var int */
public $port; public $port;
/** @var int */
public $p2PPort; public $p2PPort;
/** @var string */
public $titleId; public $titleId;
/** @var string */
public $serverLogin; public $serverLogin;
/** @var int */
public $serverPlayerId; public $serverPlayerId;
/** @var int */
public $connectionDownloadRate; public $connectionDownloadRate;
/** @var int */
public $connectionUploadRate; public $connectionUploadRate;
/** @var bool */
public $isServer; public $isServer;
/** @var bool */
public $isDedicated; public $isDedicated;
} }
?>

View 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;
}

View File

@ -9,14 +9,20 @@ namespace Maniaplanet\DedicatedServer\Structures;
class Team extends AbstractStructure class Team extends AbstractStructure
{ {
/** @var string */
public $name; public $name;
/** @var string */
public $zonePath; public $zonePath;
/** @var string */
public $city; public $city;
/** @var string */
public $emblemUrl; public $emblemUrl;
/** @var float */
public $huePrimary; public $huePrimary;
/** @var float */
public $hueSecondary; public $hueSecondary;
/** @var string */
public $rGB; public $rGB;
/** @var string */
public $clubLinkUrl; public $clubLinkUrl;
} }
?>

View File

@ -9,10 +9,14 @@ namespace Maniaplanet\DedicatedServer\Structures;
class Version extends AbstractStructure class Version extends AbstractStructure
{ {
/** @var string */
public $name; public $name;
/** @var string */
public $titleId; public $titleId;
/** @var string */
public $version; public $version;
/** @var string */
public $build; public $build;
/** @var string */
public $apiVersion; public $apiVersion;
} }
?>

View File

@ -14,9 +14,31 @@ class Vote extends AbstractStructure
const STATE_PASSED = 'VotePassed'; const STATE_PASSED = 'VotePassed';
const STATE_FAILED = 'VoteFailed'; const STATE_FAILED = 'VoteFailed';
/** @var string */
public $status; public $status;
/** @var string */
public $callerLogin; public $callerLogin;
/** @var string */
public $cmdName; public $cmdName;
/** @var mixed[] */
public $cmdParam; public $cmdParam;
/**
* @param string $cmdName
* @param mixed[] $cmdParam
*/
function __construct($cmdName='', $cmdParam=array())
{
$this->cmdName = $cmdName;
$this->cmdParam = $cmdParam;
}
/**
* @return bool
*/
function isValid()
{
return is_string($this->cmdName)
&& is_array($this->cmdParam);
}
} }
?>

View File

@ -18,14 +18,40 @@ class VoteRatio extends AbstractStructure
const COMMAND_KICK = 'Kick'; const COMMAND_KICK = 'Kick';
const COMMAND_BAN = 'Ban'; const COMMAND_BAN = 'Ban';
/** @var string '*' for default */
public $command; public $command;
/** @var string Empty to match all votes for the command */
public $param; public $param;
/** @var float Must be in range [0,1] or -1 to disable */
public $ratio; public $ratio;
public function __construct($command = null, $ratio = null) /**
* @param string $command
* @param float $ratio
*/
public function __construct($command = '', $ratio = 0.)
{ {
$this->command = $command; $this->command = $command;
$this->ratio = $ratio; $this->ratio = $ratio;
$this->param = '';
}
/**
* @return bool
*/
function isValid()
{
return is_string($this->command)
&& is_string($this->param)
&& self::isRatio($this->ratio);
}
/**
* @param float $ratio
* @return bool
*/
static function isRatio($ratio)
{
return is_float($ratio) && ($ratio === -1. || ($ratio >= 0. && $ratio <= 1.));
} }
} }
?>

View 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);
}
}

View File

@ -19,6 +19,12 @@ class Base64
{ {
$this->scalar = $data; $this->scalar = $data;
} }
}
?> /**
* @return string
*/
function __toString()
{
return $this->scalar;
}
}

View File

@ -8,5 +8,3 @@
namespace Maniaplanet\DedicatedServer\Xmlrpc; namespace Maniaplanet\DedicatedServer\Xmlrpc;
class Exception extends \Exception {} class Exception extends \Exception {}
?>

View File

@ -57,5 +57,3 @@ class MapNotCompatibleOrCompleteException extends FaultException{}
class LadderModeUnknownException extends FaultException{} class LadderModeUnknownException extends FaultException{}
class PlayerAlreadyIgnoredException extends FaultException{} class PlayerAlreadyIgnoredException extends FaultException{}
class PlayerNotIgnoredException extends FaultException{} class PlayerNotIgnoredException extends FaultException{}
?>

View File

@ -17,7 +17,6 @@ class GbxRemote
private $socket; private $socket;
private $timeouts = array( private $timeouts = array(
'open' => 5,
'read' => 5000, 'read' => 5000,
'write' => 5000 'write' => 5000
); );
@ -29,13 +28,12 @@ class GbxRemote
/** /**
* @param string $host * @param string $host
* @param int $port * @param int $port
* @param int[string] $timeouts Override default timeouts for 'open' (in s), 'read' (in ms) and 'write' (in ms) socket operations * @param int $timeout Timeout when opening connection
*/ */
function __construct($host, $port, $timeouts = array()) function __construct($host, $port, $timeout = 5)
{ {
$this->requestHandle = (int) 0x80000000; $this->requestHandle = (int) 0x80000000;
$this->timeouts = array_merge($this->timeouts, $timeouts); $this->connect($host, $port, $timeout);
$this->connect($host, $port);
} }
function __destruct() function __destruct()
@ -45,10 +43,10 @@ class GbxRemote
/** /**
* Change timeouts * Change timeouts
* @param int $read read timeout (in ms), null or 0 to leave unchanged * @param int $read read timeout (in ms), 0 to leave unchanged
* @param int $write write timeout (in ms), null or 0 to leave unchanged * @param int $write write timeout (in ms), 0 to leave unchanged
*/ */
function setTimeouts($read=null, $write=null) function setTimeouts($read=0, $write=0)
{ {
if($read) if($read)
$this->timeouts['read'] = $read; $this->timeouts['read'] = $read;
@ -68,12 +66,12 @@ class GbxRemote
/** /**
* @param string $host * @param string $host
* @param int $port * @param int $port
* @param int $timeout
* @throws TransportException * @throws TransportException
*/ */
private function connect($host, $port) private function connect($host, $port, $timeout)
{ {
$this->socket = @fsockopen($host, $port, $errno, $errstr, $this->timeouts['open']); $this->socket = @fsockopen($host, $port, $errno, $errstr, $timeout);
if(!$this->socket) if(!$this->socket)
throw new TransportException('Cannot open socket', TransportException::NOT_INITIALIZED); throw new TransportException('Cannot open socket', TransportException::NOT_INITIALIZED);
@ -114,12 +112,13 @@ class GbxRemote
if(strlen($xml) > self::MAX_REQUEST_SIZE-8) if(strlen($xml) > self::MAX_REQUEST_SIZE-8)
{ {
if($method != 'system.multicall' || count($args) < 2) if($method != 'system.multicall' || count($args[0]) < 2)
throw new MessageException('Request too large', MessageException::REQUEST_TOO_LARGE); throw new MessageException('Request too large', MessageException::REQUEST_TOO_LARGE);
$mid = count($args) >> 1; $mid = count($args[0]) >> 1;
$this->query('system.multicall', array_slice($args, 0, $mid)); $res1 = $this->query('system.multicall', array(array_slice($args[0], 0, $mid)));
$this->query('system.multicall', array_slice($args, $mid)); $res2 = $this->query('system.multicall', array(array_slice($args[0], $mid)));
return array_merge($res1, $res2);
} }
$this->writeMessage($xml); $this->writeMessage($xml);
@ -151,7 +150,7 @@ class GbxRemote
$call = array_shift($this->multicallBuffer); $call = array_shift($this->multicallBuffer);
return $this->query($call['methodName'], $call['params']); return $this->query($call['methodName'], $call['params']);
default: default:
$result = $this->query('system.multicall', $this->multicallBuffer); $result = $this->query('system.multicall', array($this->multicallBuffer));
$this->multicallBuffer = array(); $this->multicallBuffer = array();
return $result; return $result;
} }
@ -205,12 +204,8 @@ class GbxRemote
$this->callbacksBuffer[] = $value; $this->callbacksBuffer[] = $value;
} }
if(!$waitResponse){ if(!$waitResponse)
$r=array($this->socket);
$w=null;
$e=null;
$n = @stream_select($r, $w, $e, 0); $n = @stream_select($r, $w, $e, 0);
}
}; };
} }
@ -310,5 +305,3 @@ class MessageException extends Exception
const REQUEST_TOO_LARGE = 1; const REQUEST_TOO_LARGE = 1;
const RESPONSE_TOO_LARGE = 2; const RESPONSE_TOO_LARGE = 2;
} }
?>

View File

@ -22,9 +22,12 @@ if(extension_loaded('xmlrpc'))
* @param mixed[] $args * @param mixed[] $args
* @return string * @return string
*/ */
static function encode($method, $args) static function encode($method, $args, $escape=true)
{ {
return xmlrpc_encode_request($method, $args, self::$options); $opts = self::$options;
if(!$escape)
$opts['escaping'] = array();
return xmlrpc_encode_request($method, $args, $opts);
} }
/** /**
@ -40,7 +43,7 @@ if(extension_loaded('xmlrpc'))
if($method === null) if($method === null)
{ {
if(is_array($value) && @xmlrpc_is_fault($value)) if(is_array($value) && xmlrpc_is_fault($value))
return array('fault', $value); return array('fault', $value);
return array('response', $value); return array('response', $value);
} }
@ -59,55 +62,80 @@ else
* @param mixed[] $args * @param mixed[] $args
* @return string * @return string
*/ */
static function encode($method, $args) static function encode($method, $args, $escape=true)
{ {
$xml = '<?xml version="1.0" encoding="utf-8"?><methodCall><methodName><![CDATA['.$method.']]></methodName><params>'; $xml = '<?xml version="1.0" encoding="utf-8"?><methodCall><methodName>'.self::escape($method, $escape).'</methodName>';
if(!$args)
return $xml.'<params/></methodCall>';
$xml .= '<params>';
foreach($args as $arg) foreach($args as $arg)
$xml .= '<param><value>'.self::encodeValue($arg).'</value></param>'; $xml .= '<param><value>'.self::encodeValue($arg, $escape).'</value></param>';
$xml .= '</params></methodCall>'; return $xml.'</params></methodCall>';
return $xml;
} }
/** /**
* @param mixed $v * @param mixed $v
* @return string * @return string
*/ */
private static function encodeValue($v) private static function encodeValue($v, $escape=true)
{ {
switch(gettype($v)) switch(gettype($v))
{ {
case 'boolean': case 'boolean':
return '<boolean><![CDATA['.((int) $v).']]></boolean>'; return '<boolean>'.self::escape((int) $v, $escape).'</boolean>';
case 'integer': case 'integer':
return '<int><![CDATA['.$v.']]></int>'; return '<int>'.self::escape($v, $escape).'</int>';
case 'double': case 'double':
return '<double><![CDATA['.$v.']]></double>'; return '<double>'.self::escape($v, $escape).'</double>';
case 'string': case 'string':
return '<string><![CDATA['.$v.']]></string>'; case 'NULL':
if(!$v)
return '<string/>';
return '<string>'.self::escape($v, $escape).'</string>';
case 'object': case 'object':
if($v instanceof Base64) if($v instanceof Base64)
return '<base64><![CDATA['.base64_encode($v->scalar).']]></base64>'; {
if(!$v->scalar)
return '<base64/>';
return '<base64>'.self::escape(base64_encode($v->scalar), $escape).'</base64>';
}
if($v instanceof \DateTime) if($v instanceof \DateTime)
return '<dateTime.iso8601><![CDATA['.$v->format(self::DATE_FORMAT).']]></dateTime.iso8601>'; return '<dateTime.iso8601>'.self::escape($v->format(self::DATE_FORMAT), $escape).'</dateTime.iso8601>';
$v = get_object_vars($v); $v = get_object_vars($v);
// fallthrough // fallthrough
case 'array': case 'array':
$return = ''; $return = '';
// empty array case
if(!$v)
return '<array><data/></array>';
// pure array case // pure array case
if(array_keys($v) === range(0, count($v) - 1)) if(array_keys($v) === range(0, count($v) - 1))
{ {
foreach($v as $item) foreach($v as $item)
$return .= '<value>'.self::encodeValue($item).'</value>'; $return .= '<value>'.self::encodeValue($item, $escape).'</value>';
return '<array><data>'.$return.'</data></array>'; return '<array><data>'.$return.'</data></array>';
} }
// else it's a struct // else it's a struct
foreach($v as $name => $value) foreach($v as $name => $value)
$return .= '<member><name><![CDATA['.$name.']]></name><value>'.self::encodeValue($value).'</value></member>'; $return .= '<member><name>'.self::escape($name, $escape).'</name><value>'.self::encodeValue($value, $escape).'</value></member>';
return '<struct>'.$return.'</struct>'; return '<struct>'.$return.'</struct>';
} }
return ''; return '';
} }
/**
* @param string $str
* @param bool $escape
* @return string
*/
private static function escape($str, $escape=true)
{
if($escape)
return '<![CDATA['.$str.']]>';
return $str;
}
/** /**
* @param string $message * @param string $message
* @return mixed * @return mixed
@ -142,7 +170,7 @@ else
switch($elt->getName()) switch($elt->getName())
{ {
case 'boolean': case 'boolean':
return (bool) $elt; return (bool) (int) $elt;
case 'i4': case 'i4':
case 'int': case 'int':
return (int) $elt; return (int) $elt;
@ -170,5 +198,3 @@ else
} }
class ParseException extends Exception {} class ParseException extends Exception {}
?>

View File

@ -306,7 +306,7 @@ class MapManager implements CallbackListener {
} else { } else {
// Write map via write file method // Write map via write file method
try { try {
$this->maniaControl->client->writeFileFromString($relativeMapFileName, $file); $this->maniaControl->client->writeFile($relativeMapFileName, $file);
} catch (InvalidArgumentException $e) { } catch (InvalidArgumentException $e) {
if ($e->getMessage() == 'data are too big') { if ($e->getMessage() == 'data are too big') {
$this->maniaControl->chat->sendError("Map is too big for a remote save.", $login); $this->maniaControl->chat->sendError("Map is too big for a remote save.", $login);

View File

@ -59,36 +59,29 @@ class Player {
public $currentTargetId = 0; public $currentTargetId = 0;
/** /**
* Construct a player from ManiaPlanet Player structure * @param bool $connected
*
* @param \Maniaplanet\DedicatedServer\Structures\Player $mpPlayer
*/ */
public function __construct($mpPlayer) { public function __construct($connected)
if (!$mpPlayer) { {
$this->isConnected = false; $this->isConnected = $connected;
return;
if ($connected) {
$this->joinTime = time();
}
} }
/**
* Update from ManiaPlanet PlayerInfo structure
* @param \Maniaplanet\DedicatedServer\Structures\PlayerInfo $mpPlayer
*/
public function setInfo($mpPlayer)
{
$this->pid = $mpPlayer->playerId; $this->pid = $mpPlayer->playerId;
$this->login = $mpPlayer->login; $this->login = $mpPlayer->login;
$this->nickname = Formatter::stripDirtyCodes($mpPlayer->nickName); $this->nickname = Formatter::stripDirtyCodes($mpPlayer->nickName);
$this->rawNickname = $mpPlayer->nickName; $this->rawNickname = $mpPlayer->nickName;
$this->path = $mpPlayer->path;
$this->language = $mpPlayer->language;
$this->avatar = $mpPlayer->avatar['FileName'];
$this->allies = $mpPlayer->allies;
$this->clubLink = $mpPlayer->clubLink;
$this->teamId = $mpPlayer->teamId; $this->teamId = $mpPlayer->teamId;
$this->isOfficial = $mpPlayer->isInOfficialMode; $this->isOfficial = $mpPlayer->isInOfficialMode;
$this->ladderScore = $mpPlayer->ladderStats['PlayerRankings'][0]['Score'];
$this->ladderRank = $mpPlayer->ladderStats['PlayerRankings'][0]['Ranking'];
$this->ladderStats = $mpPlayer->ladderStats;
$this->daysSinceZoneInscription = $mpPlayer->hoursSinceZoneInscription / 24;
$this->ipAddress = $mpPlayer->iPAddress;
$this->clientVersion = $mpPlayer->clientVersion;
$this->downloadRate = $mpPlayer->downloadRate;
$this->uploadRate = $mpPlayer->uploadRate;
$this->skins = $mpPlayer->skins;
//Flag Details //Flag Details
$this->forcedSpectatorState = $mpPlayer->forceSpectator; $this->forcedSpectatorState = $mpPlayer->forceSpectator;
@ -108,7 +101,37 @@ class Player {
$this->autoTarget = $mpPlayer->autoTarget; $this->autoTarget = $mpPlayer->autoTarget;
$this->currentTargetId = $mpPlayer->currentTargetId; $this->currentTargetId = $mpPlayer->currentTargetId;
$this->joinTime = time(); if (!$this->nickname) {
$this->nickname = $this->login;
}
}
/**
* Update from ManiaPlanet PlayerDetailedInfo structure
* @param \Maniaplanet\DedicatedServer\Structures\PlayerDetailedInfo $mpPlayer
*/
public function setDetailedInfo($mpPlayer)
{
$this->pid = $mpPlayer->playerId;
$this->login = $mpPlayer->login;
$this->nickname = Formatter::stripDirtyCodes($mpPlayer->nickName);
$this->rawNickname = $mpPlayer->nickName;
$this->path = $mpPlayer->path;
$this->language = $mpPlayer->language;
$this->avatar = $mpPlayer->avatar->fileName;
$this->allies = $mpPlayer->allies;
$this->clubLink = $mpPlayer->clubLink;
$this->teamId = $mpPlayer->teamId;
$this->isOfficial = $mpPlayer->isInOfficialMode;
$this->ladderScore = $mpPlayer->ladderStats->playerRankings[0]->score;
$this->ladderRank = $mpPlayer->ladderStats->playerRankings[0]->ranking;
$this->ladderStats = $mpPlayer->ladderStats;
$this->daysSinceZoneInscription = $mpPlayer->hoursSinceZoneInscription / 24;
$this->ipAddress = $mpPlayer->iPAddress;
$this->clientVersion = $mpPlayer->clientVersion;
$this->downloadRate = $mpPlayer->downloadRate;
$this->uploadRate = $mpPlayer->uploadRate;
$this->skins = $mpPlayer->skins;
if (!$this->nickname) { if (!$this->nickname) {
$this->nickname = $this->login; $this->nickname = $this->login;

View File

@ -118,26 +118,16 @@ class PlayerManager implements CallbackListener, TimerListener {
if ($playerItem->playerId <= 0) { if ($playerItem->playerId <= 0) {
continue; continue;
} }
$detailedPlayerInfo = $this->maniaControl->client->getDetailedPlayerInfo($playerItem->login); $detailedPlayerInfo = $this->maniaControl->client->getDetailedPlayerInfo($playerItem->login);
$playerItem->path = $detailedPlayerInfo->path;
$playerItem->language = $detailedPlayerInfo->language;
$playerItem->clientVersion = $detailedPlayerInfo->clientVersion;
$playerItem->iPAddress = $detailedPlayerInfo->iPAddress;
$playerItem->isSpectator = $detailedPlayerInfo->isSpectator;
$playerItem->avatar = $detailedPlayerInfo->avatar;
$playerItem->ladderStats = $detailedPlayerInfo->ladderStats;
$playerItem->downloadRate = $detailedPlayerInfo->downloadRate;
$playerItem->uploadRate = $detailedPlayerInfo->uploadRate;
$playerItem->hoursSinceZoneInscription = $detailedPlayerInfo->hoursSinceZoneInscription;
//Check if the Player is in a Team, to notify if its a TeamMode or not //Check if the Player is in a Team, to notify if its a TeamMode or not
if ($playerItem->teamId != -1) { if ($playerItem->teamId != -1) {
$this->maniaControl->server->setTeamMode(true); $this->maniaControl->server->setTeamMode(true);
} }
$player = new Player($playerItem); $player = new Player(true);
$player->setInfo($playerItem);
$player->setDetailedInfo($detailedPlayerInfo);
$player->hasJoinedGame = true; $player->hasJoinedGame = true;
$this->addPlayer($player); $this->addPlayer($player);
} }
@ -222,7 +212,8 @@ class PlayerManager implements CallbackListener, TimerListener {
$login = $callback[1][0]; $login = $callback[1][0];
try { try {
$playerInfo = $this->maniaControl->client->getDetailedPlayerInfo($login); $playerInfo = $this->maniaControl->client->getDetailedPlayerInfo($login);
$player = new Player($playerInfo); $player = new Player(true);
$player->setDetailedInfo($playerInfo);
$this->addPlayer($player); $this->addPlayer($player);
} catch (LoginUnknownException $e) { } catch (LoginUnknownException $e) {
@ -403,7 +394,7 @@ class PlayerManager implements CallbackListener, TimerListener {
return null; return null;
} }
$player = new Player(null); $player = new Player(false);
$player->index = $row->index; $player->index = $row->index;
$player->login = $row->login; $player->login = $row->login;
$player->rawNickname = $row->nickname; $player->rawNickname = $row->nickname;
@ -488,7 +479,7 @@ class PlayerManager implements CallbackListener, TimerListener {
return null; return null;
} }
$player = new Player(null); $player = new Player(false);
$player->index = $playerIndex; $player->index = $playerIndex;
$player->login = $row->login; $player->login = $row->login;
$player->rawNickname = $row->nickname; $player->rawNickname = $row->nickname;

View File

@ -275,7 +275,7 @@ class Server implements CallbackListener {
/** /**
* Get Server Player Info * Get Server Player Info
* *
* @return \Maniaplanet\DedicatedServer\Structures\Player * @return \Maniaplanet\DedicatedServer\Structures\PlayerInfo
*/ */
public function getInfo() { public function getInfo() {
return $this->maniaControl->client->getMainServerPlayerInfo(); return $this->maniaControl->client->getMainServerPlayerInfo();

View File

@ -173,24 +173,13 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
} }
/* Disable Standard Votes */ /* Disable Standard Votes */
$array["Command"] = VoteRatio::COMMAND_BAN; $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_BAN, -1.);
$array["Param"] = ""; $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_KICK, -1.);
$array["Ratio"] = (float)-1; $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_RESTART_MAP, -1.);
$ratioArray[] = $array; $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_TEAM_BALANCE, -1.);
$ratioArray[] = new VoteRatio(VoteRatio::COMMAND_NEXT_MAP, -1.);
$array["Command"] = VoteRatio::COMMAND_KICK; $this->maniaControl->client->setCallVoteRatios($ratioArray, false);
$ratioArray[] = $array;
$array["Command"] = VoteRatio::COMMAND_RESTART_MAP;
$ratioArray[] = $array;
$array["Command"] = VoteRatio::COMMAND_TEAM_BALANCE;
$ratioArray[] = $array;
$array["Command"] = VoteRatio::COMMAND_NEXT_MAP;
$ratioArray[] = $array;
$this->maniaControl->client->setCallVoteRatiosEx(false, $ratioArray);
$this->constructMenu(); $this->constructMenu();
return true; return true;
@ -386,20 +375,13 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
//Enable Standard Votes //Enable Standard Votes
$defaultRatio = $this->maniaControl->client->getCallVoteRatio(); $defaultRatio = $this->maniaControl->client->getCallVoteRatio();
$array["Command"] = VoteRatio::COMMAND_BAN; $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_BAN, $defaultRatio);
$array["Param"] = ""; $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_KICK, $defaultRatio);
$array["Ratio"] = (float)$defaultRatio; $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_RESTART_MAP, $defaultRatio);
$ratioArray[] = $array; $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_TEAM_BALANCE, $defaultRatio);
$array["Command"] = VoteRatio::COMMAND_KICK; $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_NEXT_MAP, $defaultRatio);
$ratioArray[] = $array;
$array["Command"] = VoteRatio::COMMAND_RESTART_MAP;
$ratioArray[] = $array;
$array["Command"] = VoteRatio::COMMAND_TEAM_BALANCE;
$ratioArray[] = $array;
$array["Command"] = VoteRatio::COMMAND_NEXT_MAP;
$ratioArray[] = $array;
$this->maniaControl->client->setCallVoteRatiosEx(false, $ratioArray); $this->maniaControl->client->setCallVoteRatios($ratioArray, false);
$this->destroyVote(); $this->destroyVote();
$this->maniaControl->manialinkManager->hideManialink(self::MLID_ICON); $this->maniaControl->manialinkManager->hideManialink(self::MLID_ICON);