diff --git a/core/Callbacks/LibXmlRpcCallbacks.php b/core/Callbacks/LibXmlRpcCallbacks.php index 3f58831e..aedf6bb8 100644 --- a/core/Callbacks/LibXmlRpcCallbacks.php +++ b/core/Callbacks/LibXmlRpcCallbacks.php @@ -8,7 +8,8 @@ use ManiaControl\Callbacks\Structures\ManiaPlanet\StartEndStructure; use ManiaControl\Callbacks\Structures\ManiaPlanet\StartServerStructure; use ManiaControl\Callbacks\Structures\NearMissStructure; use ManiaControl\Callbacks\Structures\PlayerHitStructure; -use ManiaControl\Callbacks\Structures\XmlRpc\CallbacksListStructure; +use ManiaControl\Callbacks\Structures\ShootMania\StatusCallbackStructure; +use ManiaControl\Callbacks\Structures\XmlRpc\ListStructure; use ManiaControl\ManiaControl; /** @@ -50,13 +51,13 @@ class LibXmlRpcCallbacks implements CallbackListener { switch ($name) { //New callbacks case Callbacks::XMLRPC_CALLBACKSLIST: - $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::XMLRPC_CALLBACKSLIST, new CallbacksListStructure($this->maniaControl, $data)); + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::XMLRPC_CALLBACKSLIST, new ListStructure($this->maniaControl, $data)); break; case Callbacks::XMLRPC_ENABLEDCALLBACKS: - //TODO + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::XMLRPC_ENABLEDCALLBACKS, new ListStructure($this->maniaControl, $data)); break; case Callbacks::XMLRPC_DISABLEDCALLBACKS: - //TODO + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::XMLRPC_DISABLEDCALLBACKS, new ListStructure($this->maniaControl, $data)); break; case Callbacks::XMLRPC_APIVERSION: //TODO @@ -68,7 +69,7 @@ class LibXmlRpcCallbacks implements CallbackListener { //TODO break; case Callbacks::XMLRPC_METHODSLIST: - //TODO + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::XMLRPC_METHODSLIST, new ListStructure($this->maniaControl, $data)); break; case Callbacks::XMLRPC_METHODHELP: //TODO @@ -170,7 +171,7 @@ class LibXmlRpcCallbacks implements CallbackListener { $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::MP_WARMUP_END); break; case Callbacks::MP_WARMUP_STATUS: - //TODO + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::MP_WARMUP_STATUS, new StatusCallbackStructure($this->maniaControl, $data)); break; //OLD Callbacks diff --git a/core/Callbacks/ShootManiaCallbacks.php b/core/Callbacks/ShootManiaCallbacks.php index 4a68891b..c7ac4923 100644 --- a/core/Callbacks/ShootManiaCallbacks.php +++ b/core/Callbacks/ShootManiaCallbacks.php @@ -10,15 +10,24 @@ use ManiaControl\Callbacks\Structures\ShootMania\OnArmorEmptyStructure; use ManiaControl\Callbacks\Structures\ShootMania\OnCaptureStructure; use ManiaControl\Callbacks\Structures\ShootMania\OnCommandStructure; use ManiaControl\Callbacks\Structures\ShootMania\OnDefaultEventStructure; +use ManiaControl\Callbacks\Structures\ShootMania\OnEliteEndTurnStructure; +use ManiaControl\Callbacks\Structures\ShootMania\OnEliteStartTurnStructure; use ManiaControl\Callbacks\Structures\ShootMania\OnHitStructure; +use ManiaControl\Callbacks\Structures\ShootMania\OnJoustReloadStructure; +use ManiaControl\Callbacks\Structures\ShootMania\OnJoustRoundResultsStructure; +use ManiaControl\Callbacks\Structures\ShootMania\OnJoustSelectedPlayersStructure; use ManiaControl\Callbacks\Structures\ShootMania\OnNearMissStructure; use ManiaControl\Callbacks\Structures\ShootMania\OnPlayerObjectStructure; use ManiaControl\Callbacks\Structures\ShootMania\OnPlayerRequestActionChange; use ManiaControl\Callbacks\Structures\ShootMania\OnPlayerRequestRespawnStructure; use ManiaControl\Callbacks\Structures\ShootMania\OnPlayerTriggersSectorStructure; +use ManiaControl\Callbacks\Structures\ShootMania\OnRoyalPlayerSpawnStructure; +use ManiaControl\Callbacks\Structures\ShootMania\OnRoyalPointsStructure; +use ManiaControl\Callbacks\Structures\ShootMania\OnRoyalRoundWinnerStructure; use ManiaControl\Callbacks\Structures\ShootMania\OnScoresStructure; use ManiaControl\Callbacks\Structures\ShootMania\OnShootStructure; use ManiaControl\Callbacks\Structures\ShootMania\OnShotDenyStructure; +use ManiaControl\Callbacks\Structures\ShootMania\StatusCallbackStructure; use ManiaControl\ManiaControl; /** @@ -120,31 +129,31 @@ class ShootManiaCallbacks implements CallbackListener { $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::SM_ONPLAYERREQUESTACTIONCHANGE, new OnPlayerRequestActionChange($this->maniaControl, $data)); break; case Callbacks::SM_COMBO_PAUSESTATUS: - //TODO + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::SM_COMBO_PAUSESTATUS, new StatusCallbackStructure($this->maniaControl, $data)); break; case Callbacks::SM_ELITE_STARTTURN: - //TODO + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::SM_ELITE_STARTTURN, new OnEliteStartTurnStructure($this->maniaControl, $data)); break; case Callbacks::SM_ELITE_ENDTURN: - //TODO + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::SM_ELITE_ENDTURN, new OnEliteEndTurnStructure($this->maniaControl, $data)); break; case Callbacks::SM_JOUST_ONRELOAD: - //TODO + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::SM_JOUST_ONRELOAD, new OnJoustReloadStructure($this->maniaControl, $data)); break; case Callbacks::SM_JOUST_SELECTEDPLAYERS: - //TODO + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::SM_JOUST_SELECTEDPLAYERS, new OnJoustSelectedPlayersStructure($this->maniaControl, $data)); break; case Callbacks::SM_JOUST_ROUNDRESULT: - //TODO + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::SM_JOUST_ROUNDRESULT, new OnJoustRoundResultsStructure($this->maniaControl, $data)); break; case Callbacks::SM_ROYAL_POINTS: - //TODO + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::SM_ROYAL_POINTS, new OnRoyalPointsStructure($this->maniaControl, $data)); break; case Callbacks::SM_ROYAL_PLAYERSPAWN: - //TODO + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::SM_ROYAL_PLAYERSPAWN, new OnRoyalPlayerSpawnStructure($this->maniaControl, $data)); break; case Callbacks::SM_ROYAL_ROUNDWINNER: - //TODO + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::SM_ROYAL_ROUNDWINNER, new OnRoyalRoundWinnerStructure($this->maniaControl, $data)); break; //Old Callbacks diff --git a/core/Callbacks/Structures/Common/BaseResponseStructure.php b/core/Callbacks/Structures/Common/BaseResponseStructure.php index d0114f52..2f5d4dd1 100644 --- a/core/Callbacks/Structures/Common/BaseResponseStructure.php +++ b/core/Callbacks/Structures/Common/BaseResponseStructure.php @@ -25,5 +25,7 @@ class BaseResponseStructure extends BaseStructure { public function __construct(ManiaControl $maniaControl, $data) { parent::__construct($maniaControl, $data); + + $this->responseId = $this->getPlainJsonObject()->responseid; } } \ No newline at end of file diff --git a/core/Callbacks/Structures/Common/CommonScoresStructure.php b/core/Callbacks/Structures/Common/CommonScoresStructure.php index 90ac4f8f..b179802d 100644 --- a/core/Callbacks/Structures/Common/CommonScoresStructure.php +++ b/core/Callbacks/Structures/Common/CommonScoresStructure.php @@ -30,7 +30,6 @@ class CommonScoresStructure extends BaseResponseStructure { $jsonObj = $this->getPlainJsonObject(); - $this->responseId = $jsonObj->responseid; $this->section = $jsonObj->section; $this->useTeams = $jsonObj->useteams; $this->winnerTeam = $jsonObj->winnerteam; diff --git a/core/Callbacks/Structures/Common/StatusCallbackStructure.php b/core/Callbacks/Structures/Common/StatusCallbackStructure.php new file mode 100644 index 00000000..ab20a21c --- /dev/null +++ b/core/Callbacks/Structures/Common/StatusCallbackStructure.php @@ -0,0 +1,40 @@ + + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +class StatusCallbackStructure extends BaseResponseStructure { + protected $active; + + /** + * Construct a new On Hit Structure + * + * @param ManiaControl $maniaControl + * @param array $data + */ + public function __construct(ManiaControl $maniaControl, $data) { + parent::__construct($maniaControl, $data); + + $this->active = $this->getPlainJsonObject()->active; + } + + /** + * True if the Status (Like Combo Pause or Warmup) is Ongoing + * + * @return boolean + */ + public function getActive() { + return $this->active; + } + +} \ No newline at end of file diff --git a/core/Callbacks/Structures/ShootMania/Models/JoustScore.php b/core/Callbacks/Structures/ShootMania/Models/JoustScore.php new file mode 100644 index 00000000..d5eb08e4 --- /dev/null +++ b/core/Callbacks/Structures/ShootMania/Models/JoustScore.php @@ -0,0 +1,69 @@ + + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +class JoustScore implements UsageInformationAble { + use UsageInformationTrait; + + /** @var \ManiaControl\Players\Player $player */ + private $player; + private $score; + + /** + * Gets the Player + * + * @api + * @return \ManiaControl\Players\Player + */ + public function getPlayer() { + return $this->player; + } + + /** + * Sets the Player + * + * @api + * @param \ManiaControl\Players\Player $player + */ + public function setPlayer($player) { + $this->player = $player; + } + + /** + * Gets the Score + * + * @api + * @return int + */ + public function getScore() { + return $this->score; + } + + /** + * Sets the Score + * + * @api + * @param mixed int + */ + public function setScore($score) { + $this->score = $score; + } +} \ No newline at end of file diff --git a/core/Callbacks/Structures/ShootMania/Models/RoyalPointTypes.php b/core/Callbacks/Structures/ShootMania/Models/RoyalPointTypes.php new file mode 100644 index 00000000..8a4156f4 --- /dev/null +++ b/core/Callbacks/Structures/ShootMania/Models/RoyalPointTypes.php @@ -0,0 +1,17 @@ + + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +interface RoyalPointTypes { + const POLE = "Pole"; + const HIT = "Hit"; + const SURVIVAL = "Survival"; +} diff --git a/core/Callbacks/Structures/ShootMania/Models/VictoryTypes.php b/core/Callbacks/Structures/ShootMania/Models/VictoryTypes.php new file mode 100644 index 00000000..a98f5d4f --- /dev/null +++ b/core/Callbacks/Structures/ShootMania/Models/VictoryTypes.php @@ -0,0 +1,18 @@ + + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +interface VictoryTypes { + const TIME_LIMIT = 1; + const CAPTURE = 2; + const ATTACKER_ELIMINATED = 3; + const DEFENDERS_ELIMINATED = 4; +} diff --git a/core/Callbacks/Structures/ShootMania/OnEliteEndTurnStructure.php b/core/Callbacks/Structures/ShootMania/OnEliteEndTurnStructure.php new file mode 100644 index 00000000..ad102341 --- /dev/null +++ b/core/Callbacks/Structures/ShootMania/OnEliteEndTurnStructure.php @@ -0,0 +1,41 @@ + + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +class OnEliteEndTurnStructure extends BaseStructure { + protected $victoryType; + + /** + * Construct a new On Hit Structure + * + * @param ManiaControl $maniaControl + * @param array $data + */ + public function __construct(ManiaControl $maniaControl, $data) { + parent::__construct($maniaControl, $data); + + $this->victoryType = $this->getPlainJsonObject()->victorytype; + } + + /** + * Gets the Victory Type + * + * @api + * @see \ManiaControl\Callbacks\Structures\ShootMania\Models\VictoryTypes + * @return int VictoryType + */ + public function getVictoryType() { + return $this->victoryType; + } +} \ No newline at end of file diff --git a/core/Callbacks/Structures/ShootMania/OnEliteStartTurnStructure.php b/core/Callbacks/Structures/ShootMania/OnEliteStartTurnStructure.php new file mode 100644 index 00000000..73ab6131 --- /dev/null +++ b/core/Callbacks/Structures/ShootMania/OnEliteStartTurnStructure.php @@ -0,0 +1,65 @@ + + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +class OnEliteStartTurnStructure extends BaseStructure { + protected $attacker; + protected $defenderArray; + + /** + * Construct a new On Hit Structure + * + * @param ManiaControl $maniaControl + * @param array $data + */ + public function __construct(ManiaControl $maniaControl, $data) { + parent::__construct($maniaControl, $data); + + $jsonObj = $this->getPlainJsonObject(); + $this->attacker = $this->maniaControl->getPlayerManager()->getPlayer($jsonObj->attacker); + $this->defenderArray = $jsonObj->defenders; + } + + /** + * @return \ManiaControl\Players\Player + */ + public function getAttacker() { + return $this->attacker; + } + + /** + * Returns a Login Array of the defenders + * + * @return array + */ + public function getDefenderLogins() { + return $this->defenderArray; + } + + /** + * Gets an Array of the Players + * + * @return \ManiaControl\Players\Player[] + */ + public function getDefenders() { + $defenders = array(); + foreach ($this->defenderArray as $login) { + $player = $this->maniaControl->getPlayerManager()->getPlayer($login); + if ($player) { + $defenders[$login] = $player; + } + } + return $defenders; + } +} \ No newline at end of file diff --git a/core/Callbacks/Structures/ShootMania/OnJoustReloadStructure.php b/core/Callbacks/Structures/ShootMania/OnJoustReloadStructure.php new file mode 100644 index 00000000..6bca627e --- /dev/null +++ b/core/Callbacks/Structures/ShootMania/OnJoustReloadStructure.php @@ -0,0 +1,40 @@ + + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +class OnJoustReloadStructure extends BaseStructure { + protected $player; + + /** + * Construct a new On Hit Structure + * + * @param ManiaControl $maniaControl + * @param array $data + */ + public function __construct(ManiaControl $maniaControl, $data) { + parent::__construct($maniaControl, $data); + + $this->player = $this->maniaControl->getPlayerManager()->getPlayer($this->getPlainJsonObject()->player); + } + + /** + * Gets the Player + * + * @api + * @return \ManiaControl\Players\Player Player + */ + public function getPlayer() { + return $this->player; + } +} \ No newline at end of file diff --git a/core/Callbacks/Structures/ShootMania/OnJoustRoundResultsStructure.php b/core/Callbacks/Structures/ShootMania/OnJoustRoundResultsStructure.php new file mode 100644 index 00000000..1aefa571 --- /dev/null +++ b/core/Callbacks/Structures/ShootMania/OnJoustRoundResultsStructure.php @@ -0,0 +1,53 @@ + + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +class OnJoustRoundResultsStructure extends BaseStructure { + + /** @var \ManiaControl\Callbacks\Structures\ShootMania\Models\JoustScore $playerScores */ + private $playerScores = array(); + + /** + * OnJoustRoundResultsStructure constructor. + * + * @param \ManiaControl\ManiaControl $maniaControl + * @param $data + */ + public function __construct(ManiaControl $maniaControl, $data) { + parent::__construct($maniaControl, $data); + + $jsonObj = $this->getPlainJsonObject(); + + foreach ($jsonObj->players as $jsonPlayer) { + $playerScore = new JoustScore(); + $playerScore->setPlayer($this->maniaControl->getPlayerManager()->getPlayer($jsonPlayer->login)); + $playerScore->setScore($jsonPlayer->score); + + $this->playerScores[$jsonPlayer->login] = $playerScore; + } + } + + /** + * Get the Player Scores + * + * @api + * @return \ManiaControl\Callbacks\Structures\ShootMania\Models\JoustScore + */ + public function getPlayerScores() { + return $this->playerScores; + } +} \ No newline at end of file diff --git a/core/Callbacks/Structures/ShootMania/OnJoustSelectedPlayersStructure.php b/core/Callbacks/Structures/ShootMania/OnJoustSelectedPlayersStructure.php new file mode 100644 index 00000000..5c83fd4b --- /dev/null +++ b/core/Callbacks/Structures/ShootMania/OnJoustSelectedPlayersStructure.php @@ -0,0 +1,56 @@ + + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +class OnJoustSelectedPlayersStructure extends BaseStructure { + protected $playerArray; + + /** + * Construct a new On Hit Structure + * + * @param ManiaControl $maniaControl + * @param array $data + */ + public function __construct(ManiaControl $maniaControl, $data) { + parent::__construct($maniaControl, $data); + + $this->playerArray = $this->getPlainJsonObject()->players; + } + + + /** + * Returns a Login Array of the Players + * + * @return array + */ + public function getPlayerLogins() { + return $this->playerArray; + } + + /** + * Gets an Array of the Players + * + * @return \ManiaControl\Players\Player[] + */ + public function getPlayers() { + $players = array(); + foreach ($this->playerArray as $login) { + $player = $this->maniaControl->getPlayerManager()->getPlayer($login); + if ($player) { + $players[$login] = $player; + } + } + return $players; + } +} \ No newline at end of file diff --git a/core/Callbacks/Structures/ShootMania/OnRoyalPlayerSpawnStructure.php b/core/Callbacks/Structures/ShootMania/OnRoyalPlayerSpawnStructure.php new file mode 100644 index 00000000..c0891bd2 --- /dev/null +++ b/core/Callbacks/Structures/ShootMania/OnRoyalPlayerSpawnStructure.php @@ -0,0 +1,51 @@ + + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +class OnRoyalPlayerSpawnStructure extends BaseStructure { + protected $player; + protected $respawn; + + /** + * Construct a new On Hit Structure + * + * @param ManiaControl $maniaControl + * @param array $data + */ + public function __construct(ManiaControl $maniaControl, $data) { + parent::__construct($maniaControl, $data); + + $this->player = $this->maniaControl->getPlayerManager()->getPlayer($this->getPlainJsonObject()->login); + $this->respawn = $this->getPlainJsonObject()->respawn; + } + + /** + * Gets the Player + * + * @api + * @return \ManiaControl\Players\Player Player + */ + public function getPlayer() { + return $this->player; + } + + /** + * @api + * @return boolean < false if it is the initial player spawn in the round. true if it is a respawn. + */ + public function getRespawn() { + return $this->respawn; + } +} \ No newline at end of file diff --git a/core/Callbacks/Structures/ShootMania/OnRoyalPointsStructure.php b/core/Callbacks/Structures/ShootMania/OnRoyalPointsStructure.php new file mode 100644 index 00000000..01b73c61 --- /dev/null +++ b/core/Callbacks/Structures/ShootMania/OnRoyalPointsStructure.php @@ -0,0 +1,66 @@ + + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +class OnRoyalPointsStructure extends BaseStructure { + protected $playerLogin; + protected $type; + protected $points; + + /** + * Construct a new On Hit Structure + * + * @param ManiaControl $maniaControl + * @param array $data + */ + public function __construct(ManiaControl $maniaControl, $data) { + parent::__construct($maniaControl, $data); + + $this->playerLogin = $this->getPlainJsonObject()->login; + $this->type = $this->getPlainJsonObject()->type; + $this->points = $this->getPlainJsonObject()->points; + } + + /** + * Gets the Player + * + * @api + * @return \ManiaControl\Players\Player Player + */ + public function getPlayer() { + return $this->maniaControl->getPlayerManager()->getPlayer($this->playerLogin); + } + + /** + * Gets the Type of Points + * + * @api + * @see \ManiaControl\Callbacks\Structures\ShootMania\Models\RoyalPointTypes + * @return mixed + */ + public function getType() { + return $this->type; + } + + /** + * Gets the number of points scored + * + * @return int + */ + public function getPoints() { + return intval($this->points); + } + + +} \ No newline at end of file diff --git a/core/Callbacks/Structures/ShootMania/OnRoyalRoundWinnerStructure.php b/core/Callbacks/Structures/ShootMania/OnRoyalRoundWinnerStructure.php new file mode 100644 index 00000000..40cfbe9b --- /dev/null +++ b/core/Callbacks/Structures/ShootMania/OnRoyalRoundWinnerStructure.php @@ -0,0 +1,41 @@ + + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +class OnRoyalRoundWinnerStructure extends BaseStructure { + protected $player; + + /** + * Construct a new On Hit Structure + * + * @param ManiaControl $maniaControl + * @param array $data + */ + public function __construct(ManiaControl $maniaControl, $data) { + parent::__construct($maniaControl, $data); + + $this->player = $this->maniaControl->getPlayerManager()->getPlayer($this->getPlainJsonObject()->login); + } + + /** + * Gets the Player + * + * @api + * @return \ManiaControl\Players\Player Player + */ + public function getPlayer() { + return $this->player; + } +} \ No newline at end of file diff --git a/core/Callbacks/Structures/ShootMania/OnShootStructure.php b/core/Callbacks/Structures/ShootMania/OnShootStructure.php index a326155d..45df3dc5 100644 --- a/core/Callbacks/Structures/ShootMania/OnShootStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnShootStructure.php @@ -20,19 +20,20 @@ class OnShootStructure extends BaseStructure { /** * @var Player $shooter */ - private $shooter; + private $shooterLogin; public function __construct(ManiaControl $maniaControl, $data) { parent::__construct($maniaControl, $data); - $this->time = $this->getPlainJsonObject()->time; - $this->weapon = $this->getPlainJsonObject()->weapon; - - $this->shooter = $this->maniaControl->getPlayerManager()->getPlayer($this->getPlainJsonObject()->shooter); - + $this->time = $this->getPlainJsonObject()->time; + $this->weapon = $this->getPlainJsonObject()->weapon; + $this->shooterLogin = $this->getPlainJsonObject()->shooter; } /** + * Gets the Time the event Happened + * + * @api * @return int */ public function getTime() { @@ -40,6 +41,10 @@ class OnShootStructure extends BaseStructure { } /** + * Gets the Weapon + * + * @api + * @see \ManiaControl\Callbacks\Structures\ShootMania\Models\Weapons * @return int */ public function getWeapon() { @@ -47,15 +52,12 @@ class OnShootStructure extends BaseStructure { } /** + * Gets the Shooter + * + * @api * @return Player */ public function getShooter() { - return $this->shooter; - } - - /** Dumps the Object with some Information */ - public function dump() { - parent::dump(); - var_dump("With getShooter() you get a Player Object"); + return $this->maniaControl->getPlayerManager()->getPlayer($this->shooterLogin); } } \ No newline at end of file diff --git a/core/Callbacks/Structures/VictoryTypes.php b/core/Callbacks/Structures/VictoryTypes.php index c57ed5a5..cd3e4555 100644 --- a/core/Callbacks/Structures/VictoryTypes.php +++ b/core/Callbacks/Structures/VictoryTypes.php @@ -8,7 +8,7 @@ namespace ManiaControl\Callbacks\Structures; * @author ManiaControl Team * @copyright 2014-2017 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 - * @deprecated + * @deprecated see ManiaControl\Callbacks\Structures\ShootMania\Models\VictoryTypes */ interface VictoryTypes { const TIME_LIMIT = 1; diff --git a/core/Callbacks/Structures/XmlRpc/CallbacksListStructure.php b/core/Callbacks/Structures/XmlRpc/ListStructure.php similarity index 88% rename from core/Callbacks/Structures/XmlRpc/CallbacksListStructure.php rename to core/Callbacks/Structures/XmlRpc/ListStructure.php index d600616f..25cca84e 100644 --- a/core/Callbacks/Structures/XmlRpc/CallbacksListStructure.php +++ b/core/Callbacks/Structures/XmlRpc/ListStructure.php @@ -13,7 +13,7 @@ use ManiaControl\ManiaControl; * @copyright 2014-2017 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 */ -class CallbacksListStructure extends BaseResponseStructure { +class ListStructure extends BaseResponseStructure { /** @var array $callbacks */ private $callbacks; @@ -26,7 +26,6 @@ class CallbacksListStructure extends BaseResponseStructure { public function __construct(ManiaControl $maniaControl, $data) { parent::__construct($maniaControl, $data); - $this->responseId = $this->getPlainJsonObject()->responseid; $this->callbacks = $this->getPlainJsonObject()->callbacks; }