From 8172560f39dc942b0c494313685d58a09788b557 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 22 Oct 2007 05:53:38 +0000 Subject: [PATCH] - added "war mode" options to config menu cfg - fixed a regression bug where OnConfigsExecuted() wouldn't get executed. oops! --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401637 --- configs/adminmenu_cfgs.txt | 3 ++- configs/cfg/sm_warmode_off.cfg | 4 ++++ configs/cfg/sm_warmode_on.cfg | 9 +++++++++ core/systems/PluginSys.cpp | 6 ++---- 4 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 configs/cfg/sm_warmode_off.cfg create mode 100644 configs/cfg/sm_warmode_on.cfg diff --git a/configs/adminmenu_cfgs.txt b/configs/adminmenu_cfgs.txt index a3fef38e..644c6d71 100644 --- a/configs/adminmenu_cfgs.txt +++ b/configs/adminmenu_cfgs.txt @@ -5,5 +5,6 @@ Configs { "cfg/server.cfg" "Standard Server Setup" - "cfg/sourcemod/sourcemod.cfg" "SourceMod Settings" + "cfg/sourcemod/sm_warmode_on.cfg" "War Mode On" + "cfg/sourcemod/sm_warmode_off.cfg" "War Mode Off" } diff --git a/configs/cfg/sm_warmode_off.cfg b/configs/cfg/sm_warmode_off.cfg new file mode 100644 index 00000000..278c925a --- /dev/null +++ b/configs/cfg/sm_warmode_off.cfg @@ -0,0 +1,4 @@ +//This file re-enables a server from "war mode" by unlocking plugin loading +//and refreshing the plugins list. +sm plugins load_unlock +sm plugins refresh diff --git a/configs/cfg/sm_warmode_on.cfg b/configs/cfg/sm_warmode_on.cfg new file mode 100644 index 00000000..ebc3c6f6 --- /dev/null +++ b/configs/cfg/sm_warmode_on.cfg @@ -0,0 +1,9 @@ +//This file unloads all plugins, re-loads a few "safe" ones, and then prevents +//any more plugins from being loaded. +sm plugins unload_all +sm plugins load basebans.smx +sm plugins load basecommands.smx +sm plugins load admin-flatfile.smx +sm plugins load adminhelp.smx +sm plugins load adminmenu.smx +sm plugins load_lock diff --git a/core/systems/PluginSys.cpp b/core/systems/PluginSys.cpp index 6ade816e..d8e4e975 100644 --- a/core/systems/PluginSys.cpp +++ b/core/systems/PluginSys.cpp @@ -363,13 +363,11 @@ void CPlugin::Call_OnAllPluginsLoaded() cell_t result; IPluginFunction *pFunction = m_ctx.base->GetFunctionByName("OnAllPluginsLoaded"); - if (!pFunction) + if (pFunction != NULL) { - return; + pFunction->Execute(&result); } - pFunction->Execute(&result); - if (g_OnMapStarted) { if ((pFunction = m_ctx.base->GetFunctionByName("OnMapStart")) != NULL)