mirror of
https://github.com/rehlds/metamod-r.git
synced 2025-03-03 17:15:26 +03:00
UNDONE: Gracefully shutdown metamod plugins for dedicated server (amxx modules unload unstable)
This commit is contained in:
parent
265a818856
commit
096f4383b0
@ -16,7 +16,8 @@ NEW_DLL_FUNCTIONS *pHookedNewDllFunctions = &sNewFunctionTable;
|
||||
void MM_POST_HOOK EXT_FUNC mm_GameShutdown()
|
||||
{
|
||||
g_metamod_active = false;
|
||||
if (g_plugins) g_plugins->unload_all();
|
||||
if (g_plugins && !g_dedicated_server) g_plugins->unload_all();
|
||||
|
||||
g_meta_extdll.unload();
|
||||
g_GameDLL.sys_module.unload();
|
||||
g_engine.sys_module.unload();
|
||||
|
@ -35,6 +35,7 @@ unsigned int g_CALL_API_count = 0;
|
||||
int g_requestid_counter = 0;
|
||||
|
||||
bool g_metamod_active = false;
|
||||
bool g_dedicated_server = false;
|
||||
|
||||
// Very first metamod function that's run.
|
||||
// Do startup operations...
|
||||
@ -166,6 +167,7 @@ void metamod_startup()
|
||||
g_engine.pl_funcs.pfnCVarRegister = meta_CVarRegister;
|
||||
g_engine.pl_funcs.pfnCvar_RegisterVariable = meta_CVarRegister;
|
||||
g_engine.pl_funcs.pfnRegUserMsg = meta_RegUserMsg;
|
||||
g_dedicated_server = g_engine.pl_funcs.pfnIsDedicatedServer() ? true : false;
|
||||
|
||||
if (g_engine.pl_funcs.pfnQueryClientCvarValue)
|
||||
g_engine.pl_funcs.pfnQueryClientCvarValue = meta_QueryClientCvarValue;
|
||||
|
@ -78,6 +78,7 @@ extern unsigned int g_CALL_API_count;
|
||||
extern int g_requestid_counter;
|
||||
|
||||
extern bool g_metamod_active;
|
||||
extern bool g_dedicated_server;
|
||||
|
||||
// (patch by BAILOPAN)
|
||||
// Holds cached player info, right now only things for querying cvars
|
||||
|
Loading…
x
Reference in New Issue
Block a user