maniaControl = $maniaControl; $this->maniaControl->getCallbackManager()->registerCallbackListener(SettingManager::CB_SETTING_CHANGED, $this, 'updateSettings'); $this->changeManiacontrolSettings(); } private function changeManiacontrolSettings() { $settingstochange = [ AuthenticationManager::class => [ MapQueue::SETTING_PERMISSION_ADD_TO_QUEUE => AuthenticationManager::AUTH_NAME_ADMIN ], UpdateManager::class => [ UpdateManager::SETTING_ENABLE_UPDATECHECK => false ], UsageReporter::class => [ UsageReporter::SETTING_REPORT_USAGE => false ], MapManager::class => [ MapManager::SETTING_AUTOSAVE_MAPLIST => false, MapManager::SETTING_ENABLE_MX => false ], PlayerManager::class => [ PlayerManager::SETTING_VERSION_JOIN_MESSAGE => false ], PluginMenu::class => [ PluginMenu::SETTING_CHECK_UPDATE_WHEN_OPENING => false ], Configurator::class => [ Configurator::SETTING_MENU_HEIGHT => 120, Configurator::SETTING_MENU_WIDTH => 220, ], StyleManager::class => [ StyleManager::SETTING_LIST_WIDGETS_HEIGHT => 120, StyleManager::SETTING_LIST_WIDGETS_WIDTH => 220, StyleManager::SETTING_LABEL_DEFAULT_STYLE => "TextClock", StyleManager::SETTING_QUAD_DEFAULT_STYLE => Quad_BgsPlayerCard::STYLE, StyleManager::SETTING_QUAD_DEFAULT_SUBSTYLE => Quad_BgsPlayerCard::SUBSTYLE_BgPlayerName ] ]; foreach ($settingstochange as $classname => $settings) { foreach ($settings as $settingname => $value) { $setting = $this->maniaControl->getSettingManager()->getSettingObject($classname, $settingname); $setting->value = $value; $this->maniaControl->getSettingManager()->saveSetting($setting); } } // Disable all votes $this->maniaControl->getClient()->setCallVoteRatios([ new VoteRatio(VoteRatio::COMMAND_DEFAULT, -1.), new VoteRatio(VoteRatio::COMMAND_SCRIPT_SETTINGS, -1.), new VoteRatio(VoteRatio::COMMAND_JUMP_MAP, -1.), new VoteRatio(VoteRatio::COMMAND_SET_NEXT_MAP, -1.), new VoteRatio(VoteRatio::COMMAND_KICK, -1.), new VoteRatio(VoteRatio::COMMAND_RESTART_MAP, -1.), new VoteRatio(VoteRatio::COMMAND_TEAM_BALANCE, -1.), new VoteRatio(VoteRatio::COMMAND_NEXT_MAP, -1.), new VoteRatio(VoteRatio::COMMAND_BAN, -1.) ]); } public function updateSettings(Setting $setting = null) { if ($setting !== null && $setting->belongsToClass($this)) { $this->changeManiacontrolSettings(); } } /** * Unload the plugin and its Resources */ public function unload() { } }