From 84b884154c66a294d78a85b7e9b6c260888c7287 Mon Sep 17 00:00:00 2001 From: kremsy Date: Mon, 8 May 2017 23:01:15 +0200 Subject: [PATCH] renamed chat commands --- core/Server/Commands.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/Server/Commands.php b/core/Server/Commands.php index 68679ef4..25ca028a 100644 --- a/core/Server/Commands.php +++ b/core/Server/Commands.php @@ -40,7 +40,7 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer const SETTING_PERMISSION_SHOW_SYSTEMINFO = 'Show SystemInfo'; const SETTING_PERMISSION_SHUTDOWN_SERVER = 'Shutdown Server'; const SETTING_PERMISSION_CHANGE_SERVERSETTINGS = 'Change ServerSettings'; - const SETTING_PERMISSION_TM_HANDLE_POINTS_REPARTITION = 'Handle Points Repartion Settings'; + const SETTING_PERMISSION_TM_HANDLE_POINTS_REPARTITION = 'Handle Points Distribution Settings'; /* * Private properties @@ -101,8 +101,8 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer if ($this->maniaControl->getMapManager()->getCurrentMap()->getGame() === 'tm') { $this->maniaControl->getAuthenticationManager()->definePermissionLevel(self::SETTING_PERMISSION_TM_HANDLE_POINTS_REPARTITION, AuthenticationManager::AUTH_LEVEL_SUPERADMIN); - $this->maniaControl->getCommandManager()->registerCommandListener('setpointsrepartition', $this, 'commandSetPointsRepartition', true, 'Gets the Rounds Point Repartition.'); - $this->maniaControl->getCommandManager()->registerCommandListener('getpointsrepartition', $this, 'commandGetPointsRepartition', true, 'Sets the Rounds Point Repartition.'); + $this->maniaControl->getCommandManager()->registerCommandListener('setpointsdistribution', $this, 'commandSetPointsRepartition', true, 'Gets the Rounds Point Repartition.'); + $this->maniaControl->getCommandManager()->registerCommandListener('getpointsdistribution', $this, 'commandGetPointsRepartition', true, 'Sets the Rounds Point Repartition.'); } } @@ -474,10 +474,10 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer $pointString = $params[1]; $pointArray = explode(',', $pointString); $this->maniaControl->getModeScriptEventManager()->setTrackmaniaPointsRepartition($pointArray); - $this->maniaControl->getChat()->sendInformation('Points Repartition Changed!'); + $this->maniaControl->getChat()->sendInformation('Points Repartition Changed!', $player); $this->commandGetPointsRepartition($chatCallback, $player); } else { - $this->maniaControl->getChat()->sendError('You must provide a point Repartition in the following form: 10,8,6,4,3 !'); + $this->maniaControl->getChat()->sendError('You must provide a point Repartition in the following form: 10,8,6,4,3 !', $player); } } @@ -494,14 +494,14 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer return; } - $this->maniaControl->getModeScriptEventManager()->getTrackmaniaPointsRepartition()->setCallable(function (OnPointsRepartitionStructure $structure) { + $this->maniaControl->getModeScriptEventManager()->getTrackmaniaPointsRepartition()->setCallable(function (OnPointsRepartitionStructure $structure) use ($player){ $pointRepartitionString = ""; foreach ($structure->getPointsRepartition() as $points) { $pointRepartitionString .= $points . ','; } $pointRepartitionString = substr($pointRepartitionString, 0, -1); - $this->maniaControl->getChat()->sendInformation('Current Points Repartition: ' . $pointRepartitionString); + $this->maniaControl->getChat()->sendInformation('Current Points Repartition: ' . $pointRepartitionString, $player); }); }