mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-12-08 10:58:31 +00:00
fixed a shutdown crash bug, updated makefile for linux
--HG-- branch : sourcemm-1.6.0 extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/branches/sourcemm-1.6.0%40438
This commit is contained in:
parent
4b9abfe0af
commit
de6a163784
@ -16,9 +16,10 @@ BINARY = server_i486.so
|
|||||||
HL2PUB = $(HL2SDK)/public
|
HL2PUB = $(HL2SDK)/public
|
||||||
HL2LIB = $(HL2SDK)/linux_sdk
|
HL2LIB = $(HL2SDK)/linux_sdk
|
||||||
|
|
||||||
OBJECTS = oslink.cpp metamod_util.cpp metamod.cpp
|
OBJECTS = metamod.cpp metamod_util.cpp metamod_console.cpp metamod_oslink.cpp metamod_plugins.cpp \
|
||||||
|
sourcehook.cpp episode1/console.cpp episode1/provider_ep1.cpp
|
||||||
|
|
||||||
LINK = -static-libgcc
|
LINK = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so -static-libgcc
|
||||||
|
|
||||||
INCLUDE = -I. -I$(HL2PUB) -I$(HL2PUB)/dlls -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
INCLUDE = -I. -I$(HL2PUB) -I$(HL2PUB)/dlls -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
||||||
-I$(HL2PUB)/vstdlib -I$(HL2SDK)/tier1 -I$(SMM_ROOT) -I$(SMM_ROOT)/sourcehook
|
-I$(HL2PUB)/vstdlib -I$(HL2SDK)/tier1 -I$(SMM_ROOT) -I$(SMM_ROOT)/sourcehook
|
||||||
@ -33,7 +34,9 @@ endif
|
|||||||
|
|
||||||
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
||||||
|
|
||||||
CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Wno-non-virtual-dtor -Werror -fPIC -fno-exceptions -fno-rtti -msse
|
CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp \
|
||||||
|
-Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca \
|
||||||
|
-Dstrcmpi=strcasecmp -Wall -Wno-non-virtual-dtor -Werror -fPIC -fno-exceptions -fno-rtti -msse
|
||||||
|
|
||||||
ifeq "$(GCC_VERSION)" "4"
|
ifeq "$(GCC_VERSION)" "4"
|
||||||
CFLAGS += $(GCC4_FLAGS)
|
CFLAGS += $(GCC4_FLAGS)
|
||||||
@ -46,6 +49,9 @@ $(BIN_DIR)/%.o: %.cpp
|
|||||||
|
|
||||||
all:
|
all:
|
||||||
mkdir -p $(BIN_DIR)
|
mkdir -p $(BIN_DIR)
|
||||||
|
mkdir -p $(BIN_DIR)/episode1
|
||||||
|
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_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) sourcemm
|
||||||
rm -rf $(BINARY)
|
rm -rf $(BINARY)
|
||||||
@ -60,7 +66,10 @@ debug:
|
|||||||
default: all
|
default: all
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
rm -rf Release/episode1/*.o
|
||||||
rm -rf Release/*.o
|
rm -rf Release/*.o
|
||||||
rm -rf Release/$(BINARY)
|
rm -rf Release/$(BINARY)
|
||||||
|
rm -rf Debug/episode1/*.o
|
||||||
rm -rf Debug/*.o
|
rm -rf Debug/*.o
|
||||||
rm -rf Debug/$(BINARY)
|
rm -rf Debug/$(BINARY)
|
||||||
|
|
||||||
|
|||||||
@ -1154,11 +1154,16 @@ void MetamodSource::UnregisterConCmdBase(ISmmPlugin *plugin, ConCommandBase *pCo
|
|||||||
g_PluginMngr.RemovePluginCvar(plugin, pCommand);
|
g_PluginMngr.RemovePluginCvar(plugin, pCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CPluginManager::CPlugin *pOrig = g_PluginMngr.FindByAPI(plugin);
|
||||||
|
UnregisterConCommandBase(pOrig ? pOrig->m_Id : 0, pCommand);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MetamodSource::UnregisterConCommandBase(PluginId id, ConCommandBase *pCommand)
|
||||||
|
{
|
||||||
PluginIter iter;
|
PluginIter iter;
|
||||||
CPluginManager::CPlugin *pPlugin;
|
CPluginManager::CPlugin *pPlugin;
|
||||||
List<IMetamodListener *>::iterator event;
|
List<IMetamodListener *>::iterator event;
|
||||||
IMetamodListener *pML;
|
IMetamodListener *pML;
|
||||||
CPluginManager::CPlugin *pOrig = g_PluginMngr.FindByAPI(plugin);
|
|
||||||
for (iter=g_PluginMngr._begin(); iter!=g_PluginMngr._end(); iter++)
|
for (iter=g_PluginMngr._begin(); iter!=g_PluginMngr._end(); iter++)
|
||||||
{
|
{
|
||||||
pPlugin = (*iter);
|
pPlugin = (*iter);
|
||||||
@ -1176,7 +1181,7 @@ void MetamodSource::UnregisterConCmdBase(ISmmPlugin *plugin, ConCommandBase *pCo
|
|||||||
event++)
|
event++)
|
||||||
{
|
{
|
||||||
pML = (*event);
|
pML = (*event);
|
||||||
pML->OnUnlinkConCommandBase(pOrig ? pOrig->m_Id : 0, pCommand);
|
pML->OnUnlinkConCommandBase(id, pCommand);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -74,6 +74,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
const char *GetGameBinaryPath();
|
const char *GetGameBinaryPath();
|
||||||
const char *GetPluginsFile();
|
const char *GetPluginsFile();
|
||||||
|
void UnregisterConCommandBase(PluginId id, ConCommandBase *pCommand);
|
||||||
};
|
};
|
||||||
|
|
||||||
void LogMessage(const char *msg, ...);
|
void LogMessage(const char *msg, ...);
|
||||||
|
|||||||
@ -489,6 +489,8 @@ bool CPluginManager::_Unload(CPluginManager::CPlugin *pl, bool force, char *erro
|
|||||||
//Make sure to detach it from sourcehook!
|
//Make sure to detach it from sourcehook!
|
||||||
g_SourceHook.UnloadPlugin(pl->m_Id);
|
g_SourceHook.UnloadPlugin(pl->m_Id);
|
||||||
|
|
||||||
|
pl->m_Events.clear();
|
||||||
|
|
||||||
UnregAllConCmds(pl);
|
UnregAllConCmds(pl);
|
||||||
|
|
||||||
//Clean up the DLL
|
//Clean up the DLL
|
||||||
@ -710,22 +712,19 @@ void CPluginManager::RemovePluginCmd(ISmmPlugin *api, ConCommandBase *pCmd)
|
|||||||
|
|
||||||
void CPluginManager::UnregAllConCmds(CPlugin *pl)
|
void CPluginManager::UnregAllConCmds(CPlugin *pl)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
SourceHook::List<ConCommandBase *>::iterator i;
|
SourceHook::List<ConCommandBase *>::iterator i;
|
||||||
|
|
||||||
/* :TODO: */
|
/* :TODO: */
|
||||||
for (i=pl->m_Cvars.begin(); i!=pl->m_Cvars.end(); i++)
|
for (i=pl->m_Cvars.begin(); i!=pl->m_Cvars.end(); i++)
|
||||||
{
|
{
|
||||||
g_SMConVarAccessor.Unregister(pl->m_Id, (*i) );
|
g_Metamod.UnregisterConCommandBase(pl->m_Id, (*i) );
|
||||||
}
|
}
|
||||||
|
|
||||||
pl->m_Cvars.clear();
|
pl->m_Cvars.clear();
|
||||||
|
|
||||||
for (i=pl->m_Cmds.begin(); i!=pl->m_Cmds.end(); i++)
|
for (i=pl->m_Cmds.begin(); i!=pl->m_Cmds.end(); i++)
|
||||||
{
|
{
|
||||||
g_SMConVarAccessor.Unregister(pl->m_Id, (*i) );
|
g_Metamod.UnregisterConCommandBase(pl->m_Id, (*i) );
|
||||||
|
}
|
||||||
|
pl->m_Cmds.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
pl->m_Cmds.clear();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user