moved core callbacks constants into callbacks interface
server options fix
This commit is contained in:
parent
5e688a5354
commit
f915417b8b
@ -9,7 +9,7 @@ use FML\Controls\Quad;
|
||||
use FML\Controls\Quads\Quad_Icons64x64_1;
|
||||
use FML\ManiaLink;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Callbacks\Callbacks;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Manialinks\ManialinkPageAnswerListener;
|
||||
use ManiaControl\Players\Player;
|
||||
@ -55,7 +55,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
|
||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_ITEMSIZE, 6.);
|
||||
|
||||
// Register for callbacks
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_AFTERINIT, $this, 'handleAfterInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::AFTERINIT, $this, 'handleAfterInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERCONNECT, $this, 'handlePlayerJoined');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(AuthenticationManager::CB_AUTH_LEVEL_CHANGED, $this, 'handlePlayerJoined');
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace ManiaControl\Admin;
|
||||
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Callbacks\Callbacks;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Players\Player;
|
||||
use ManiaControl\Players\PlayerManager;
|
||||
@ -51,7 +51,7 @@ class AuthenticationManager implements CallbackListener {
|
||||
$this->maniaControl = $maniaControl;
|
||||
$this->authCommands = new AuthCommands($maniaControl);
|
||||
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'handleOnInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'handleOnInit');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -17,9 +17,12 @@ class CallbackManager {
|
||||
*/
|
||||
// ManiaControl callbacks
|
||||
// TODO: move into Callbacks interface
|
||||
const CB_ONINIT = 'ManiaControl.OnInit';
|
||||
const CB_AFTERINIT = 'ManiaControl.AfterInit';
|
||||
const CB_ONSHUTDOWN = 'ManiaControl.OnShutdown';
|
||||
/** @deprecated Use Callbacks Interface */
|
||||
const CB_ONINIT = 'Callbacks.OnInit';
|
||||
/** @deprecated Use Callbacks Interface */
|
||||
const CB_AFTERINIT = 'Callbacks.AfterInit';
|
||||
/** @deprecated Use Callbacks Interface */
|
||||
const CB_ONSHUTDOWN = 'Callbacks.OnShutdown';
|
||||
|
||||
// ManiaPlanet callbacks
|
||||
const CB_MP_SERVERSTART = 'ManiaPlanet.ServerStart';
|
||||
@ -49,8 +52,8 @@ class CallbackManager {
|
||||
/*
|
||||
* Public Properties
|
||||
*/
|
||||
public $shootManiaCallbacks = null;
|
||||
public $libXmlRpcCallbacks = null;
|
||||
public $shootManiaCallbacks = null;
|
||||
|
||||
/*
|
||||
* Private Properties
|
||||
|
@ -12,6 +12,13 @@ namespace ManiaControl\Callbacks;
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
interface Callbacks {
|
||||
/*
|
||||
* ManiaControl Callbacks
|
||||
*/
|
||||
const ONINIT = 'Callbacks.OnInit';
|
||||
const AFTERINIT = 'Callbacks.AfterInit';
|
||||
const ONSHUTDOWN = 'Callbacks.OnShutdown';
|
||||
|
||||
/** Script Callback: CallbackName, CallbackData */
|
||||
const SCRIPTCALLBACK = 'Callbacks.ScriptCallback';
|
||||
|
||||
@ -48,6 +55,8 @@ interface Callbacks {
|
||||
const ENDPODIUM = 'Callbacks.EndPodium';
|
||||
/** UnloadingMap Callback */
|
||||
const UNLOADINGMAP = 'Callbacks.UnloadingMap';
|
||||
/** EndMatch Callback: MatchNumber */
|
||||
const ENDMATCH = 'Callbacks.EndMatch';
|
||||
|
||||
/** BeginWarmup Callback */
|
||||
const BEGINWARMUP = 'Callbacks.BeginWarmUp';
|
||||
|
@ -8,7 +8,7 @@ use FML\Controls\Quads\Quad_BgsPlayerCard;
|
||||
use FML\ManiaLink;
|
||||
use FML\Script\Features\Paging;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Callbacks\Callbacks;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Manialinks\ManialinkManager;
|
||||
use ManiaControl\Players\Player;
|
||||
@ -37,7 +37,7 @@ class HelpManager implements CommandListener, CallbackListener {
|
||||
$this->maniaControl = $maniaControl;
|
||||
|
||||
// Register for callbacks
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'handleOnInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'handleOnInit');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,7 +54,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
|
||||
|
||||
// Register for callbacks
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERMANIALINKPAGEANSWER, $this, 'handleManialinkPageAnswer');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'onInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'onInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::BEGINMAP, $this, 'onBeginMap');
|
||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_LOAD_DEFAULT_SETTINGS_MAP_BEGIN, true);
|
||||
$this->initTables();
|
||||
|
@ -14,7 +14,7 @@ use FML\Script\Features\Paging;
|
||||
use FML\Script\Script;
|
||||
use ManiaControl\Admin\AuthenticationManager;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Callbacks\Callbacks;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Players\Player;
|
||||
use Maniaplanet\DedicatedServer\Structures\ServerOptions;
|
||||
@ -52,7 +52,7 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
|
||||
$this->initTables();
|
||||
|
||||
// Register for callbacks
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'onInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'onInit');
|
||||
|
||||
//Permission for Change Script-Settings
|
||||
$this->maniaControl->authenticationManager->definePermissionLevel(self::SETTING_PERMISSION_CHANGE_SERVER_SETTINGS, AuthenticationManager::AUTH_LEVEL_SUPERADMIN);
|
||||
@ -258,11 +258,11 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
|
||||
|
||||
$prefixLength = strlen(self::ACTION_PREFIX_SETTING);
|
||||
|
||||
$newSettings = array();
|
||||
$newSettings = new ServerOptions();
|
||||
foreach ($configData[3] as $setting) {
|
||||
$settingName = substr($setting['Name'], $prefixLength);
|
||||
$newSettings[$settingName] = $setting['Value'];
|
||||
settype($newSettings[$settingName], gettype($serverSettings[$settingName]));
|
||||
$newSettings->$settingName = $setting['Value'];
|
||||
settype($newSettings->$settingName, gettype($serverSettings[$settingName]));
|
||||
}
|
||||
|
||||
$success = $this->applyNewServerSettings($newSettings, $player);
|
||||
|
@ -6,6 +6,7 @@ use ManiaControl\Admin\ActionsMenu;
|
||||
use ManiaControl\Admin\AuthenticationManager;
|
||||
use ManiaControl\Bills\BillManager;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Callbacks\Callbacks;
|
||||
use ManiaControl\Callbacks\TimerListener;
|
||||
use ManiaControl\Callbacks\TimerManager;
|
||||
use ManiaControl\Commands\CommandListener;
|
||||
@ -221,7 +222,7 @@ class ManiaControl implements CommandListener, TimerListener {
|
||||
*/
|
||||
public function restart($message = null) {
|
||||
// Shutdown callback
|
||||
$this->callbackManager->triggerCallback(CallbackManager::CB_ONSHUTDOWN);
|
||||
$this->callbackManager->triggerCallback(Callbacks::ONSHUTDOWN);
|
||||
|
||||
// Announce restart
|
||||
$this->chat->sendInformation('Restarting ManiaControl...');
|
||||
@ -287,7 +288,7 @@ class ManiaControl implements CommandListener, TimerListener {
|
||||
*/
|
||||
public function handleShutdown() {
|
||||
// OnShutdown callback
|
||||
$this->callbackManager->triggerCallback(CallbackManager::CB_ONSHUTDOWN);
|
||||
$this->callbackManager->triggerCallback(Callbacks::ONSHUTDOWN);
|
||||
|
||||
// Announce quit
|
||||
$this->chat->sendInformation('ManiaControl shutting down.');
|
||||
@ -336,14 +337,14 @@ class ManiaControl implements CommandListener, TimerListener {
|
||||
}
|
||||
|
||||
// OnInit callback
|
||||
$this->callbackManager->triggerCallback(CallbackManager::CB_ONINIT);
|
||||
$this->callbackManager->triggerCallback(Callbacks::ONINIT);
|
||||
|
||||
// Load plugins
|
||||
$this->pluginManager->loadPlugins();
|
||||
$this->updateManager->pluginUpdateManager->checkPluginsUpdate();
|
||||
|
||||
// AfterInit callback
|
||||
$this->callbackManager->triggerCallback(CallbackManager::CB_AFTERINIT);
|
||||
$this->callbackManager->triggerCallback(Callbacks::AFTERINIT);
|
||||
|
||||
// Enable Garbage Collecting
|
||||
gc_enable();
|
||||
|
@ -6,7 +6,7 @@ use FML\Controls\Frame;
|
||||
use FML\Controls\Quad;
|
||||
use FML\ManiaLink;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Callbacks\Callbacks;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Players\Player;
|
||||
use ManiaControl\Players\PlayerManager;
|
||||
@ -50,7 +50,7 @@ class IconManager implements CallbackListener {
|
||||
$this->addDefaultIcons();
|
||||
|
||||
// Register for callbacks
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_AFTERINIT, $this, 'handleAfterInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::AFTERINIT, $this, 'handleAfterInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERCONNECT, $this, 'handlePlayerConnect');
|
||||
}
|
||||
|
||||
|
@ -32,11 +32,7 @@ class MapManager implements CallbackListener {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const TABLE_MAPS = 'mc_maps';
|
||||
/** @deprecated CB_BEGINMAP */
|
||||
const CB_BEGINMAP = 'MapManager.BeginMap';
|
||||
/** @deprecated CB_ENDMAP */
|
||||
const CB_ENDMAP = 'MapManager.EndMap';
|
||||
const TABLE_MAPS = 'mc_maps';
|
||||
const CB_MAPS_UPDATED = 'MapManager.MapsUpdated';
|
||||
const CB_KARMA_UPDATED = 'MapManager.KarmaUpdated';
|
||||
const SETTING_PERMISSION_ADD_MAP = 'Add Maps';
|
||||
@ -48,6 +44,11 @@ class MapManager implements CallbackListener {
|
||||
const SETTING_AUTOSAVE_MAPLIST = 'Autosave Maplist file';
|
||||
const SETTING_MAPLIST_FILE = 'File to write Maplist in';
|
||||
|
||||
/** @deprecated Use Callbacks Interface */
|
||||
const CB_BEGINMAP = 'Callbacks.BeginMap';
|
||||
/** @deprecated Use Callbacks Interface */
|
||||
const CB_ENDMAP = 'Callbacks.EndMap';
|
||||
|
||||
/*
|
||||
* Public Properties
|
||||
*/
|
||||
@ -86,8 +87,8 @@ class MapManager implements CallbackListener {
|
||||
$this->mapActions = new MapActions($maniaControl);
|
||||
|
||||
// Register for callbacks
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'handleOnInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_AFTERINIT, $this, 'handleAfterInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'handleOnInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::AFTERINIT, $this, 'handleAfterInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_MAPLISTMODIFIED, $this, 'mapsModified');
|
||||
|
||||
// Define Rights
|
||||
@ -680,9 +681,7 @@ class MapManager implements CallbackListener {
|
||||
// Update the mx of the map (for update checks, etc.)
|
||||
$this->mxManager->fetchManiaExchangeMapInformation($this->currentMap);
|
||||
|
||||
// Trigger own BeginMap callback (
|
||||
//TODO remove deprecated callback later
|
||||
$this->maniaControl->callbackManager->triggerCallback(self::CB_BEGINMAP, $this->currentMap);
|
||||
// Trigger own BeginMap callback
|
||||
$this->maniaControl->callbackManager->triggerCallback(Callbacks::BEGINMAP, $this->currentMap);
|
||||
}
|
||||
|
||||
@ -697,8 +696,6 @@ class MapManager implements CallbackListener {
|
||||
$this->mapBegan = false;
|
||||
|
||||
// Trigger own EndMap callback
|
||||
$this->maniaControl->callbackManager->triggerCallback(self::CB_ENDMAP, $this->currentMap);
|
||||
//TODO remove deprecated callback later
|
||||
$this->maniaControl->callbackManager->triggerCallback(Callbacks::ENDMAP, $this->currentMap);
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,6 @@ namespace ManiaControl\Maps;
|
||||
|
||||
use ManiaControl\Admin\AuthenticationManager;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Callbacks\Callbacks;
|
||||
use ManiaControl\Commands\CommandListener;
|
||||
use ManiaControl\ManiaControl;
|
||||
@ -55,7 +54,7 @@ class MapQueue implements CallbackListener, CommandListener {
|
||||
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ENDMAP, $this, 'endMap');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::BEGINMAP, $this, 'beginMap');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_AFTERINIT, $this, 'handleAfterInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::AFTERINIT, $this, 'handleAfterInit');
|
||||
|
||||
// Init settings
|
||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_SKIP_MAP_ON_LEAVE, true);
|
||||
|
@ -5,6 +5,7 @@ namespace ManiaControl\Players;
|
||||
use ManiaControl\Admin\AdminLists;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Callbacks\Callbacks;
|
||||
use ManiaControl\Callbacks\TimerListener;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Statistics\StatisticManager;
|
||||
@ -66,7 +67,7 @@ class PlayerManager implements CallbackListener, TimerListener {
|
||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_JOIN_LEAVE_MESSAGES, true);
|
||||
|
||||
// Register for callbacks
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'onInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'onInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERCONNECT, $this, 'playerConnect');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERDISCONNECT, $this, 'playerDisconnect');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERINFOCHANGED, $this, 'playerInfoChanged');
|
||||
|
@ -32,7 +32,7 @@ class RankingManager implements CallbackListener {
|
||||
//Register Callbacks
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_MODESCRIPTCALLBACK, $this, 'handleCallbacks');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_MODESCRIPTCALLBACKARRAY, $this, 'handleCallbacks');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'onInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'onInit');
|
||||
//TODO won message at end of the map (disable as setting) (and public announce only all %50 (setting) players)
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace ManiaControl\Server;
|
||||
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Callbacks\Callbacks;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Players\Player;
|
||||
use ManiaControl\Utils\CommandLineHelper;
|
||||
@ -61,7 +61,7 @@ class Server implements CallbackListener {
|
||||
$this->scriptManager = new ScriptManager($maniaControl);
|
||||
|
||||
// Register for callbacks
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'onInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'onInit');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7,7 +7,7 @@ use FML\Controls\Quads\Quad_Icons128x32_1;
|
||||
use FML\Controls\Quads\Quad_Icons64x64_1;
|
||||
use ManiaControl\Admin\AuthenticationManager;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Callbacks\Callbacks;
|
||||
use ManiaControl\Callbacks\TimerListener;
|
||||
use ManiaControl\Commands\CommandListener;
|
||||
use ManiaControl\ManiaControl;
|
||||
@ -55,7 +55,7 @@ class ServerCommands implements CallbackListener, CommandListener, ManialinkPage
|
||||
|
||||
// Register for callbacks
|
||||
$this->maniaControl->timerManager->registerTimerListening($this, 'each5Seconds', 5000);
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'handleOnInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'handleOnInit');
|
||||
|
||||
// Register for commands
|
||||
$this->maniaControl->commandManager->registerCommandListener('setservername', $this, 'command_SetServerName', true, 'Sets the ServerName.');
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace ManiaControl\Settings;
|
||||
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Callbacks\Callbacks;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Plugins\PluginManager;
|
||||
use ManiaControl\Utils\ClassUtil;
|
||||
@ -39,7 +39,7 @@ class SettingManager implements CallbackListener {
|
||||
$this->maniaControl = $maniaControl;
|
||||
$this->initTables();
|
||||
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_AFTERINIT, $this, 'handleAfterInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::AFTERINIT, $this, 'handleAfterInit');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,6 +13,7 @@ use FML\Controls\Quads\Quad_UIConstruction_Buttons;
|
||||
use FML\ManiaLink;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Callbacks\Callbacks;
|
||||
use ManiaControl\Commands\CommandListener;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Manialinks\ManialinkManager;
|
||||
@ -51,7 +52,7 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
|
||||
$this->maniaControl = $maniaControl;
|
||||
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERMANIALINKPAGEANSWER, $this, 'handleManialinkPageAnswer');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'handleOnInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'handleOnInit');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4,6 +4,7 @@ namespace ManiaControl\Statistics;
|
||||
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Callbacks\Callbacks;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Players\Player;
|
||||
use ManiaControl\Players\PlayerManager;
|
||||
@ -68,7 +69,7 @@ class StatisticCollector implements CallbackListener {
|
||||
//Register Callbacks
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_MODESCRIPTCALLBACK, $this, 'handleCallbacks');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_MODESCRIPTCALLBACKARRAY, $this, 'handleCallbacks');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'onInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'onInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERDISCONNECT, $this, 'onPlayerDisconnect');
|
||||
|
||||
//Initialize Settings
|
||||
|
@ -23,7 +23,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const SETTING_ENABLEUPDATECHECK = 'Enable Automatic Core Update Check';
|
||||
const SETTING_ENABLE_UPDATECHECK = 'Enable Automatic Core Update Check';
|
||||
const SETTING_UPDATECHECK_INTERVAL = 'Core Update Check Interval (Hours)';
|
||||
const SETTING_UPDATECHECK_CHANNEL = 'Core Update Channel (release, beta, nightly)';
|
||||
const SETTING_PERFORM_BACKUPS = 'Perform Backup before Updating';
|
||||
@ -58,7 +58,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
|
||||
$this->maniaControl = $maniaControl;
|
||||
|
||||
// Init settings
|
||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_ENABLEUPDATECHECK, true);
|
||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_ENABLE_UPDATECHECK, true);
|
||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_AUTO_UPDATE, true);
|
||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_UPDATECHECK_INTERVAL, 1);
|
||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_UPDATECHECK_CHANNEL, $this->getUpdateChannels());
|
||||
@ -98,7 +98,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
|
||||
* @param float $time
|
||||
*/
|
||||
public function hourlyUpdateCheck($time) {
|
||||
$updateCheckEnabled = $this->maniaControl->settingManager->getSettingValue($this, self::SETTING_ENABLEUPDATECHECK);
|
||||
$updateCheckEnabled = $this->maniaControl->settingManager->getSettingValue($this, self::SETTING_ENABLE_UPDATECHECK);
|
||||
if (!$updateCheckEnabled) {
|
||||
$this->setCoreUpdateData();
|
||||
return;
|
||||
|
@ -125,7 +125,7 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
|
||||
// Register for callbacks
|
||||
$this->maniaControl->timerManager->registerTimerListening($this, 'handle1Second', 1000);
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_AFTERINIT, $this, 'handleAfterInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::AFTERINIT, $this, 'handleAfterInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::BEGINMAP, $this, 'handleMapBegin');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_TM_PLAYERFINISH, $this, 'handlePlayerFinish');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERCONNECT, $this, 'handlePlayerConnect');
|
||||
|
@ -81,7 +81,7 @@ class EndurancePlugin implements CallbackListener, Plugin {
|
||||
$this->maniaControl = $maniaControl;
|
||||
|
||||
// Register for callbacks
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'callback_OnInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'callback_OnInit');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::BEGINMAP, $this, 'callback_BeginMap');
|
||||
$this->maniaControl->callbackManager->registerScriptCallbackListener(self::CB_CHECKPOINT, $this, 'callback_Checkpoint');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user