Compare commits
8 Commits
7a8d9f2b0b
...
master
Author | SHA1 | Date | |
---|---|---|---|
875e05fae3
|
|||
6913609475
|
|||
a42c12ace8
|
|||
a769fec577
|
|||
271395edfa
|
|||
aefff423f7
|
|||
827e59ff93
|
|||
f15fc201d2
|
@ -50,6 +50,7 @@ class GameModeSettings implements ConfiguratorMenu, CallbackListener, Communicat
|
|||||||
const DESCRIPTION_HIDDEN = '<hidden>';
|
const DESCRIPTION_HIDDEN = '<hidden>';
|
||||||
|
|
||||||
const SETTING_HIDE_SETTINGS_WITH_DESCRIPTION_HIDDEN = 'Hide Settings with Description "' . self::DESCRIPTION_HIDDEN . '"';
|
const SETTING_HIDE_SETTINGS_WITH_DESCRIPTION_HIDDEN = 'Hide Settings with Description "' . self::DESCRIPTION_HIDDEN . '"';
|
||||||
|
const SETTING_SEND_SETTINGS_CHAT_ONLY_TO_ADMINS = 'Only send GameMode-Settings changes in the chat to admins';
|
||||||
const SETTING_LOAD_DEFAULT_SETTINGS_STARTUP = 'Load Stored GameMode-Settings on Startup';
|
const SETTING_LOAD_DEFAULT_SETTINGS_STARTUP = 'Load Stored GameMode-Settings on Startup';
|
||||||
const SETTING_LOAD_DEFAULT_SETTINGS_MAP_BEGIN = 'Load Stored GameMode-Settings on Map-Begin';
|
const SETTING_LOAD_DEFAULT_SETTINGS_MAP_BEGIN = 'Load Stored GameMode-Settings on Map-Begin';
|
||||||
const SETTING_PERMISSION_CHANGE_MODE_SETTINGS = 'Change GameMode-Settings';
|
const SETTING_PERMISSION_CHANGE_MODE_SETTINGS = 'Change GameMode-Settings';
|
||||||
@ -78,6 +79,7 @@ class GameModeSettings implements ConfiguratorMenu, CallbackListener, Communicat
|
|||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_HIDE_SETTINGS_WITH_DESCRIPTION_HIDDEN, true);
|
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_HIDE_SETTINGS_WITH_DESCRIPTION_HIDDEN, true);
|
||||||
|
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_SEND_SETTINGS_CHAT_ONLY_TO_ADMINS, false);
|
||||||
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_LOAD_DEFAULT_SETTINGS_STARTUP, false);
|
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_LOAD_DEFAULT_SETTINGS_STARTUP, false);
|
||||||
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_LOAD_DEFAULT_SETTINGS_MAP_BEGIN, false);
|
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_LOAD_DEFAULT_SETTINGS_MAP_BEGIN, false);
|
||||||
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_SORT_SETTINGS, true);
|
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_SORT_SETTINGS, true);
|
||||||
@ -618,6 +620,7 @@ class GameModeSettings implements ConfiguratorMenu, CallbackListener, Communicat
|
|||||||
|
|
||||||
// Trigger own callback
|
// Trigger own callback
|
||||||
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_GAMEMODESETTING_CHANGED, $settingName, $settingValue);
|
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_GAMEMODESETTING_CHANGED, $settingName, $settingValue);
|
||||||
|
Logger::log(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') changed the gamemode setting "'. $settingName .'" to "'. $settingValue .'"');
|
||||||
|
|
||||||
$settingIndex++;
|
$settingIndex++;
|
||||||
}
|
}
|
||||||
@ -626,8 +629,14 @@ class GameModeSettings implements ConfiguratorMenu, CallbackListener, Communicat
|
|||||||
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_GAMEMODESETTINGS_CHANGED);
|
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_GAMEMODESETTINGS_CHANGED);
|
||||||
|
|
||||||
$chatMessage .= '!';
|
$chatMessage .= '!';
|
||||||
$this->maniaControl->getChat()->sendInformation($chatMessage);
|
|
||||||
Logger::logInfo($chatMessage, true);
|
$sendSettingsToAdminsOnly = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_SEND_SETTINGS_CHAT_ONLY_TO_ADMINS);
|
||||||
|
if ($sendSettingsToAdminsOnly) {
|
||||||
|
$this->maniaControl->getChat()->sendInformationToAdmins($chatMessage);
|
||||||
|
} else {
|
||||||
|
$this->maniaControl->getChat()->sendInformation($chatMessage);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ use FML\Script\Script;
|
|||||||
use ManiaControl\Admin\AuthenticationManager;
|
use ManiaControl\Admin\AuthenticationManager;
|
||||||
use ManiaControl\Callbacks\CallbackListener;
|
use ManiaControl\Callbacks\CallbackListener;
|
||||||
use ManiaControl\Callbacks\CallbackManager;
|
use ManiaControl\Callbacks\CallbackManager;
|
||||||
|
use ManiaControl\Logger;
|
||||||
use ManiaControl\ManiaControl;
|
use ManiaControl\ManiaControl;
|
||||||
use ManiaControl\Players\Player;
|
use ManiaControl\Players\Player;
|
||||||
use ManiaControl\Settings\Setting;
|
use ManiaControl\Settings\Setting;
|
||||||
@ -528,6 +529,7 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
$setting->value = $settingData['Value'];
|
$setting->value = $settingData['Value'];
|
||||||
}
|
}
|
||||||
$this->maniaControl->getSettingManager()->saveSetting($setting);
|
$this->maniaControl->getSettingManager()->saveSetting($setting);
|
||||||
|
Logger::log(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') changed the setting "'. $setting->class . '\\\\' . $setting->setting .'" to "'. $setting->value .'"');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->maniaControl->getChat()->sendSuccess('Settings saved!', $player);
|
$this->maniaControl->getChat()->sendSuccess('Settings saved!', $player);
|
||||||
|
@ -547,7 +547,7 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
|
|||||||
* @param Player $player
|
* @param Player $player
|
||||||
*/
|
*/
|
||||||
public function commandVersion(array $chatCallback, Player $player) {
|
public function commandVersion(array $chatCallback, Player $player) {
|
||||||
$message = 'This server is using TrackManiaControl v' . ManiaControl::VERSION . '!';
|
$message = 'This server is using TrackManiaControl v' . ManiaControl::VERSION . ' with PHP '. phpversion() .'!';
|
||||||
$this->getChat()->sendInformation($message, $player);
|
$this->getChat()->sendInformation($message, $player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ use FML\Controls\Quads\Quad_UIConstruction_Buttons;
|
|||||||
use FML\Controls\Quads\Quad_UIConstructionBullet_Buttons;
|
use FML\Controls\Quads\Quad_UIConstructionBullet_Buttons;
|
||||||
use FML\ManiaLink;
|
use FML\ManiaLink;
|
||||||
use FML\Script\Features\Paging;
|
use FML\Script\Features\Paging;
|
||||||
|
use ManiaControl\Admin\AuthenticationManager;
|
||||||
use ManiaControl\Files\AsyncHttpRequest;
|
use ManiaControl\Files\AsyncHttpRequest;
|
||||||
use ManiaControl\Files\FileUtil;
|
use ManiaControl\Files\FileUtil;
|
||||||
use ManiaControl\Logger;
|
use ManiaControl\Logger;
|
||||||
@ -483,6 +484,11 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
|
|||||||
* @param Player $player
|
* @param Player $player
|
||||||
*/
|
*/
|
||||||
public function handleAddFile(array $actionCallback, Player $player) {
|
public function handleAddFile(array $actionCallback, Player $player) {
|
||||||
|
if (!$this->maniaControl->getAuthenticationManager()->checkPermission($player, MapManager::SETTING_PERMISSION_ADD_MAP)) {
|
||||||
|
$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$actionName = $actionCallback[1][2];
|
$actionName = $actionCallback[1][2];
|
||||||
$fileName = base64_decode(substr($actionName, strlen(self::ACTION_ADD_FILE)));
|
$fileName = base64_decode(substr($actionName, strlen(self::ACTION_ADD_FILE)));
|
||||||
$folderPath = $player->getCache($this, self::CACHE_FOLDER_PATH);
|
$folderPath = $player->getCache($this, self::CACHE_FOLDER_PATH);
|
||||||
@ -529,7 +535,7 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
|
|||||||
$map
|
$map
|
||||||
);
|
);
|
||||||
$this->maniaControl->getChat()->sendSuccess($message);
|
$this->maniaControl->getChat()->sendSuccess($message);
|
||||||
Logger::logInfo($message, true);
|
Logger::log(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') added the map file "'. $filePath .'"');
|
||||||
|
|
||||||
// Queue requested Map
|
// Queue requested Map
|
||||||
$this->maniaControl->getMapManager()->getMapQueue()->addMapToMapQueue($player, $map);
|
$this->maniaControl->getMapManager()->getMapQueue()->addMapToMapQueue($player, $map);
|
||||||
@ -542,16 +548,33 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
|
|||||||
* @param Player $player
|
* @param Player $player
|
||||||
*/
|
*/
|
||||||
public function handleEraseFile(array $actionCallback, Player $player) {
|
public function handleEraseFile(array $actionCallback, Player $player) {
|
||||||
|
if (!$this->maniaControl->getAuthenticationManager()->checkPermission($player, MapManager::SETTING_PERMISSION_ERASE_MAP)) {
|
||||||
|
$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$actionName = $actionCallback[1][2];
|
$actionName = $actionCallback[1][2];
|
||||||
$fileName = base64_decode(substr($actionName, strlen(self::ACTION_ERASE_FILE)));
|
$fileName = base64_decode(substr($actionName, strlen(self::ACTION_ERASE_FILE)));
|
||||||
$folderPath = $player->getCache($this, self::CACHE_FOLDER_PATH);
|
$folderPath = $player->getCache($this, self::CACHE_FOLDER_PATH);
|
||||||
$filePath = $folderPath . $fileName;
|
$filePath = $folderPath . $fileName;
|
||||||
|
|
||||||
|
$maps = $this->maniaControl->getMapManager()->getMaps();
|
||||||
|
$mapsFolder = $this->maniaControl->getServer()->getDirectory()->getMapsFolder();
|
||||||
|
$filteredMaps = array_filter($maps, function ($item) use ($mapsFolder, $filePath) {
|
||||||
|
return ($mapsFolder . $item->fileName === $filePath);
|
||||||
|
});
|
||||||
|
foreach ($filteredMaps as $map) {
|
||||||
|
Logger::log('Map "'. $filePath .'" loaded by the server, removing it from the playlist before erasing the file');
|
||||||
|
$this->maniaControl->getMapManager()->removeMap($player, $map->uid);
|
||||||
|
}
|
||||||
|
|
||||||
if (@unlink($filePath)) {
|
if (@unlink($filePath)) {
|
||||||
$message = $this->maniaControl->getChat()->formatMessage(
|
$message = $this->maniaControl->getChat()->formatMessage(
|
||||||
'Erased %s!',
|
'Erased %s!',
|
||||||
$fileName
|
$fileName
|
||||||
);
|
);
|
||||||
$this->maniaControl->getChat()->sendSuccess($message, $player);
|
$this->maniaControl->getChat()->sendSuccess($message, $player);
|
||||||
|
Logger::log(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') erased the map file "'. $filePath .'"');
|
||||||
$this->showManiaLink($player);
|
$this->showManiaLink($player);
|
||||||
} else {
|
} else {
|
||||||
$message = $this->maniaControl->getChat()->formatMessage(
|
$message = $this->maniaControl->getChat()->formatMessage(
|
||||||
@ -569,6 +592,11 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
|
|||||||
* @param Player $player
|
* @param Player $player
|
||||||
*/
|
*/
|
||||||
public function handleCreateFolder(array $actionCallback, Player $player) {
|
public function handleCreateFolder(array $actionCallback, Player $player) {
|
||||||
|
if (!$this->maniaControl->getAuthenticationManager()->checkPermission($player, MapManager::SETTING_PERMISSION_ADD_MAP)) {
|
||||||
|
$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$name = trim($actionCallback[1][3][0]["Value"]);
|
$name = trim($actionCallback[1][3][0]["Value"]);
|
||||||
|
|
||||||
var_dump($actionCallback);
|
var_dump($actionCallback);
|
||||||
@ -578,13 +606,13 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
|
|||||||
if (mkdir($folderPath . $name, 755, true)) {
|
if (mkdir($folderPath . $name, 755, true)) {
|
||||||
$message = "Successfully created directory ". $name;
|
$message = "Successfully created directory ". $name;
|
||||||
$this->maniaControl->getChat()->sendSuccess($message, $player);
|
$this->maniaControl->getChat()->sendSuccess($message, $player);
|
||||||
Logger::log($message . " by " . $player->nickname);
|
Logger::log(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') created the folder "'. $folderPath .'"');
|
||||||
|
|
||||||
$this->showManiaLink($player, $name);
|
$this->showManiaLink($player, $name);
|
||||||
} else {
|
} else {
|
||||||
$message = "Failed to create directory ". $name;
|
$message = "Failed to create directory ". $name;
|
||||||
$this->maniaControl->getChat()->sendError($message, $player);
|
$this->maniaControl->getChat()->sendError($message, $player);
|
||||||
Logger::logError($message . " by " . $player->nickname);
|
Logger::logError(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') encountered an error when creating the folder "'. $folderPath .'".');
|
||||||
|
|
||||||
$this->showManiaLink($player);
|
$this->showManiaLink($player);
|
||||||
}
|
}
|
||||||
@ -607,7 +635,7 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
|
|||||||
if (!$file || $error) {
|
if (!$file || $error) {
|
||||||
$message = "Impossible to download the file: " . $error;
|
$message = "Impossible to download the file: " . $error;
|
||||||
$this->maniaControl->getChat()->sendError($message, $player);
|
$this->maniaControl->getChat()->sendError($message, $player);
|
||||||
Logger::logError($message);
|
Logger::logError(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') encountered an error during the download of the zip file "'. $url .'": '. $error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$filePath = "";
|
$filePath = "";
|
||||||
@ -625,13 +653,13 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
|
|||||||
if ($open === true) {
|
if ($open === true) {
|
||||||
$zip->extractTo($folderPath);
|
$zip->extractTo($folderPath);
|
||||||
$zip->close();
|
$zip->close();
|
||||||
$message = "Succesfully extracted zip archive from ". $url;
|
$message = "Successfully extracted zip archive from ". $url;
|
||||||
$this->maniaControl->getChat()->sendSuccess($message, $player);
|
$this->maniaControl->getChat()->sendSuccess($message, $player);
|
||||||
Logger::log($message . " by " . $player->nickname);
|
Logger::log(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') downloaded the zip file "'. $url .'"');
|
||||||
} else {
|
} else {
|
||||||
$message = "Cannot extract archive from ". $url;
|
$message = "Cannot extract archive from ". $url;
|
||||||
$this->maniaControl->getChat()->sendError($message, $player);
|
$this->maniaControl->getChat()->sendError($message, $player);
|
||||||
Logger::logError($message . " by " . $player->nickname);
|
Logger::logError(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') encountered an error when downloading the zip file "'. $url .'": Cannot extract the archive');
|
||||||
}
|
}
|
||||||
// Clean up the temporary file
|
// Clean up the temporary file
|
||||||
unlink($tempFile);
|
unlink($tempFile);
|
||||||
@ -691,7 +719,7 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
|
|||||||
if (!$this->isMapFileName($filePath)) {
|
if (!$this->isMapFileName($filePath)) {
|
||||||
$message = "File is not a map: " . $fileName;
|
$message = "File is not a map: " . $fileName;
|
||||||
$this->maniaControl->getChat()->sendError($message, $player);
|
$this->maniaControl->getChat()->sendError($message, $player);
|
||||||
Logger::logError($message);
|
Logger::logError(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') encountered an error when downloadeding the map file "'. $fileName .'": File is not a map');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -718,13 +746,13 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
|
|||||||
if (!$bytes || $bytes <= 0) {
|
if (!$bytes || $bytes <= 0) {
|
||||||
$message = "Failed to write file " . $filePath;
|
$message = "Failed to write file " . $filePath;
|
||||||
$this->maniaControl->getChat()->sendError($message, $player);
|
$this->maniaControl->getChat()->sendError($message, $player);
|
||||||
Logger::logError($message . " by " . $player->nickname);
|
Logger::logError(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') encountered an error when downloadeding the map file "'. $fileName .'": Failed to write the file');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$message = "Succesfully downloaded the map ". $fileName;
|
$message = "Successfully downloaded the map ". $fileName;
|
||||||
$this->maniaControl->getChat()->sendSuccess($message, $player);
|
$this->maniaControl->getChat()->sendSuccess($message, $player);
|
||||||
Logger::log($message . " by " . $player->nickname);
|
Logger::log(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') downloaded the map file "'. $filePath .'"');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ class MapManager implements CallbackListener, CommunicationListener, UsageInform
|
|||||||
* @param string $uid
|
* @param string $uid
|
||||||
*/
|
*/
|
||||||
public function updateMap($admin, $uid) {
|
public function updateMap($admin, $uid) {
|
||||||
if (!$this->maniaControl->getAuthenticationManager()->checkPermission($admin, self::SETTING_PERMISSION_ADD_MAP)) return;
|
if ($admin !== null && !$this->maniaControl->getAuthenticationManager()->checkPermission($admin, self::SETTING_PERMISSION_ADD_MAP)) return;
|
||||||
|
|
||||||
$this->updateMapTimestamp($uid);
|
$this->updateMapTimestamp($uid);
|
||||||
|
|
||||||
@ -274,7 +274,7 @@ class MapManager implements CallbackListener, CommunicationListener, UsageInform
|
|||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function removeMap($admin, $uid, $eraseFile = false, $message = true) {
|
public function removeMap($admin, $uid, $eraseFile = false, $message = true) {
|
||||||
if (!$this->maniaControl->getAuthenticationManager()->checkPermission($admin, self::SETTING_PERMISSION_REMOVE_MAP)) return;
|
if ($admin !== null && !$this->maniaControl->getAuthenticationManager()->checkPermission($admin, self::SETTING_PERMISSION_REMOVE_MAP)) return;
|
||||||
|
|
||||||
if (!isset($this->maps[$uid])) {
|
if (!isset($this->maps[$uid])) {
|
||||||
if ($admin) {
|
if ($admin) {
|
||||||
|
@ -636,6 +636,8 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
|||||||
$setting->value = $settingData['Value'];
|
$setting->value = $settingData['Value'];
|
||||||
}
|
}
|
||||||
$this->maniaControl->getSettingManager()->saveSetting($setting);
|
$this->maniaControl->getSettingManager()->saveSetting($setting);
|
||||||
|
Logger::log(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') changed the setting "'. $setting->class . '\\\\' . $setting->setting .'" to "'. $setting->value .'"');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->maniaControl->getChat()->sendSuccess('Plugin Settings saved!', $player);
|
$this->maniaControl->getChat()->sendSuccess('Plugin Settings saved!', $player);
|
||||||
|
@ -418,6 +418,7 @@ class ServerOptionsMenu implements CallbackListener, ConfiguratorMenu, TimerList
|
|||||||
$success = $this->applyNewServerOptions($newServerOptions, $player);
|
$success = $this->applyNewServerOptions($newServerOptions, $player);
|
||||||
if ($success) {
|
if ($success) {
|
||||||
$this->maniaControl->getChat()->sendSuccess('Server Options saved!', $player);
|
$this->maniaControl->getChat()->sendSuccess('Server Options saved!', $player);
|
||||||
|
Logger::log(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') changed Server Options');
|
||||||
} else {
|
} else {
|
||||||
$this->maniaControl->getChat()->sendError('Server Options saving failed!', $player);
|
$this->maniaControl->getChat()->sendError('Server Options saving failed!', $player);
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ use ManiaControl\Admin\AuthenticationManager;
|
|||||||
use ManiaControl\Callbacks\CallbackListener;
|
use ManiaControl\Callbacks\CallbackListener;
|
||||||
use ManiaControl\Callbacks\TimerListener;
|
use ManiaControl\Callbacks\TimerListener;
|
||||||
use ManiaControl\Configurator\ConfiguratorMenu;
|
use ManiaControl\Configurator\ConfiguratorMenu;
|
||||||
|
use ManiaControl\Logger;
|
||||||
use ManiaControl\ManiaControl;
|
use ManiaControl\ManiaControl;
|
||||||
use ManiaControl\Players\Player;
|
use ManiaControl\Players\Player;
|
||||||
use Maniaplanet\DedicatedServer\Structures\VoteRatio;
|
use Maniaplanet\DedicatedServer\Structures\VoteRatio;
|
||||||
@ -166,6 +167,7 @@ class VoteRatiosMenu implements CallbackListener, ConfiguratorMenu, TimerListene
|
|||||||
$success = $this->maniaControl->getClient()->setCallVoteRatios($newVoteRatios);
|
$success = $this->maniaControl->getClient()->setCallVoteRatios($newVoteRatios);
|
||||||
if ($success) {
|
if ($success) {
|
||||||
$this->maniaControl->getChat()->sendSuccess('Vote Ratios saved!', $player);
|
$this->maniaControl->getChat()->sendSuccess('Vote Ratios saved!', $player);
|
||||||
|
Logger::log(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') changed the Vote Ratios');
|
||||||
} else {
|
} else {
|
||||||
$this->maniaControl->getChat()->sendError('Vote Ratios saving failed!', $player);
|
$this->maniaControl->getChat()->sendError('Vote Ratios saving failed!', $player);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user