diff --git a/sample_mm/Makefile b/sample_mm/Makefile
index f8a0937..a80f75b 100755
--- a/sample_mm/Makefile
+++ b/sample_mm/Makefile
@@ -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 @@ ifeq "$(ENGINE)" "original"
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 @@ ifeq "$(ENGINE)" "orangebox"
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 @@ $(BIN_DIR)/%.o: %.cpp
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 --git a/sample_mm/engine_wrappers.h b/sample_mm/engine_wrappers.h
index be242d6..9a33e66 100644
--- a/sample_mm/engine_wrappers.h
+++ b/sample_mm/engine_wrappers.h
@@ -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 @@ extern CGlobalVars *gpGlobals;
#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 --git a/sample_mm/msvc8/sample_mm.sln b/sample_mm/msvc8/sample_mm.sln
index 575c641..0c0ecb1 100644
--- a/sample_mm/msvc8/sample_mm.sln
+++ b/sample_mm/msvc8/sample_mm.sln
@@ -6,27 +6,39 @@ EndProject
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 --git a/sample_mm/msvc8/sample_mm.vcproj b/sample_mm/msvc8/sample_mm.vcproj
index f1463c9..4003380 100644
--- a/sample_mm/msvc8/sample_mm.vcproj
+++ b/sample_mm/msvc8/sample_mm.vcproj
@@ -39,9 +39,9 @@
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sample_mm/msvc9/sample_mm.sln b/sample_mm/msvc9/sample_mm.sln
index 903339b..2d8cd45 100644
--- a/sample_mm/msvc9/sample_mm.sln
+++ b/sample_mm/msvc9/sample_mm.sln
@@ -6,27 +6,39 @@ EndProject
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 --git a/sample_mm/msvc9/sample_mm.vcproj b/sample_mm/msvc9/sample_mm.vcproj
index e61ce50..1abdea7 100644
--- a/sample_mm/msvc9/sample_mm.vcproj
+++ b/sample_mm/msvc9/sample_mm.vcproj
@@ -40,9 +40,9 @@
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sample_mm/sample_mm.cpp b/sample_mm/sample_mm.cpp
index 580e511..77a2f77 100644
--- a/sample_mm/sample_mm.cpp
+++ b/sample_mm/sample_mm.cpp
@@ -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 @@ bool SamplePlugin::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen,
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 @@ bool SamplePlugin::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen,
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 @@ bool SamplePlugin::Unload(char *error, size_t maxlen)
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 --git a/sample_mm/sample_mm.h b/sample_mm/sample_mm.h
index fb97c5a..8164fd8 100644
--- a/sample_mm/sample_mm.h
+++ b/sample_mm/sample_mm.h
@@ -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 @@ public:
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 --git a/stub_mm/Makefile b/stub_mm/Makefile
index b59dd94..28bd634 100644
--- a/stub_mm/Makefile
+++ b/stub_mm/Makefile
@@ -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 @@ ifeq "$(ENGINE)" "original"
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 @@ ifeq "$(ENGINE)" "orangebox"
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 @@ $(BIN_DIR)/%.o: %.cpp
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 --git a/stub_mm/msvc8/stub_mm.sln b/stub_mm/msvc8/stub_mm.sln
index cc6035e..d19c4a2 100644
--- a/stub_mm/msvc8/stub_mm.sln
+++ b/stub_mm/msvc8/stub_mm.sln
@@ -6,27 +6,39 @@ EndProject
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 --git a/stub_mm/msvc8/stub_mm.vcproj b/stub_mm/msvc8/stub_mm.vcproj
index 35e484a..edeca1b 100644
--- a/stub_mm/msvc8/stub_mm.vcproj
+++ b/stub_mm/msvc8/stub_mm.vcproj
@@ -39,10 +39,10 @@
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/stub_mm/msvc9/stub_mm.sln b/stub_mm/msvc9/stub_mm.sln
index 9fccab2..1631b6a 100644
--- a/stub_mm/msvc9/stub_mm.sln
+++ b/stub_mm/msvc9/stub_mm.sln
@@ -6,27 +6,39 @@ EndProject
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 --git a/stub_mm/msvc9/stub_mm.vcproj b/stub_mm/msvc9/stub_mm.vcproj
index 71e7243..c58e5bf 100644
--- a/stub_mm/msvc9/stub_mm.vcproj
+++ b/stub_mm/msvc9/stub_mm.vcproj
@@ -40,10 +40,10 @@
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/stub_mm/stub_mm.cpp b/stub_mm/stub_mm.cpp
index a9faaef..18f1cb9 100644
--- a/stub_mm/stub_mm.cpp
+++ b/stub_mm/stub_mm.cpp
@@ -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 --git a/stub_mm/stub_mm.h b/stub_mm/stub_mm.h
index dd69743..6963b51 100644
--- a/stub_mm/stub_mm.h
+++ b/stub_mm/stub_mm.h
@@ -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 --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Scripts/1033/default.js b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Scripts/1033/default.js
index 6d9142d..c230e8f 100644
--- a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Scripts/1033/default.js
+++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Scripts/1033/default.js
@@ -232,6 +232,25 @@ function AddConfig(proj, strProjectName)
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 @@ function AddConfig(proj, strProjectName)
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 @@ function AddConfig(proj, strProjectName)
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 --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vcproj b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vcproj
index 6f17cdb..73ed377 100644
--- a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vcproj
+++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vcproj
@@ -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 --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vdf b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vdf
index 73723db..7051e4d 100644
--- a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vdf
+++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vdf
@@ -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 --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_engine.h b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_engine.h
index 89f437e..141ea1b 100644
--- a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_engine.h
+++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_engine.h
@@ -27,9 +27,14 @@ class [!output PLUGIN_CLASS];
/////////////////////////////////////////////////////////////////////////
// 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 @@ class [!output PLUGIN_CLASS];
#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 @@ class CCommand
};
#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 @@ inline edict_t* PEntityOfEntIndex(int entity_index)
#define snprintf _snprintf
#endif
+/////////////////////////////////////////////////////////////////////////
+// Define ENGINE_CALL
+
+#define ENGINE_CALL(func) SH_CALL([!output PLUGIN_CLASS]::EngineServer, &IVEngineServer::func)
+
#endif // _MMS_ENGINE_H
diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_hooks.cpp b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_hooks.cpp
index 268a5de..1c5eea6 100644
--- a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_hooks.cpp
+++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_hooks.cpp
@@ -486,7 +486,7 @@ void [!output PLUGIN_CLASS]::HookedClientCommand(edict_t* entity)
{
// Verify the parameters
- #if SOURCE_ENGINE == SE_EPISODEONE
+ #if SOURCE_ENGINE <= SE_DARKMESSIAH
CCommand args;
#endif
diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.cpp b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.cpp
index 12f8699..a7092f9 100644
--- a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.cpp
+++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.cpp
@@ -84,9 +84,7 @@ bool [!output PLUGIN_CLASS]::Load(PluginId id, ISmmAPI* ismm, char* error, size_
// 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 @@ bool [!output PLUGIN_CLASS]::Load(PluginId id, ISmmAPI* ismm, char* error, size_
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 @@ bool [!output PLUGIN_CLASS]::Unload(char *error, size_t maxlen)
RemoveHooks();
- // Release the engine server interface
-
- #if SOURCE_ENGINE == SE_EPISODEONE
-
- SH_RELEASE_CALLCLASS(m_engine_server);
-
- #endif
-
return true;
}
diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.h b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.h
index fe934a8..73636a3 100644
--- a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.h
+++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.h
@@ -154,15 +154,6 @@ class [!output PLUGIN_CLASS] : public ISmmPlugin, public IMetamodListener
[!if IServerGameClients_SetCommandClient]
DECL_HOOK_SET_COMMAND_CLIENT;
[!endif]
-
- ////////////////////////////////////////
- // Plugin Variables
-
- protected:
-
- #if SOURCE_ENGINE == SE_EPISODEONE
- SourceHook::CallClass* m_engine_server;
- #endif
};
/////////////////////////////////////////////////////////////////////////