diff --git a/ManiaControl.php b/ManiaControl.php index 2fbfe8ae..0b4e7035 100644 --- a/ManiaControl.php +++ b/ManiaControl.php @@ -11,7 +11,7 @@ error_reporting(E_ALL); // Run configuration -define('DEV_MODE', false); // Development mode to not send error reports etc. +define('DEV_MODE', true); // Development mode to not send error reports etc. define('LOG_NAME_USE_DATE', true); // Use current date as suffix for log file name in logs folder define('LOG_NAME_USE_PID', true); // Use current process id as suffix for log file name in logs folder diff --git a/core/Callbacks/Structures/ArmorEmptyStructure.php b/core/Callbacks/Structures/ArmorEmptyStructure.php index 6f765f71..bf53c1ea 100644 --- a/core/Callbacks/Structures/ArmorEmptyStructure.php +++ b/core/Callbacks/Structures/ArmorEmptyStructure.php @@ -10,6 +10,8 @@ use ManiaControl\Players\Player; * @author ManiaControl Team * @copyright 2014-2017 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + * + * @deprecated see OnArmorEmptyStructure */ class ArmorEmptyStructure { /* diff --git a/core/Callbacks/Structures/CaptureStructure.php b/core/Callbacks/Structures/CaptureStructure.php index ddfd5c91..f1f524cb 100644 --- a/core/Callbacks/Structures/CaptureStructure.php +++ b/core/Callbacks/Structures/CaptureStructure.php @@ -11,6 +11,8 @@ use ManiaControl\Players\Player; * @author ManiaControl Team * @copyright 2014-2017 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + * + * @deprecated see Capture Structure */ class CaptureStructure { /* diff --git a/core/Callbacks/Structures/Common/BaseStructure.php b/core/Callbacks/Structures/Common/BaseStructure.php index 109c2c6f..bba70097 100644 --- a/core/Callbacks/Structures/Common/BaseStructure.php +++ b/core/Callbacks/Structures/Common/BaseStructure.php @@ -3,6 +3,8 @@ namespace ManiaControl\Callbacks\Structures\Common; +use ManiaControl\General\JsonSerializable; +use ManiaControl\General\JsonSerializeTrait; use ManiaControl\General\UsageInformationAble; use ManiaControl\General\UsageInformationTrait; use ManiaControl\ManiaControl; @@ -14,8 +16,8 @@ use ManiaControl\ManiaControl; * @copyright 2014-2017 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 */ -abstract class BaseStructure implements UsageInformationAble { - use UsageInformationTrait; +abstract class BaseStructure implements UsageInformationAble, JsonSerializable { + use UsageInformationTrait, JsonSerializeTrait; /** @var ManiaControl $maniaControl */ protected $maniaControl; diff --git a/core/Callbacks/Structures/Common/CommonScoresStructure.php b/core/Callbacks/Structures/Common/CommonScoresStructure.php index 33e3a138..ebbf73fd 100644 --- a/core/Callbacks/Structures/Common/CommonScoresStructure.php +++ b/core/Callbacks/Structures/Common/CommonScoresStructure.php @@ -5,6 +5,8 @@ namespace ManiaControl\Callbacks\Structures\Common; use ManiaControl\Callbacks\Structures\Common\Models\CommonPlayerScore; use ManiaControl\Callbacks\Structures\ShootMania\Models\TeamScore; +use ManiaControl\General\JsonSerializable; +use ManiaControl\General\JsonSerializeTrait; use ManiaControl\ManiaControl; /** @@ -43,7 +45,7 @@ class CommonScoresStructure extends BaseStructure { $teamScore = new \ManiaControl\Callbacks\Structures\ShootMania\Models\TeamScore(); } - $teamScore->setId($team->id); + $teamScore->setTeamId($team->id); $teamScore->setName($team->name); $teamScore->setRoundPoints($team->roundpoints); $teamScore->setMatchPoints($team->matchpoints); diff --git a/core/Callbacks/Structures/Common/Models/CommonPlayerScore.php b/core/Callbacks/Structures/Common/Models/CommonPlayerScore.php index 2b575184..7ed720ee 100644 --- a/core/Callbacks/Structures/Common/Models/CommonPlayerScore.php +++ b/core/Callbacks/Structures/Common/Models/CommonPlayerScore.php @@ -3,12 +3,21 @@ namespace ManiaControl\Callbacks\Structures\Common\Models; +use ManiaControl\General\JsonSerializable; +use ManiaControl\General\JsonSerializeTrait; use ManiaControl\General\UsageInformationAble; use ManiaControl\General\UsageInformationTrait; use ManiaControl\Players\Player; -class CommonPlayerScore implements UsageInformationAble { - use UsageInformationTrait; +/** + * Common PlayerStructure Model + * + * @author ManiaControl Team + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +class CommonPlayerScore implements UsageInformationAble, JsonSerializable { + use UsageInformationTrait, JsonSerializeTrait; protected $player; protected $rank; diff --git a/core/Callbacks/Structures/Common/Models/CommonTeamScore.php b/core/Callbacks/Structures/Common/Models/CommonTeamScore.php index 362e5d04..037dbbfa 100644 --- a/core/Callbacks/Structures/Common/Models/CommonTeamScore.php +++ b/core/Callbacks/Structures/Common/Models/CommonTeamScore.php @@ -2,6 +2,8 @@ namespace ManiaControl\Callbacks\Structures\Common\Models; +use ManiaControl\General\JsonSerializable; +use ManiaControl\General\JsonSerializeTrait; use ManiaControl\General\UsageInformationAble; use ManiaControl\General\UsageInformationTrait; @@ -12,10 +14,10 @@ use ManiaControl\General\UsageInformationTrait; * @copyright 2014-2017 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 */ -class CommonTeamScore implements UsageInformationAble { - use UsageInformationTrait; +class CommonTeamScore implements UsageInformationAble, JsonSerializable { + use UsageInformationTrait, JsonSerializeTrait; - private $id; + private $teamId; private $name; private $roundPoints; private $mapPoints; @@ -24,15 +26,15 @@ class CommonTeamScore implements UsageInformationAble { /** * @return mixed */ - public function getId() { - return $this->id; + public function getTeamId() { + return $this->teamId; } /** * @param mixed $id */ - public function setId($id) { - $this->id = $id; + public function setTeamId($id) { + $this->teamId = $id; } /** diff --git a/core/Callbacks/Structures/NearMissStructure.php b/core/Callbacks/Structures/NearMissStructure.php index dea9201d..a0cd687f 100644 --- a/core/Callbacks/Structures/NearMissStructure.php +++ b/core/Callbacks/Structures/NearMissStructure.php @@ -11,6 +11,8 @@ use ManiaControl\Players\Player; * @author ManiaControl Team * @copyright 2014-2017 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + * + * @deprecated see OnNearMissStructure */ class NearMissStructure { /* diff --git a/core/Callbacks/Structures/PlayerHitStructure.php b/core/Callbacks/Structures/PlayerHitStructure.php index 4d89c6bc..bef91a03 100644 --- a/core/Callbacks/Structures/PlayerHitStructure.php +++ b/core/Callbacks/Structures/PlayerHitStructure.php @@ -11,6 +11,8 @@ use ManiaControl\Players\Player; * @author ManiaControl Team * @copyright 2014-2017 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + * + * @deprecated see OnPlayerHitStructure */ class PlayerHitStructure { /* diff --git a/core/General/JsonSerializable.php b/core/General/JsonSerializable.php new file mode 100644 index 00000000..ba01a482 --- /dev/null +++ b/core/General/JsonSerializable.php @@ -0,0 +1,12 @@ +maniaControl = $maniaControl; // Commands