From c50e4f5a84c4b6bc5104bb66cd08e3b3019e32fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Sat, 19 Jul 2014 23:40:16 +0200 Subject: [PATCH] Revert "renamed player actions class" This reverts commit f0862f7f1633b9852ac4ede3f012c25c8cc64920. --- application/core/Admin/AdminLists.php | 2 +- .../{Actions.php => PlayerActions.php} | 4 +- application/core/Players/PlayerCommands.php | 32 ++++++++-------- application/core/Players/PlayerList.php | 38 +++++++++---------- application/core/Players/PlayerManager.php | 4 +- .../plugins/MCTeam/CustomVotesPlugin.php | 2 +- application/plugins/TheM/QueuePlugin.php | 6 +-- 7 files changed, 44 insertions(+), 44 deletions(-) rename application/core/Players/{Actions.php => PlayerActions.php} (99%) diff --git a/application/core/Admin/AdminLists.php b/application/core/Admin/AdminLists.php index 413966d7..d398fc0b 100644 --- a/application/core/Admin/AdminLists.php +++ b/application/core/Admin/AdminLists.php @@ -207,7 +207,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener { switch ($action) { case self::ACTION_REVOKE_RIGHTS: - $this->maniaControl->playerManager->actions->revokeAuthLevel($adminLogin, $targetLogin); + $this->maniaControl->playerManager->playerActions->revokeAuthLevel($adminLogin, $targetLogin); break; } } diff --git a/application/core/Players/Actions.php b/application/core/Players/PlayerActions.php similarity index 99% rename from application/core/Players/Actions.php rename to application/core/Players/PlayerActions.php index 40ac5099..3487fb59 100644 --- a/application/core/Players/Actions.php +++ b/application/core/Players/PlayerActions.php @@ -25,7 +25,7 @@ use Maniaplanet\DedicatedServer\Xmlrpc\UnknownPlayerException; * @copyright 2014 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 */ -class Actions { +class PlayerActions { /* * Constants */ @@ -53,7 +53,7 @@ class Actions { private $maniaControl = null; /** - * Create a new Player Actions Instance + * Create a PlayerActions Instance * * @param ManiaControl $maniaControl */ diff --git a/application/core/Players/PlayerCommands.php b/application/core/Players/PlayerCommands.php index 5322e0fe..32981272 100644 --- a/application/core/Players/PlayerCommands.php +++ b/application/core/Players/PlayerCommands.php @@ -119,7 +119,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca * @param Player $player */ public function command_Kick(array $chat, Player $player) { - if (!$this->maniaControl->authenticationManager->checkPermission($player, Actions::SETTING_PERMISSION_KICK_PLAYER)) { + if (!$this->maniaControl->authenticationManager->checkPermission($player, PlayerActions::SETTING_PERMISSION_KICK_PLAYER)) { $this->maniaControl->authenticationManager->sendNotAllowed($player); return; } @@ -133,7 +133,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca if (isset($params[2])) { $message = $params[2]; } - $this->maniaControl->playerManager->actions->kickPlayer($player->login, $targetLogin, $message); + $this->maniaControl->playerManager->playerActions->kickPlayer($player->login, $targetLogin, $message); } /** @@ -143,7 +143,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca * @param Player $player */ public function command_Ban(array $chat, Player $player) { - if (!$this->maniaControl->authenticationManager->checkPermission($player, Actions::SETTING_PERMISSION_BAN_PLAYER)) { + if (!$this->maniaControl->authenticationManager->checkPermission($player, PlayerActions::SETTING_PERMISSION_BAN_PLAYER)) { $this->maniaControl->authenticationManager->sendNotAllowed($player); return; } @@ -157,7 +157,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca if (isset($params[2])) { $message = $params[2]; } - $this->maniaControl->playerManager->actions->banPlayer($player->login, $targetLogin, $message); + $this->maniaControl->playerManager->playerActions->banPlayer($player->login, $targetLogin, $message); } /** @@ -173,7 +173,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca return; } $targetLogin = $params[1]; - $this->maniaControl->playerManager->actions->warnPlayer($player->login, $targetLogin); + $this->maniaControl->playerManager->playerActions->warnPlayer($player->login, $targetLogin); } /** @@ -183,7 +183,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca * @param Player $player */ public function command_ForceSpectator(array $chat, Player $player) { - if (!$this->maniaControl->authenticationManager->checkPermission($player, Actions::SETTING_PERMISSION_FORCE_PLAYER_SPEC)) { + if (!$this->maniaControl->authenticationManager->checkPermission($player, PlayerActions::SETTING_PERMISSION_FORCE_PLAYER_SPEC)) { $this->maniaControl->authenticationManager->sendNotAllowed($player); return; } @@ -196,9 +196,9 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca if (isset($params[2]) && is_numeric($params[2])) { $type = (int)$params[2]; - $this->maniaControl->playerManager->actions->forcePlayerToSpectator($player->login, $targetLogin, $type); + $this->maniaControl->playerManager->playerActions->forcePlayerToSpectator($player->login, $targetLogin, $type); } else { - $this->maniaControl->playerManager->actions->forcePlayerToSpectator($player->login, $targetLogin); + $this->maniaControl->playerManager->playerActions->forcePlayerToSpectator($player->login, $targetLogin); } } @@ -209,7 +209,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca * @param Player $player */ public function command_ForcePlay(array $chat, Player $player) { - if (!$this->maniaControl->authenticationManager->checkPermission($player, Actions::SETTING_PERMISSION_FORCE_PLAYER_PLAY)) { + if (!$this->maniaControl->authenticationManager->checkPermission($player, PlayerActions::SETTING_PERMISSION_FORCE_PLAYER_PLAY)) { $this->maniaControl->authenticationManager->sendNotAllowed($player); return; } @@ -226,7 +226,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca } $selectable = ($type === 2); - $this->maniaControl->playerManager->actions->forcePlayerToPlay($player->login, $targetLogin, $selectable); + $this->maniaControl->playerManager->playerActions->forcePlayerToPlay($player->login, $targetLogin, $selectable); } /** @@ -236,7 +236,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca * @param Player $player */ public function command_ForceBlue(array $chat, Player $player) { - if (!$this->maniaControl->authenticationManager->checkPermission($player, Actions::SETTING_PERMISSION_FORCE_PLAYER_TEAM)) { + if (!$this->maniaControl->authenticationManager->checkPermission($player, PlayerActions::SETTING_PERMISSION_FORCE_PLAYER_TEAM)) { $this->maniaControl->authenticationManager->sendNotAllowed($player); return; } @@ -247,7 +247,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca } $targetLogin = $params[1]; - $this->maniaControl->playerManager->actions->forcePlayerToTeam($player->login, $targetLogin, Actions::TEAM_BLUE); + $this->maniaControl->playerManager->playerActions->forcePlayerToTeam($player->login, $targetLogin, PlayerActions::TEAM_BLUE); } /** @@ -257,7 +257,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca * @param Player $player */ public function command_ForceRed(array $chat, Player $player) { - if (!$this->maniaControl->authenticationManager->checkPermission($player, Actions::SETTING_PERMISSION_FORCE_PLAYER_TEAM)) { + if (!$this->maniaControl->authenticationManager->checkPermission($player, PlayerActions::SETTING_PERMISSION_FORCE_PLAYER_TEAM)) { $this->maniaControl->authenticationManager->sendNotAllowed($player); return; } @@ -268,7 +268,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca } $targetLogin = $params[1]; - $this->maniaControl->playerManager->actions->forcePlayerToTeam($player->login, $targetLogin, Actions::TEAM_RED); + $this->maniaControl->playerManager->playerActions->forcePlayerToTeam($player->login, $targetLogin, PlayerActions::TEAM_RED); } /** @@ -326,7 +326,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca return; } $targetLogin = $commandParts[1]; - $this->maniaControl->playerManager->actions->mutePlayer($admin->login, $targetLogin); + $this->maniaControl->playerManager->playerActions->mutePlayer($admin->login, $targetLogin); } /** @@ -342,7 +342,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca return; } $targetLogin = $commandParts[1]; - $this->maniaControl->playerManager->actions->unMutePlayer($admin->login, $targetLogin); + $this->maniaControl->playerManager->playerActions->unMutePlayer($admin->login, $targetLogin); } /** diff --git a/application/core/Players/PlayerList.php b/application/core/Players/PlayerList.php index 7fa63389..d3d8135c 100644 --- a/application/core/Players/PlayerList.php +++ b/application/core/Players/PlayerList.php @@ -317,7 +317,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer } if ($this->maniaControl->server->isTeamMode()) { - if ($this->maniaControl->authenticationManager->checkPermission($player, Actions::SETTING_PERMISSION_FORCE_PLAYER_TEAM)) { + if ($this->maniaControl->authenticationManager->checkPermission($player, PlayerActions::SETTING_PERMISSION_FORCE_PLAYER_TEAM)) { // Force to Red-Team Quad $redQuad = new Quad_Emblems(); $playerFrame->add($redQuad); @@ -358,7 +358,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer $kickQuad->addTooltipLabelFeature($descriptionLabel, $description); } } else { - if ($this->maniaControl->authenticationManager->checkPermission($player, Actions::SETTING_PERMISSION_FORCE_PLAYER_PLAY)) { + if ($this->maniaControl->authenticationManager->checkPermission($player, PlayerActions::SETTING_PERMISSION_FORCE_PLAYER_PLAY)) { // Force to Play $playQuad = new Quad_Emblems(); $playerFrame->add($playQuad); @@ -373,7 +373,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer } } - if ($this->maniaControl->authenticationManager->checkPermission($player, Actions::SETTING_PERMISSION_FORCE_PLAYER_SPEC)) { + if ($this->maniaControl->authenticationManager->checkPermission($player, PlayerActions::SETTING_PERMISSION_FORCE_PLAYER_SPEC)) { // Force to Spectator Quad $spectatorQuad = new Quad_BgRaceScore2(); $playerFrame->add($spectatorQuad); @@ -505,7 +505,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer $label->setTextSize($textSize); $label->setTextColor($textColor); - if (!$this->maniaControl->playerManager->actions->isPlayerMuted($login)) { + if (!$this->maniaControl->playerManager->playerActions->isPlayerMuted($login)) { $label->setText('Mute'); $quad->setAction(self::ACTION_MUTE_PLAYER . '.' . $login); } else { @@ -629,7 +629,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer switch ($action) { case self::ACTION_SPECTATE_PLAYER: try { - $this->maniaControl->client->forceSpectator($adminLogin, Actions::SPECTATOR_BUT_KEEP_SELECTABLE); + $this->maniaControl->client->forceSpectator($adminLogin, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE); $this->maniaControl->client->forceSpectatorTarget($adminLogin, $targetLogin, 1); } catch (PlayerStateException $e) { } @@ -640,49 +640,49 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer unset($this->playersListShown[$player->login]); break; case self::ACTION_FORCE_BLUE: - $this->maniaControl->playerManager->actions->forcePlayerToTeam($adminLogin, $targetLogin, Actions::TEAM_BLUE); + $this->maniaControl->playerManager->playerActions->forcePlayerToTeam($adminLogin, $targetLogin, PlayerActions::TEAM_BLUE); break; case self::ACTION_FORCE_RED: - $this->maniaControl->playerManager->actions->forcePlayerToTeam($adminLogin, $targetLogin, Actions::TEAM_RED); + $this->maniaControl->playerManager->playerActions->forcePlayerToTeam($adminLogin, $targetLogin, PlayerActions::TEAM_RED); break; case self::ACTION_FORCE_SPEC: - $this->maniaControl->playerManager->actions->forcePlayerToSpectator($adminLogin, $targetLogin, Actions::SPECTATOR_BUT_KEEP_SELECTABLE); + $this->maniaControl->playerManager->playerActions->forcePlayerToSpectator($adminLogin, $targetLogin, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE); break; case self::ACTION_FORCE_PLAY: - $this->maniaControl->playerManager->actions->forcePlayerToPlay($adminLogin, $targetLogin); + $this->maniaControl->playerManager->playerActions->forcePlayerToPlay($adminLogin, $targetLogin); break; case self::ACTION_MUTE_PLAYER: - $this->maniaControl->playerManager->actions->mutePlayer($adminLogin, $targetLogin); + $this->maniaControl->playerManager->playerActions->mutePlayer($adminLogin, $targetLogin); $this->showPlayerList($this->maniaControl->playerManager->getPlayer($adminLogin)); break; case self::ACTION_UNMUTE_PLAYER: - $this->maniaControl->playerManager->actions->unMutePlayer($adminLogin, $targetLogin); + $this->maniaControl->playerManager->playerActions->unMutePlayer($adminLogin, $targetLogin); $this->showPlayerList($this->maniaControl->playerManager->getPlayer($adminLogin)); break; case self::ACTION_WARN_PLAYER: - $this->maniaControl->playerManager->actions->warnPlayer($adminLogin, $targetLogin); + $this->maniaControl->playerManager->playerActions->warnPlayer($adminLogin, $targetLogin); break; case self::ACTION_KICK_PLAYER: - $this->maniaControl->playerManager->actions->kickPlayer($adminLogin, $targetLogin); + $this->maniaControl->playerManager->playerActions->kickPlayer($adminLogin, $targetLogin); break; case self::ACTION_BAN_PLAYER: - $this->maniaControl->playerManager->actions->banPlayer($adminLogin, $targetLogin); + $this->maniaControl->playerManager->playerActions->banPlayer($adminLogin, $targetLogin); break; case self::ACTION_PLAYER_ADV: $admin = $this->maniaControl->playerManager->getPlayer($adminLogin); $this->advancedPlayerWidget($admin, $targetLogin); break; case self::ACTION_ADD_AS_MASTER: - $this->maniaControl->playerManager->actions->grandAuthLevel($adminLogin, $targetLogin, AuthenticationManager::AUTH_LEVEL_SUPERADMIN); + $this->maniaControl->playerManager->playerActions->grandAuthLevel($adminLogin, $targetLogin, AuthenticationManager::AUTH_LEVEL_SUPERADMIN); break; case self::ACTION_ADD_AS_ADMIN: - $this->maniaControl->playerManager->actions->grandAuthLevel($adminLogin, $targetLogin, AuthenticationManager::AUTH_LEVEL_ADMIN); + $this->maniaControl->playerManager->playerActions->grandAuthLevel($adminLogin, $targetLogin, AuthenticationManager::AUTH_LEVEL_ADMIN); break; case self::ACTION_ADD_AS_MOD: - $this->maniaControl->playerManager->actions->grandAuthLevel($adminLogin, $targetLogin, AuthenticationManager::AUTH_LEVEL_MODERATOR); + $this->maniaControl->playerManager->playerActions->grandAuthLevel($adminLogin, $targetLogin, AuthenticationManager::AUTH_LEVEL_MODERATOR); break; case self::ACTION_REVOKE_RIGHTS: - $this->maniaControl->playerManager->actions->revokeAuthLevel($adminLogin, $targetLogin); + $this->maniaControl->playerManager->playerActions->revokeAuthLevel($adminLogin, $targetLogin); break; case self::ACTION_FORCE_SPEC_VOTE: /** @var $votesPlugin CustomVotesPlugin */ @@ -700,7 +700,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer $votesPlugin->undefineVote('forcespec'); try { - $this->maniaControl->client->forceSpectator($target->login, Actions::SPECTATOR_BUT_KEEP_SELECTABLE); + $this->maniaControl->client->forceSpectator($target->login, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE); $this->maniaControl->client->spectatorReleasePlayerSlot($target->login); } catch (PlayerStateException $e) { } catch (UnknownPlayerException $e){ diff --git a/application/core/Players/PlayerManager.php b/application/core/Players/PlayerManager.php index c5d04d1d..2b166315 100644 --- a/application/core/Players/PlayerManager.php +++ b/application/core/Players/PlayerManager.php @@ -35,7 +35,7 @@ class PlayerManager implements CallbackListener, TimerListener { /* * Public Properties */ - public $actions = null; + public $playerActions = null; public $playerCommands = null; public $playerDetailed = null; public $playerList = null; @@ -58,7 +58,7 @@ class PlayerManager implements CallbackListener, TimerListener { $this->initTables(); $this->playerCommands = new PlayerCommands($maniaControl); - $this->actions = new Actions($maniaControl); + $this->playerActions = new PlayerActions($maniaControl); $this->playerDetailed = new PlayerDetailed($maniaControl); $this->playerDataManager = new PlayerDataManager($maniaControl); $this->playerList = new PlayerList($maniaControl); diff --git a/application/plugins/MCTeam/CustomVotesPlugin.php b/application/plugins/MCTeam/CustomVotesPlugin.php index ad163fcb..a741c4e5 100644 --- a/application/plugins/MCTeam/CustomVotesPlugin.php +++ b/application/plugins/MCTeam/CustomVotesPlugin.php @@ -446,7 +446,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP */ public function startVote(Player $player, $voteIndex, $function = null) { //Player is muted - if ($this->maniaControl->playerManager->actions->isPlayerMuted($player)) { + if ($this->maniaControl->playerManager->playerActions->isPlayerMuted($player)) { $this->maniaControl->chat->sendError('Muted Players are not allowed to start a vote.', $player->login); return; } diff --git a/application/plugins/TheM/QueuePlugin.php b/application/plugins/TheM/QueuePlugin.php index 05d154e8..b4b52ac9 100644 --- a/application/plugins/TheM/QueuePlugin.php +++ b/application/plugins/TheM/QueuePlugin.php @@ -15,7 +15,7 @@ use ManiaControl\Callbacks\TimerListener; use ManiaControl\ManiaControl; use ManiaControl\Manialinks\ManialinkPageAnswerListener; use ManiaControl\Players\Player; -use ManiaControl\Players\Actions; +use ManiaControl\Players\PlayerActions; use ManiaControl\Players\PlayerManager; use ManiaControl\Plugins\Plugin; use Maniaplanet\DedicatedServer\Xmlrpc\Exception; @@ -337,7 +337,7 @@ class QueuePlugin implements CallbackListener, ManialinkPageAnswerListener, Time if ($this->maxPlayers > $this->maniaControl->playerManager->getPlayerCount(true)) { try { - $this->maniaControl->client->forceSpectator($player->login, Actions::SPECTATOR_PLAYER); + $this->maniaControl->client->forceSpectator($player->login, PlayerActions::SPECTATOR_PLAYER); } catch (Exception $e) { // TODO: only possible valid exception should be "wrong login" - throw others (like connection error) $this->maniaControl->chat->sendError("Error while leaving the Queue", $player->login); @@ -345,7 +345,7 @@ class QueuePlugin implements CallbackListener, ManialinkPageAnswerListener, Time } try { - $this->maniaControl->client->forceSpectator($player->login, Actions::SPECTATOR_USER_SELECTABLE); + $this->maniaControl->client->forceSpectator($player->login, PlayerActions::SPECTATOR_USER_SELECTABLE); } catch (Exception $e) { // TODO: only possible valid exception should be "wrong login" - throw others (like connection error) }