mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-02-07 01:54:19 +01:00
- fixed shutdown crash
- fixed makefile for linux --HG-- branch : sourcemm-1.6.0 extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/branches/sourcemm-1.6.0%40440
This commit is contained in:
parent
73f5615aa3
commit
337e319616
@ -53,7 +53,7 @@ all:
|
|||||||
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so
|
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so
|
||||||
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so
|
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so
|
||||||
ln -sf $(SMM_ROOT)/sourcehook/sourcehook.cpp sourcehook.cpp
|
ln -sf $(SMM_ROOT)/sourcehook/sourcehook.cpp sourcehook.cpp
|
||||||
$(MAKE) sourcemm
|
$(MAKE) -f Makefile.ep1 sourcemm
|
||||||
rm -rf $(BINARY)
|
rm -rf $(BINARY)
|
||||||
ln -sf $(BIN_DIR)/$(BINARY) $(BINARY)
|
ln -sf $(BIN_DIR)/$(BINARY) $(BINARY)
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ sourcemm: $(OBJ_LINUX)
|
|||||||
$(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
$(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
$(MAKE) all DEBUG=true
|
$(MAKE) -f Makefile.ep1 all DEBUG=true
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
|
@ -80,6 +80,37 @@ void SMConVarAccessor::MarkCommandsAsGameDLL()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SMConVarAccessor::UnregisterGameDLLCommands()
|
||||||
|
{
|
||||||
|
ConCommandBase *begin = icvar->GetCommands();
|
||||||
|
ConCommandBase *iter = begin;
|
||||||
|
ConCommandBase *prev = NULL;
|
||||||
|
while (iter)
|
||||||
|
{
|
||||||
|
/* Watch out for the ETERNAL COMMAND! */
|
||||||
|
if (iter != &s_EternalCommand && iter->IsBitSet(FCVAR_GAMEDLL))
|
||||||
|
{
|
||||||
|
/* Remove it! */
|
||||||
|
if (iter == begin)
|
||||||
|
{
|
||||||
|
s_EternalCommand.BringToFront();
|
||||||
|
iter = const_cast<ConCommandBase*>(iter->GetNext());
|
||||||
|
s_EternalCommand.SetNext(iter);
|
||||||
|
prev = &s_EternalCommand;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iter = const_cast<ConCommandBase*>(iter->GetNext());
|
||||||
|
prev->SetNext(iter);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
prev = iter;
|
||||||
|
iter = const_cast<ConCommandBase*>(iter->GetNext());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SMConVarAccessor::Unregister(ConCommandBase *pCommand)
|
void SMConVarAccessor::Unregister(ConCommandBase *pCommand)
|
||||||
{
|
{
|
||||||
ConCommandBase *ptr = icvar->GetCommands();
|
ConCommandBase *ptr = icvar->GetCommands();
|
||||||
|
@ -85,6 +85,12 @@ void BaseProvider::Notify_DLLInit_Pre(void *gamedll,
|
|||||||
ConCommandBaseMgr::OneTimeInit(&g_SMConVarAccessor);
|
ConCommandBaseMgr::OneTimeInit(&g_SMConVarAccessor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BaseProvider::Notify_DLLShutdown_Pre()
|
||||||
|
{
|
||||||
|
g_SMConVarAccessor.MarkCommandsAsGameDLL();
|
||||||
|
g_SMConVarAccessor.UnregisterGameDLLCommands();
|
||||||
|
}
|
||||||
|
|
||||||
bool BaseProvider::IsRemotePrintingAvailable()
|
bool BaseProvider::IsRemotePrintingAvailable()
|
||||||
{
|
{
|
||||||
return (echo_msg_func != NULL);
|
return (echo_msg_func != NULL);
|
||||||
|
@ -28,6 +28,7 @@ public:
|
|||||||
virtual void Notify_DLLInit_Pre(void *gamedll,
|
virtual void Notify_DLLInit_Pre(void *gamedll,
|
||||||
CreateInterfaceFn engineFactory,
|
CreateInterfaceFn engineFactory,
|
||||||
CreateInterfaceFn serverFactory);
|
CreateInterfaceFn serverFactory);
|
||||||
|
void Notify_DLLShutdown_Pre();
|
||||||
virtual void ServerCommand(const char *cmd);
|
virtual void ServerCommand(const char *cmd);
|
||||||
virtual ConVar *CreateConVar(const char *name,
|
virtual ConVar *CreateConVar(const char *name,
|
||||||
const char *defval,
|
const char *defval,
|
||||||
|
@ -54,7 +54,6 @@ struct game_dll_t
|
|||||||
CreateInterfaceFn factory;
|
CreateInterfaceFn factory;
|
||||||
};
|
};
|
||||||
|
|
||||||
SourceHook::CallClass<IServerGameDLL> *g_GameDllPatch;
|
|
||||||
String mod_path;
|
String mod_path;
|
||||||
String metamod_path;
|
String metamod_path;
|
||||||
String full_bin_path;
|
String full_bin_path;
|
||||||
@ -662,8 +661,6 @@ bool Handler_DLLInit(CreateInterfaceFn engineFactory, CreateInterfaceFn physicsF
|
|||||||
physics_factory = physicsFactory;
|
physics_factory = physicsFactory;
|
||||||
gpGlobals = pGlobals;
|
gpGlobals = pGlobals;
|
||||||
|
|
||||||
g_GameDllPatch = SH_GET_CALLCLASS(server);
|
|
||||||
|
|
||||||
provider->Notify_DLLInit_Pre(server, engineFactory, gamedll_info.factory);
|
provider->Notify_DLLInit_Pre(server, engineFactory, gamedll_info.factory);
|
||||||
|
|
||||||
metamod_version = provider->CreateConVar("metamod_version",
|
metamod_version = provider->CreateConVar("metamod_version",
|
||||||
@ -724,10 +721,9 @@ void Handler_DLLShutdown()
|
|||||||
/* Unload plugins */
|
/* Unload plugins */
|
||||||
g_PluginMngr.UnloadAll();
|
g_PluginMngr.UnloadAll();
|
||||||
|
|
||||||
SH_CALL(g_GameDllPatch, &IServerGameDLL::DLLShutdown)();
|
provider->Notify_DLLShutdown_Pre();
|
||||||
|
|
||||||
SH_RELEASE_CALLCLASS(g_GameDllPatch);
|
SH_CALL(server, &IServerGameDLL::DLLShutdown)();
|
||||||
g_GameDllPatch = NULL;
|
|
||||||
|
|
||||||
g_SourceHook.CompleteShutdown();
|
g_SourceHook.CompleteShutdown();
|
||||||
|
|
||||||
|
@ -163,6 +163,8 @@ namespace SourceMM
|
|||||||
CreateInterfaceFn engineFactory,
|
CreateInterfaceFn engineFactory,
|
||||||
CreateInterfaceFn serverFactory) =0;
|
CreateInterfaceFn serverFactory) =0;
|
||||||
|
|
||||||
|
virtual void Notify_DLLShutdown_Pre() =0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Wrapper around IVEngineServer::ServerCommand()
|
* @brief Wrapper around IVEngineServer::ServerCommand()
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user