# HG changeset patch # User Scott Ehlert # Date 1258158356 21600 # Node ID c676a9ce03208c1cc3a1a874ce6a9ebb56c91b8e # Parent 3ec9092c5dc8f1537fbee3a66024ac6e9c72800e Updated stub_mm, sample_mm, and project templates for changes from 1.8 (bug 4107, r=dvander). - Added build configurations for Left 4 Dead 2 and Orange Box Valve. - Now uses MMSOURCE18 as environment variable. - Removed deprecated callclass usage. - Now uses GetVSPInfo() API on old engine build. diff -r 3ec9092c5dc8 -r c676a9ce0320 sample_mm/Makefile --- a/sample_mm/Makefile Mon Nov 02 11:08:56 2009 -0600 +++ b/sample_mm/Makefile Fri Nov 13 18:25:56 2009 -0600 @@ -1,4 +1,4 @@ -# (C)2004-2008 Metamod:Source Development Team +# (C)2004-2009 Metamod:Source Development Team # Makefile written by David "BAILOPAN" Anderson ########################################### @@ -7,8 +7,10 @@ HL2SDK_ORIG = ../../hl2sdk HL2SDK_OB = ../../hl2sdk-ob +HL2SDK_OB_VALVE = ../../hl2sdk-ob-valve HL2SDK_L4D = ../../hl2sdk-l4d -MMSOURCE17 = ../mmsource-1.7 +HL2SDK_L4D2 = ../../hl2sdk-l4d2 +MMSOURCE18 = .. SRCDS_BASE = ~/srcds ##################################### @@ -33,9 +35,10 @@ HL2PUB = $(HL2SDK)/public HL2LIB = $(HL2SDK)/linux_sdk CFLAGS += -DSOURCE_ENGINE=1 - METAMOD = $(MMSOURCE17)/core-legacy + METAMOD = $(MMSOURCE18)/core-legacy INCLUDE += -I$(HL2SDK)/public/dlls SRCDS = $(SRCDS_BASE) + LIB_SUFFIX = i486 override ENGSET = true endif ifeq "$(ENGINE)" "orangebox" @@ -43,25 +46,50 @@ HL2PUB = $(HL2SDK)/public HL2LIB = $(HL2SDK)/lib/linux CFLAGS += -DSOURCE_ENGINE=3 - METAMOD = $(MMSOURCE17)/core + METAMOD = $(MMSOURCE18)/core INCLUDE += -I$(HL2SDK)/public/game/server SRCDS = $(SRCDS_BASE)/orangebox + LIB_SUFFIX = i486 + override ENGSET = true +endif +ifeq "$(ENGINE)" "orangeboxvalve" + HL2SDK = $(HL2SDK_OB_VALVE) + HL2PUB = $(HL2SDK)/public + HL2LIB = $(HL2SDK)/lib/linux + CFLAGS += -DSOURCE_ENGINE=4 + METAMOD = $(MMSOURCE18)/core + INCLUDE += -I$(HL2SDK)/public/game/server + SRCDS = $(SRCDS_BASE)/orangebox + LIB_SUFFIX = i486 override ENGSET = true endif ifeq "$(ENGINE)" "left4dead" HL2SDK = $(HL2SDK_L4D) HL2PUB = $(HL2SDK)/public HL2LIB = $(HL2SDK)/lib/linux - CFLAGS += -DSOURCE_ENGINE=4 - METAMOD = $(MMSOURCE17)/core + CFLAGS += -DSOURCE_ENGINE=5 + METAMOD = $(MMSOURCE18)/core INCLUDE += -I$(HL2SDK)/public/game/server SRCDS = $(SRCDS_BASE)/l4d + LIB_SUFFIX = i486 + override ENGSET = true +endif +ifeq "$(ENGINE)" "left4dead2" + HL2SDK = $(HL2SDK_L4D2) + HL2PUB = $(HL2SDK)/public + HL2LIB = $(HL2SDK)/lib/linux + CFLAGS += -DSOURCE_ENGINE=5 + METAMOD = $(MMSOURCE18)/core + INCLUDE += -I$(HL2SDK)/public/game/server + SRCDS = $(SRCDS_BASE)/left4dead2_demo + LIB_SUFFIX = linux override ENGSET = true endif -CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4 +CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 \ + -DSE_LEFT4DEAD=5 -DSE_LEFT4DEAD2=6 -LINK += $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so -static-libgcc +LINK += $(HL2LIB)/tier1_i486.a vstdlib_$(LIB_SUFFIX).so tier0_$(LIB_SUFFIX).so -static-libgcc INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/vstdlib \ -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I. -I$(METAMOD) -I$(METAMOD)/sourcehook @@ -96,15 +124,14 @@ all: check mkdir -p $(BIN_DIR) - rm -f vstdlib_i486.so - rm -f tier0_i486.so - ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so - ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so + ln -sf $(HL2LIB)/vstdlib_$(LIB_SUFFIX).so + ln -sf $(HL2LIB)/tier0_$(LIB_SUFFIX).so $(MAKE) -f Makefile sample_mm check: if [ "$(ENGSET)" = "false" ]; then \ - echo "You must supply ENGINE=left4dead or ENGINE=orangebox or ENGINE=original"; \ + echo "You must supply one of the following values for ENGINE:"; \ + echo "left4dead2, left4dead, orangeboxvalve or orangebox"; \ exit 1; \ fi diff -r 3ec9092c5dc8 -r c676a9ce0320 sample_mm/engine_wrappers.h --- a/sample_mm/engine_wrappers.h Mon Nov 02 11:08:56 2009 -0600 +++ b/sample_mm/engine_wrappers.h Fri Nov 13 18:25:56 2009 -0600 @@ -1,5 +1,5 @@ /** - * vim: set ts=4 : + * vim: set ts=4 sw=4 tw=99 noet : * ====================================================== * Metamod:Source Sample Plugin * Written by AlliedModders LLC. @@ -10,8 +10,6 @@ * the use of this software. * * This sample plugin is public domain. - * - * Version: $Id$ */ #ifndef _INCLUDE_SOURCE_ENGINE_WRAPPERS_ @@ -26,17 +24,17 @@ #error "Metamod:Source 1.6 API is not supported on the old engine." #endif +#define ENGINE_CALL(func) SH_CALL(engine, &IVEngineServer::func) + /** - * MM:S 1.4.x needs older API calls. + * Wrap some API calls for legacy MM:S. */ #if !defined METAMOD_PLAPI_VERSION #define GetEngineFactory engineFactory #define GetServerFactory serverFactory #define MM_Format snprintf #define GetCGlobals pGlobals -#define ENGINE_CALL(func) SH_CALL(m_EngineCC, func) #else -#define ENGINE_CALL(func) SH_CALL(engine, func) #define MM_Format g_SMAPI->Format #endif diff -r 3ec9092c5dc8 -r c676a9ce0320 sample_mm/msvc8/sample_mm.sln --- a/sample_mm/msvc8/sample_mm.sln Mon Nov 02 11:08:56 2009 -0600 +++ b/sample_mm/msvc8/sample_mm.sln Fri Nov 13 18:25:56 2009 -0600 @@ -6,27 +6,39 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32 + Debug - Left 4 Dead 2|Win32 = Debug - Left 4 Dead 2|Win32 Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32 + Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32 Debug - Orange Box|Win32 = Debug - Orange Box|Win32 Debug - Original|Win32 = Debug - Original|Win32 Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32 + Release - Left 4 Dead 2|Win32 = Release - Left 4 Dead 2|Win32 Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32 + Release - Orange Box Valve|Win32 = Release - Orange Box Valve|Win32 Release - Orange Box|Win32 = Release - Orange Box|Win32 Release - Original|Win32 = Release - Original|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.ActiveCfg = Debug - Dark Messiah|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead 2|Win32.ActiveCfg = Debug - Left 4 Dead 2|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead 2|Win32.Build.0 = Debug - Left 4 Dead 2|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box Valve|Win32.ActiveCfg = Debug - Orange Box Valve|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box Valve|Win32.Build.0 = Debug - Orange Box Valve|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.ActiveCfg = Debug - Original|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.Build.0 = Debug - Original|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.ActiveCfg = Release - Dark Messiah|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead 2|Win32.ActiveCfg = Release - Left 4 Dead 2|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead 2|Win32.Build.0 = Release - Left 4 Dead 2|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box Valve|Win32.ActiveCfg = Release - Orange Box Valve|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box Valve|Win32.Build.0 = Release - Orange Box Valve|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box|Win32.Build.0 = Release - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Original|Win32.ActiveCfg = Release - Original|Win32 diff -r 3ec9092c5dc8 -r c676a9ce0320 sample_mm/msvc8/sample_mm.vcproj --- a/sample_mm/msvc8/sample_mm.vcproj Mon Nov 02 11:08:56 2009 -0600 +++ b/sample_mm/msvc8/sample_mm.vcproj Fri Nov 13 18:25:56 2009 -0600 @@ -39,9 +39,9 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 3ec9092c5dc8 -r c676a9ce0320 sample_mm/msvc9/sample_mm.sln --- a/sample_mm/msvc9/sample_mm.sln Mon Nov 02 11:08:56 2009 -0600 +++ b/sample_mm/msvc9/sample_mm.sln Fri Nov 13 18:25:56 2009 -0600 @@ -6,27 +6,39 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32 + Debug - Left 4 Dead 2|Win32 = Debug - Left 4 Dead 2|Win32 Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32 + Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32 Debug - Orange Box|Win32 = Debug - Orange Box|Win32 Debug - Original|Win32 = Debug - Original|Win32 Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32 + Release - Left 4 Dead 2|Win32 = Release - Left 4 Dead 2|Win32 Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32 + Release - Orange Box Valve|Win32 = Release - Orange Box Valve|Win32 Release - Orange Box|Win32 = Release - Orange Box|Win32 Release - Original|Win32 = Release - Original|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.ActiveCfg = Debug - Dark Messiah|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead 2|Win32.ActiveCfg = Debug - Left 4 Dead 2|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead 2|Win32.Build.0 = Debug - Left 4 Dead 2|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box Valve|Win32.ActiveCfg = Debug - Orange Box Valve|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box Valve|Win32.Build.0 = Debug - Orange Box Valve|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.ActiveCfg = Debug - Original|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.Build.0 = Debug - Original|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.ActiveCfg = Release - Dark Messiah|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead 2|Win32.ActiveCfg = Release - Left 4 Dead 2|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead 2|Win32.Build.0 = Release - Left 4 Dead 2|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box Valve|Win32.ActiveCfg = Release - Orange Box Valve|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box Valve|Win32.Build.0 = Release - Orange Box Valve|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box|Win32.Build.0 = Release - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Original|Win32.ActiveCfg = Release - Original|Win32 diff -r 3ec9092c5dc8 -r c676a9ce0320 sample_mm/msvc9/sample_mm.vcproj --- a/sample_mm/msvc9/sample_mm.vcproj Mon Nov 02 11:08:56 2009 -0600 +++ b/sample_mm/msvc9/sample_mm.vcproj Fri Nov 13 18:25:56 2009 -0600 @@ -40,9 +40,9 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 3ec9092c5dc8 -r c676a9ce0320 sample_mm/sample_mm.cpp --- a/sample_mm/sample_mm.cpp Mon Nov 02 11:08:56 2009 -0600 +++ b/sample_mm/sample_mm.cpp Fri Nov 13 18:25:56 2009 -0600 @@ -1,5 +1,5 @@ /** - * vim: set ts=4 : + * vim: set ts=4 sw=4 tw=99 noet : * ====================================================== * Metamod:Source Sample Plugin * Written by AlliedModders LLC. @@ -10,8 +10,6 @@ * the use of this software. * * This sample plugin is public domain. - * - * Version: $Id$ */ #include @@ -80,9 +78,7 @@ META_LOG(g_PLAPI, "Starting plugin."); /* Load the VSP listener. This is usually needed for IServerPluginHelpers. */ -#if defined METAMOD_PLAPI_VERSION if ((vsp_callbacks = ismm->GetVSPInfo(NULL)) == NULL) -#endif { ismm->AddListener(this, this); ismm->EnableVSPListener(); @@ -100,11 +96,7 @@ SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientConnect, gameclients, this, &SamplePlugin::Hook_ClientConnect, false); SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientCommand, gameclients, this, &SamplePlugin::Hook_ClientCommand, false); -#if !defined METAMOD_PLAPI_VERSION - m_EngineCC = SH_GET_CALLCLASS(engine); -#endif - - ENGINE_CALL(&IVEngineServer::LogPrint)("All hooks started!\n"); + ENGINE_CALL(LogPrint)("All hooks started!\n"); #if SOURCE_ENGINE >= SE_ORANGEBOX g_pCVar = icvar; @@ -130,10 +122,6 @@ SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientConnect, gameclients, this, &SamplePlugin::Hook_ClientConnect, false); SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientCommand, gameclients, this, &SamplePlugin::Hook_ClientCommand, false); -#if !defined METAMOD_PLAPI_VERSION - SH_RELEASE_CALLCLASS(m_EngineCC); -#endif - return true; } diff -r 3ec9092c5dc8 -r c676a9ce0320 sample_mm/sample_mm.h --- a/sample_mm/sample_mm.h Mon Nov 02 11:08:56 2009 -0600 +++ b/sample_mm/sample_mm.h Fri Nov 13 18:25:56 2009 -0600 @@ -1,5 +1,5 @@ /** - * vim: set ts=4 : + * vim: set ts=4 sw=4 tw=99 noet : * ====================================================== * Metamod:Source Sample Plugin * Written by AlliedModders LLC. @@ -10,8 +10,6 @@ * the use of this software. * * This sample plugin is public domain. - * - * Version: $Id$ */ #ifndef _INCLUDE_METAMOD_SOURCE_STUB_PLUGIN_H_ @@ -71,10 +69,6 @@ const char *GetVersion(); const char *GetDate(); const char *GetLogTag(); -private: -#if !defined METAMOD_PLAPI_VERSION - SourceHook::CallClass *m_EngineCC; -#endif }; extern SamplePlugin g_SamplePlugin; diff -r 3ec9092c5dc8 -r c676a9ce0320 stub_mm/Makefile --- a/stub_mm/Makefile Mon Nov 02 11:08:56 2009 -0600 +++ b/stub_mm/Makefile Fri Nov 13 18:25:56 2009 -0600 @@ -1,4 +1,4 @@ -# (C)2004-2008 Metamod:Source Development Team +# (C)2004-2009 Metamod:Source Development Team # Makefile written by David "BAILOPAN" Anderson ########################################### @@ -7,8 +7,10 @@ HL2SDK_ORIG = ../../hl2sdk HL2SDK_OB = ../../hl2sdk-ob +HL2SDK_OB_VALVE = ../../hl2sdk-ob-valve HL2SDK_L4D = ../../hl2sdk-l4d -MMSOURCE17 = ../mmsource-1.7 +HL2SDK_L4D2 = ../../hl2sdk-l4d2 +MMSOURCE18 = .. SRCDS_BASE = ~/srcds ##################################### @@ -33,9 +35,10 @@ HL2PUB = $(HL2SDK)/public HL2LIB = $(HL2SDK)/linux_sdk CFLAGS += -DSOURCE_ENGINE=1 - METAMOD = $(MMSOURCE17)/core-legacy + METAMOD = $(MMSOURCE18)/core-legacy INCLUDE += -I$(HL2SDK)/public/dlls SRCDS = $(SRCDS_BASE) + LIB_SUFFIX = i486 override ENGSET = true endif ifeq "$(ENGINE)" "orangebox" @@ -43,29 +46,54 @@ HL2PUB = $(HL2SDK)/public HL2LIB = $(HL2SDK)/lib/linux CFLAGS += -DSOURCE_ENGINE=3 - METAMOD = $(MMSOURCE17)/core + METAMOD = $(MMSOURCE18)/core INCLUDE += -I$(HL2SDK)/public/game/server SRCDS = $(SRCDS_BASE)/orangebox + LIB_SUFFIX = i486 + override ENGSET = true +endif +ifeq "$(ENGINE)" "orangeboxvalve" + HL2SDK = $(HL2SDK_OB_VALVE) + HL2PUB = $(HL2SDK)/public + HL2LIB = $(HL2SDK)/lib/linux + CFLAGS += -DSOURCE_ENGINE=4 + METAMOD = $(MMSOURCE18)/core + INCLUDE += -I$(HL2SDK)/public/game/server + SRCDS = $(SRCDS_BASE)/orangebox + LIB_SUFFIX = i486 override ENGSET = true endif ifeq "$(ENGINE)" "left4dead" HL2SDK = $(HL2SDK_L4D) HL2PUB = $(HL2SDK)/public HL2LIB = $(HL2SDK)/lib/linux - CFLAGS += -DSOURCE_ENGINE=4 - METAMOD = $(MMSOURCE17)/core + CFLAGS += -DSOURCE_ENGINE=5 + METAMOD = $(MMSOURCE18)/core INCLUDE += -I$(HL2SDK)/public/game/server SRCDS = $(SRCDS_BASE)/l4d + LIB_SUFFIX = i486 + override ENGSET = true +endif +ifeq "$(ENGINE)" "left4dead2" + HL2SDK = $(HL2SDK_L4D2) + HL2PUB = $(HL2SDK)/public + HL2LIB = $(HL2SDK)/lib/linux + CFLAGS += -DSOURCE_ENGINE=6 + METAMOD = $(MMSOURCE18)/core + INCLUDE += -I$(HL2SDK)/public/game/server + SRCDS = $(SRCDS_BASE)/left4dead2_demo + LIB_SUFFIX = linux override ENGSET = true endif -CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4 +CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 \ + -DSE_LEFT4DEAD=5 -DSE_LEFT4DEAD2=6 -LINK += $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so -static-libgcc +LINK += $(HL2LIB)/tier1_i486.a vstdlib_$(LIB_SUFFIX).so tier0_$(LIB_SUFFIX).so -static-libgcc INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/vstdlib \ -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I. -I$(METAMOD) -I$(METAMOD)/sourcehook - + ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### ################################################ @@ -96,15 +124,14 @@ all: check mkdir -p $(BIN_DIR) - rm -f vstdlib_i486.so - rm -f tier0_i486.so - ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so - ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so + ln -sf $(HL2LIB)/vstdlib_$(LIB_SUFFIX).so + ln -sf $(HL2LIB)/tier0_$(LIB_SUFFIX).so $(MAKE) -f Makefile stub_mm check: if [ "$(ENGSET)" = "false" ]; then \ - echo "You must supply ENGINE=left4dead or ENGINE=orangebox or ENGINE=original"; \ + echo "You must supply one of the following values for ENGINE:"; \ + echo "left4dead2, left4dead, orangeboxvalve or orangebox"; \ exit 1; \ fi diff -r 3ec9092c5dc8 -r c676a9ce0320 stub_mm/msvc8/stub_mm.sln --- a/stub_mm/msvc8/stub_mm.sln Mon Nov 02 11:08:56 2009 -0600 +++ b/stub_mm/msvc8/stub_mm.sln Fri Nov 13 18:25:56 2009 -0600 @@ -6,27 +6,39 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32 + Debug - Left 4 Dead 2|Win32 = Debug - Left 4 Dead 2|Win32 Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32 + Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32 Debug - Orange Box|Win32 = Debug - Orange Box|Win32 Debug - Original|Win32 = Debug - Original|Win32 Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32 + Release - Left 4 Dead 2|Win32 = Release - Left 4 Dead 2|Win32 Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32 + Release - Orange Box Valve|Win32 = Release - Orange Box Valve|Win32 Release - Orange Box|Win32 = Release - Orange Box|Win32 Release - Original|Win32 = Release - Original|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.ActiveCfg = Debug - Dark Messiah|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead 2|Win32.ActiveCfg = Debug - Left 4 Dead 2|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead 2|Win32.Build.0 = Debug - Left 4 Dead 2|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box Valve|Win32.ActiveCfg = Debug - Orange Box Valve|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box Valve|Win32.Build.0 = Debug - Orange Box Valve|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.ActiveCfg = Debug - Original|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.Build.0 = Debug - Original|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.ActiveCfg = Release - Dark Messiah|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead 2|Win32.ActiveCfg = Release - Left 4 Dead 2|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead 2|Win32.Build.0 = Release - Left 4 Dead 2|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box Valve|Win32.ActiveCfg = Release - Orange Box Valve|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box Valve|Win32.Build.0 = Release - Orange Box Valve|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box|Win32.Build.0 = Release - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Original|Win32.ActiveCfg = Release - Original|Win32 diff -r 3ec9092c5dc8 -r c676a9ce0320 stub_mm/msvc8/stub_mm.vcproj --- a/stub_mm/msvc8/stub_mm.vcproj Mon Nov 02 11:08:56 2009 -0600 +++ b/stub_mm/msvc8/stub_mm.vcproj Fri Nov 13 18:25:56 2009 -0600 @@ -39,10 +39,10 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 3ec9092c5dc8 -r c676a9ce0320 stub_mm/msvc9/stub_mm.sln --- a/stub_mm/msvc9/stub_mm.sln Mon Nov 02 11:08:56 2009 -0600 +++ b/stub_mm/msvc9/stub_mm.sln Fri Nov 13 18:25:56 2009 -0600 @@ -6,27 +6,39 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32 + Debug - Left 4 Dead 2|Win32 = Debug - Left 4 Dead 2|Win32 Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32 + Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32 Debug - Orange Box|Win32 = Debug - Orange Box|Win32 Debug - Original|Win32 = Debug - Original|Win32 Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32 + Release - Left 4 Dead 2|Win32 = Release - Left 4 Dead 2|Win32 Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32 + Release - Orange Box Valve|Win32 = Release - Orange Box Valve|Win32 Release - Orange Box|Win32 = Release - Orange Box|Win32 Release - Original|Win32 = Release - Original|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.ActiveCfg = Debug - Dark Messiah|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead 2|Win32.ActiveCfg = Debug - Left 4 Dead 2|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead 2|Win32.Build.0 = Debug - Left 4 Dead 2|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box Valve|Win32.ActiveCfg = Debug - Orange Box Valve|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box Valve|Win32.Build.0 = Debug - Orange Box Valve|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.ActiveCfg = Debug - Original|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Debug - Original|Win32.Build.0 = Debug - Original|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.ActiveCfg = Release - Dark Messiah|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead 2|Win32.ActiveCfg = Release - Left 4 Dead 2|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead 2|Win32.Build.0 = Release - Left 4 Dead 2|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box Valve|Win32.ActiveCfg = Release - Orange Box Valve|Win32 + {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box Valve|Win32.Build.0 = Release - Orange Box Valve|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Orange Box|Win32.Build.0 = Release - Orange Box|Win32 {E62E5876-E1E2-41A0-85CA-1B41B9DA55F9}.Release - Original|Win32.ActiveCfg = Release - Original|Win32 diff -r 3ec9092c5dc8 -r c676a9ce0320 stub_mm/msvc9/stub_mm.vcproj --- a/stub_mm/msvc9/stub_mm.vcproj Mon Nov 02 11:08:56 2009 -0600 +++ b/stub_mm/msvc9/stub_mm.vcproj Fri Nov 13 18:25:56 2009 -0600 @@ -40,10 +40,10 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 3ec9092c5dc8 -r c676a9ce0320 stub_mm/stub_mm.cpp --- a/stub_mm/stub_mm.cpp Mon Nov 02 11:08:56 2009 -0600 +++ b/stub_mm/stub_mm.cpp Fri Nov 13 18:25:56 2009 -0600 @@ -1,5 +1,5 @@ /** - * vim: set ts=4 : + * vim: set ts=4 sw=4 tw=99 noet : * ====================================================== * Metamod:Source Stub Plugin * Written by AlliedModders LLC. @@ -10,8 +10,6 @@ * the use of this software. * * This stub plugin is public domain. - * - * Version: $Id$ */ #include diff -r 3ec9092c5dc8 -r c676a9ce0320 stub_mm/stub_mm.h --- a/stub_mm/stub_mm.h Mon Nov 02 11:08:56 2009 -0600 +++ b/stub_mm/stub_mm.h Fri Nov 13 18:25:56 2009 -0600 @@ -1,5 +1,5 @@ /** - * vim: set ts=4 : + * vim: set ts=4 sw=4 tw=99 noet : * ====================================================== * Metamod:Source Stub Plugin * Written by AlliedModders LLC. @@ -10,8 +10,6 @@ * the use of this software. * * This stub plugin is public domain. - * - * Version: $Id$ */ #ifndef _INCLUDE_METAMOD_SOURCE_STUB_PLUGIN_H_ diff -r 3ec9092c5dc8 -r c676a9ce0320 support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Scripts/1033/default.js --- a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Scripts/1033/default.js Mon Nov 02 11:08:56 2009 -0600 +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Scripts/1033/default.js Fri Nov 13 18:25:56 2009 -0600 @@ -232,6 +232,25 @@ LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll; + // Debug - Dark Messiah -> Configuration Properties -> C/C++ -> Preprocessor + + var config = proj.Object.Configurations('Debug - Dark Messiah'); + var CLTool = config.Tools('VCCLCompilerTool'); + var LinkTool = config.Tools('VCLinkerTool'); + + CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions; + LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll; + + // Release - Dark Messiah -> Configuration Properties -> C/C++ -> Preprocessor + + config = proj.Object.Configurations('Release - Dark Messiah'); + CLTool = config.Tools('VCCLCompilerTool'); + LinkTool = config.Tools('VCLinkerTool'); + + CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions; + LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll; + + // Debug - Orange Box -> Configuration Properties -> C/C++ -> Preprocessor config = proj.Object.Configurations('Debug - Orange Box'); @@ -251,6 +270,25 @@ LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll; + // Debug - Orange Box Valve -> Configuration Properties -> C/C++ -> Preprocessor + + config = proj.Object.Configurations('Debug - Orange Box Valve'); + CLTool = config.Tools('VCCLCompilerTool'); + LinkTool = config.Tools('VCLinkerTool'); + + CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions; + LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll; + + // Release - Orange Box Valve -> Configuration Properties -> C/C++ -> Preprocessor + + config = proj.Object.Configurations('Release - Orange Box Valve'); + CLTool = config.Tools('VCCLCompilerTool'); + LinkTool = config.Tools('VCLinkerTool'); + + CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions; + LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll; + + // Debug - Left 4 Dead -> Configuration Properties -> C/C++ -> Preprocessor config = proj.Object.Configurations('Debug - Left 4 Dead'); @@ -268,6 +306,25 @@ CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions; LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll; + + + // Debug - Left 4 Dead 2 -> Configuration Properties -> C/C++ -> Preprocessor + + config = proj.Object.Configurations('Debug - Left 4 Dead 2'); + CLTool = config.Tools('VCCLCompilerTool'); + LinkTool = config.Tools('VCLinkerTool'); + + CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions; + LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll; + + // Release - Left 4 Dead 2 -> Configuration Properties -> C/C++ -> Preprocessor + + config = proj.Object.Configurations('Release - Left 4 Dead 2'); + CLTool = config.Tools('VCCLCompilerTool'); + LinkTool = config.Tools('VCLinkerTool'); + + CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions; + LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll; } // Catch Exceptions diff -r 3ec9092c5dc8 -r c676a9ce0320 support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vcproj --- a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vcproj Mon Nov 02 11:08:56 2009 -0600 +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vcproj Fri Nov 13 18:25:56 2009 -0600 @@ -19,10 +19,10 @@ ConfigurationType="2" CharacterSet="2"> + + + + + + + + + + + + + + @@ -77,9 +135,9 @@ ConfigurationType="2" CharacterSet="2"> + + + + + + + + + + + + + + @@ -135,10 +251,10 @@ ConfigurationType="2" CharacterSet="2"> + + + + + + + + + + + + + + diff -r 3ec9092c5dc8 -r c676a9ce0320 support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vdf --- a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vdf Mon Nov 02 11:08:56 2009 -0600 +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vdf Fri Nov 13 18:25:56 2009 -0600 @@ -1,5 +1,5 @@ "Metamod Plugin" { "alias" "[!output PLUGIN_NAME]" - "file" "Addons/Metamod/Plugins/[!output PLUGIN_NAME]/Bin/[!output PLUGIN_DLL]" + "file" "addons/metamod/plugins/[!output PLUGIN_NAME]/bin/[!output PLUGIN_DLL]" } diff -r 3ec9092c5dc8 -r c676a9ce0320 support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_engine.h --- a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_engine.h Mon Nov 02 11:08:56 2009 -0600 +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_engine.h Fri Nov 13 18:25:56 2009 -0600 @@ -27,9 +27,14 @@ ///////////////////////////////////////////////////////////////////////// // Episode One -#if SOURCE_ENGINE == SE_EPISODEONE +#if SOURCE_ENGINE == SE_EPISODEONE && defined METAMOD_PLAPI_VERSION + +#error "Metamod:Source 1.6 API is not supported on the old engine." + +#endif ///////////////////////////////////////////////////////////////////////// +// Wrap some API calls for legacy MM:S. #if !defined METAMOD_PLAPI_VERSION @@ -41,13 +46,15 @@ #else -#error "Metamod:Source 1.6 is not supported on the old engine." +#define MM_Format g_SMAPI->Format #endif ///////////////////////////////////////////////////////////////////////// // Wrap the CCommand class so our code looks the same for both engines. +#if SOURCE_ENGINE <= SE_DARKMESSIAH + class CCommand { public: @@ -69,15 +76,6 @@ }; #define CVAR_INTERFACE_VERSION VENGINE_CVAR_INTERFACE_VERSION -#define ENGINE_CALL(func) SH_CALL(m_engine_server, func) - -///////////////////////////////////////////////////////////////////////// -// Episode Orange Box or newer - -#elif SOURCE_ENGINE >= SE_ORANGEBOX - -#define ENGINE_CALL(func) SH_CALL([!output PLUGIN_CLASS]::EngineServer, func) -#define MM_Format g_SMAPI->Format #endif @@ -121,4 +119,9 @@ #define snprintf _snprintf #endif +///////////////////////////////////////////////////////////////////////// +// Define ENGINE_CALL + +#define ENGINE_CALL(func) SH_CALL([!output PLUGIN_CLASS]::EngineServer, &IVEngineServer::func) + #endif // _MMS_ENGINE_H diff -r 3ec9092c5dc8 -r c676a9ce0320 support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_hooks.cpp --- a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_hooks.cpp Mon Nov 02 11:08:56 2009 -0600 +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_hooks.cpp Fri Nov 13 18:25:56 2009 -0600 @@ -486,7 +486,7 @@ { // Verify the parameters - #if SOURCE_ENGINE == SE_EPISODEONE + #if SOURCE_ENGINE <= SE_DARKMESSIAH CCommand args; #endif diff -r 3ec9092c5dc8 -r c676a9ce0320 support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.cpp --- a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.cpp Mon Nov 02 11:08:56 2009 -0600 +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.cpp Fri Nov 13 18:25:56 2009 -0600 @@ -84,9 +84,7 @@ // Load the VSP listener. This is usually needed for IServerPluginHelpers - #if defined METAMOD_PLAPI_VERSION - if (([!output PLUGIN_CLASS]::VspCallbacks = ismm->GetVSPInfo(NULL)) == NULL) - #endif + if (([!output PLUGIN_CLASS]::VspCallbacks = ismm->GetVSPInfo(NULL)) == NULL) { ismm->AddListener(this, this); ismm->EnableVSPListener(); @@ -96,15 +94,7 @@ AddHooks(); - // Get the engine server interface - - #if SOURCE_ENGINE == SE_EPISODEONE - - m_engine_server = SH_GET_CALLCLASS([!output PLUGIN_CLASS]::EngineServer); - - #endif - - ENGINE_CALL(&IVEngineServer::LogPrint)("All hooks started!\n"); + ENGINE_CALL(LogPrint)("All hooks started!\n"); // Register the base accessor @@ -131,14 +121,6 @@ RemoveHooks(); - // Release the engine server interface - - #if SOURCE_ENGINE == SE_EPISODEONE - - SH_RELEASE_CALLCLASS(m_engine_server); - - #endif - return true; } diff -r 3ec9092c5dc8 -r c676a9ce0320 support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.h --- a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.h Mon Nov 02 11:08:56 2009 -0600 +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.h Fri Nov 13 18:25:56 2009 -0600 @@ -154,15 +154,6 @@ [!if IServerGameClients_SetCommandClient] DECL_HOOK_SET_COMMAND_CLIENT; [!endif] - - //////////////////////////////////////// - // Plugin Variables - - protected: - - #if SOURCE_ENGINE == SE_EPISODEONE - SourceHook::CallClass* m_engine_server; - #endif }; /////////////////////////////////////////////////////////////////////////