diff --git a/amxmodx/CvarManager.cpp b/amxmodx/CvarManager.cpp index 61b1e410..1661eecd 100644 --- a/amxmodx/CvarManager.cpp +++ b/amxmodx/CvarManager.cpp @@ -442,6 +442,11 @@ size_t CvarManager::GetRegCvarsCount() return m_AmxmodxCvars; } +CvarsList* CvarManager::GetCvarsList() +{ + return &m_Cvars; +} + ke::AutoString convertFlagsToString(int flags) { ke::AutoString flagsName; diff --git a/amxmodx/CvarManager.h b/amxmodx/CvarManager.h index 40e3431d..a82ef3bf 100644 --- a/amxmodx/CvarManager.h +++ b/amxmodx/CvarManager.h @@ -153,6 +153,7 @@ class CvarManager void SetCvarMax(CvarInfo* info, bool set, float value, int pluginId); size_t GetRegCvarsCount(); + CvarsList* GetCvarsList(); void OnConsoleCommand(); void OnPluginUnloaded(); diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index bd4883dc..66d85a9e 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -18,8 +18,6 @@ #include "CFlagManager.h" #include "nongpl_matches.h" #include "format.h" -#include -#include "CEvent.h" extern CFlagManager FlagMan; ke::Vector DynamicAdmins; @@ -1915,8 +1913,10 @@ static cell AMX_NATIVE_CALL server_cmd(AMX *amx, cell *params) /* 1 param */ cmd[len++] = '\n'; cmd[len] = 0; - + SERVER_COMMAND(cmd); + + CoreCfg.CheckLegacyBufferedCommand(cmd); return len; } diff --git a/amxmodx/amxmodx.h b/amxmodx/amxmodx.h index c4d8d8fe..e9176dca 100755 --- a/amxmodx/amxmodx.h +++ b/amxmodx/amxmodx.h @@ -50,6 +50,8 @@ #include "fakemeta.h" #include "amxxlog.h" #include "CvarManager.h" +#include "CoreConfig.h" +#include #define AMXXLOG_Log g_log.Log #define AMXXLOG_Error g_log.LogError diff --git a/amxmodx/meta_api.cpp b/amxmodx/meta_api.cpp index cb3279d8..8ff50871 100755 --- a/amxmodx/meta_api.cpp +++ b/amxmodx/meta_api.cpp @@ -31,6 +31,7 @@ #include "CGameConfigs.h" #include #include +#include "CoreConfig.h" plugin_info_t Plugin_info = { @@ -504,6 +505,8 @@ int C_Spawn(edict_t *pent) FF_ClientAuthorized = registerForward("client_authorized", ET_IGNORE, FP_CELL, FP_DONE); FF_ChangeLevel = registerForward("server_changelevel", ET_STOP, FP_STRING, FP_DONE); + CoreCfg.OnAmxxInitialized(); + #if defined BINLOG_ENABLED if (!g_BinLog.Open()) { @@ -628,6 +631,11 @@ void C_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax) executeForwards(FF_PluginInit); executeForwards(FF_PluginCfg); + CoreCfg.ExecuteMainConfig(); // Execute amxx.cfg + CoreCfg.ExecuteAutoConfigs(); // Execute configs created with AutoExecConfig native. + CoreCfg.SetMapConfigTimer(6.1); // Prepare per-map configs to be executed 6.1 seconds later. + // Original value which was used in admin.sma. + // Correct time in Counter-Strike and other mods (except DOD) if (!g_bmod_dod) g_game_timeleft = 0; @@ -692,6 +700,9 @@ void C_ServerDeactivate_Post() modules_callPluginsUnloading(); detachReloadModules(); + + CoreCfg.Clear(); + g_auth.clear(); g_commands.clear(); g_forcemodels.clear(); @@ -1187,6 +1198,8 @@ void C_StartFrame_Post(void) g_task_time = gpGlobals->time + 0.1f; g_tasksMngr.startFrame(); + CoreCfg.OnMapConfigTimer(); + RETURN_META(MRES_IGNORED); }