minor cleanup
This commit is contained in:
parent
b1921fcc2b
commit
22707ea946
@ -90,10 +90,10 @@ class AuthenticationManager implements CallbackListener {
|
||||
trigger_error($mysqli->error, E_USER_ERROR);
|
||||
return false;
|
||||
}
|
||||
$adminStatement->bind_param('si', $login, $masterAdminLevel);
|
||||
$success = true;
|
||||
foreach($masterAdmins as $masterAdmin) {
|
||||
$login = (string)$masterAdmin;
|
||||
$adminStatement->bind_param('si', $login, $masterAdminLevel);
|
||||
$adminStatement->execute();
|
||||
if ($adminStatement->error) {
|
||||
trigger_error($adminStatement->error);
|
||||
|
@ -279,7 +279,7 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn
|
||||
|
||||
$menuItemY = $menuHeight * 0.42;
|
||||
$menuId = 0;
|
||||
foreach($this->menus as $index => $menu) {
|
||||
foreach($this->menus as $menu) {
|
||||
/** @var ConfiguratorMenu $menu */
|
||||
|
||||
// Add title
|
||||
|
@ -2,9 +2,7 @@
|
||||
|
||||
namespace ManiaControl\Configurators;
|
||||
|
||||
use FML\Script\Pages;
|
||||
use FML\Script\Script;
|
||||
use FML\Script\Tooltips;
|
||||
use ManiaControl\Players\Player;
|
||||
|
||||
/**
|
||||
|
@ -351,9 +351,9 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
|
||||
}
|
||||
|
||||
// Notifications
|
||||
$settingsCount = count($newSettings);
|
||||
//$settingsCount = count($newSettings);
|
||||
$settingIndex = 0;
|
||||
$title = $this->maniaControl->authenticationManager->getAuthLevelName($player->authLevel);
|
||||
//$title = $this->maniaControl->authenticationManager->getAuthLevelName($player->authLevel);
|
||||
// $chatMessage = '$ff0' . $title . ' $<' . $player->nickname . '$> set ScriptSetting' . ($settingsCount > 1 ? 's' : '') . ' ';
|
||||
|
||||
foreach($newSettings as $setting => $value) {
|
||||
|
@ -73,6 +73,7 @@ abstract class Formatter {
|
||||
return $r . ' ' . $str . ($r > 1 ? 's' : '') . ' ago';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -21,7 +21,8 @@ class MXMapInfo {
|
||||
* Returns map object with all available data from MX map data
|
||||
*
|
||||
* @param String $prefix MX URL prefix
|
||||
* @param Object $map The MX map data from MXInfoSearcher
|
||||
* @param $mx
|
||||
* @internal param Object $map The MX map data from MXInfoSearcher
|
||||
* @return MXMapInfo
|
||||
*/
|
||||
public function __construct($prefix, $mx) {
|
||||
|
@ -134,6 +134,7 @@ class PluginManager {
|
||||
return false;
|
||||
}
|
||||
$plugin = new $pluginClass();
|
||||
/** @var Plugin $plugin */
|
||||
$this->activePlugins[$pluginClass] = $plugin;
|
||||
$this->savePluginStatus($pluginClass, true);
|
||||
try {
|
||||
@ -164,6 +165,7 @@ class PluginManager {
|
||||
return false;
|
||||
}
|
||||
$plugin = $this->activePlugins[$pluginClass];
|
||||
/** @var Plugin $plugin */
|
||||
unset($this->activePlugins[$pluginClass]);
|
||||
$plugin->unload();
|
||||
$interfaces = class_implements($pluginClass);
|
||||
|
@ -57,7 +57,6 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \ManiaControl\Configurators\ConfiguratorMenu::getTitle()
|
||||
*/
|
||||
public function getTitle() {
|
||||
@ -74,7 +73,6 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \ManiaControl\Configurators\ConfiguratorMenu::getMenu()
|
||||
*/
|
||||
public function getMenu($width, $height, Script $script) {
|
||||
@ -124,7 +122,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
$y = 0;
|
||||
$index = 1;
|
||||
$settingHeight = 5.;
|
||||
foreach($settings as $id => $setting) {
|
||||
foreach($settings as $setting) {
|
||||
if (!isset($pageFrame)) {
|
||||
$pageFrame = new Frame();
|
||||
$frame->add($pageFrame);
|
||||
@ -241,6 +239,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
$pageFrames = array();
|
||||
$y = 0.;
|
||||
foreach($pluginClasses as $index => $pluginClass) {
|
||||
/** @var Plugin $pluginClass */
|
||||
if (!isset($pageFrame)) {
|
||||
$pageFrame = new Frame();
|
||||
$frame->add($pageFrame);
|
||||
@ -325,7 +324,6 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \ManiaControl\Configurators\ConfiguratorMenu::saveConfigData()
|
||||
*/
|
||||
public function saveConfigData(array $configData, Player $player) {
|
||||
@ -351,7 +349,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->maniaControl->settingManager->updateSetting($oldSetting->class, $oldSetting->setting, $setting['Value']);
|
||||
$this->maniaControl->settingManager->setSetting($oldSetting->class, $oldSetting->setting, $setting['Value']);
|
||||
}
|
||||
|
||||
//Reopen the Menu
|
||||
@ -381,6 +379,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
}
|
||||
if ($enable) {
|
||||
$pluginClass = substr($actionId, strlen(self::ACTION_PREFIX_ENABLEPLUGIN));
|
||||
/** @var Plugin $pluginClass */
|
||||
$activated = $this->maniaControl->pluginManager->activatePlugin($pluginClass, $player->login);
|
||||
if ($activated) {
|
||||
$this->maniaControl->chat->sendSuccess($pluginClass::getName() . ' activated!', $player->login);
|
||||
@ -391,6 +390,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
}
|
||||
} else if ($disable) {
|
||||
$pluginClass = substr($actionId, strlen(self::ACTION_PREFIX_DISABLEPLUGIN));
|
||||
/** @var Plugin $pluginClass */
|
||||
$deactivated = $this->maniaControl->pluginManager->deactivatePlugin($pluginClass);
|
||||
if ($deactivated) {
|
||||
$this->maniaControl->chat->sendSuccess($pluginClass::getName() . ' deactivated!', $player->login);
|
||||
@ -442,9 +442,9 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
|
||||
//Toggle value
|
||||
if ($oldSetting->value == "1") {
|
||||
$this->maniaControl->settingManager->updateSetting($oldSetting->class, $oldSetting->setting, "0");
|
||||
$this->maniaControl->settingManager->setSetting($oldSetting->class, $oldSetting->setting, "0");
|
||||
} else {
|
||||
$this->maniaControl->settingManager->updateSetting($oldSetting->class, $oldSetting->setting, "1");
|
||||
$this->maniaControl->settingManager->setSetting($oldSetting->class, $oldSetting->setting, "1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ class RankingManager implements CallbackListener {
|
||||
public function getLeaders() {
|
||||
$leaders = array();
|
||||
$prev = -1;
|
||||
foreach($this->rankings as $player => $score) {
|
||||
foreach($this->rankings as $score) {
|
||||
if ($prev != -1 && $prev < $score) {
|
||||
return $leaders;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user