From 554abe77da0d6cd0657dd8c96a3d0e9874b8d39b Mon Sep 17 00:00:00 2001 From: kremsy Date: Thu, 8 May 2014 19:33:27 +0200 Subject: [PATCH] dedicated server api update --- .../DedicatedServer/Structures/FileDesc.php | 16 ++++ .../DedicatedServer/Structures/ForcedSkin.php | 20 +++++ .../Structures/LadderLimits.php | 16 ++++ .../Structures/LadderStats.php | 36 ++++++++ .../Structures/PlayerAnswer.php | 16 ++++ .../DedicatedServer/Structures/PlayerBan.php | 16 ++++ .../Structures/PlayerDetailedInfo.php | 72 +++++++++++++++ .../DedicatedServer/Structures/PlayerInfo.php | 87 +++++++++++++++++++ .../Structures/PlayerNetInfo.php | 22 +++++ .../Structures/PlayerRanking.php | 28 ++++++ .../DedicatedServer/Structures/Tag.php | 16 ++++ .../Structures/ZoneRanking.php | 28 ++++++ 12 files changed, 373 insertions(+) create mode 100644 application/core/Libs/Maniaplanet/DedicatedServer/Structures/FileDesc.php create mode 100644 application/core/Libs/Maniaplanet/DedicatedServer/Structures/ForcedSkin.php create mode 100644 application/core/Libs/Maniaplanet/DedicatedServer/Structures/LadderLimits.php create mode 100644 application/core/Libs/Maniaplanet/DedicatedServer/Structures/LadderStats.php create mode 100644 application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerAnswer.php create mode 100644 application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerBan.php create mode 100644 application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerDetailedInfo.php create mode 100644 application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerInfo.php create mode 100644 application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerNetInfo.php create mode 100644 application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerRanking.php create mode 100644 application/core/Libs/Maniaplanet/DedicatedServer/Structures/Tag.php create mode 100644 application/core/Libs/Maniaplanet/DedicatedServer/Structures/ZoneRanking.php diff --git a/application/core/Libs/Maniaplanet/DedicatedServer/Structures/FileDesc.php b/application/core/Libs/Maniaplanet/DedicatedServer/Structures/FileDesc.php new file mode 100644 index 00000000..53e2f72b --- /dev/null +++ b/application/core/Libs/Maniaplanet/DedicatedServer/Structures/FileDesc.php @@ -0,0 +1,16 @@ +playerRankings = ZoneRanking::fromArrayOfArray($object->playerRankings); + return $object; + } +} diff --git a/application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerAnswer.php b/application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerAnswer.php new file mode 100644 index 00000000..c870fa75 --- /dev/null +++ b/application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerAnswer.php @@ -0,0 +1,16 @@ +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; + } +} diff --git a/application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerInfo.php b/application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerInfo.php new file mode 100644 index 00000000..983920e9 --- /dev/null +++ b/application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerInfo.php @@ -0,0 +1,87 @@ +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; + } +} diff --git a/application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerNetInfo.php b/application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerNetInfo.php new file mode 100644 index 00000000..fca35d80 --- /dev/null +++ b/application/core/Libs/Maniaplanet/DedicatedServer/Structures/PlayerNetInfo.php @@ -0,0 +1,22 @@ +path); + } +}