1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-01-19 08:52:34 +01:00

Added support for Left 4 Dead 2 (bug 4078, r=dvander).

This commit is contained in:
Scott Ehlert 2009-10-29 10:57:27 -05:00
parent a6b2f0c80f
commit 07a7cc20cd
12 changed files with 286 additions and 61 deletions

View File

@ -1,8 +1,8 @@
/* /*
* vim: set ts=4 : * vim: set ts=4 sw=4 tw=99 noet :
* ====================================================== * ======================================================
* Metamod:Source * Metamod:Source
* Copyright (C) 2004-2008 AlliedModders LLC and authors. * Copyright (C) 2004-2009 AlliedModders LLC and authors.
* All rights reserved. * All rights reserved.
* ====================================================== * ======================================================
* *
@ -21,8 +21,6 @@
* 2. Altered source versions must be plainly marked as such, and must not be * 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
*
* Version: $Id$
*/ */
#ifndef _INCLUDE_METAMOD_SOURCE_PLUGIN_EXT_H_ #ifndef _INCLUDE_METAMOD_SOURCE_PLUGIN_EXT_H_
@ -43,6 +41,7 @@
#define SOURCE_ENGINE_ORANGEBOX 3 /**< Orange Box Source Engine (third major SDK) */ #define SOURCE_ENGINE_ORANGEBOX 3 /**< Orange Box Source Engine (third major SDK) */
#define SOURCE_ENGINE_LEFT4DEAD 4 /**< Left 4 Dead */ #define SOURCE_ENGINE_LEFT4DEAD 4 /**< Left 4 Dead */
#define SOURCE_ENGINE_DARKMESSIAH 5 /**< Dark Messiah Multiplayer (based on original engine) */ #define SOURCE_ENGINE_DARKMESSIAH 5 /**< Dark Messiah Multiplayer (based on original engine) */
#define SOURCE_ENGINE_LEFT4DEAD2 7 /**< Left 4 Dead 2 */
#define METAMOD_PLAPI_VERSION 14 /**< Version of this header file */ #define METAMOD_PLAPI_VERSION 14 /**< Version of this header file */
#define METAMOD_PLAPI_NAME "ISmmPlugin" /**< Name of the plugin interface */ #define METAMOD_PLAPI_NAME "ISmmPlugin" /**< Name of the plugin interface */

View File

@ -1,9 +1,10 @@
# (C)2004-2008 SourceMod Development Team # (C)2004-2009 SourceMod Development Team
# Makefile written by David "BAILOPAN" Anderson # Makefile written by David "BAILOPAN" Anderson
SRCDS_BASE = ~/srcds SRCDS_BASE = ~/srcds
HL2SDK_OB = ../../hl2sdk-ob HL2SDK_OB = ../../hl2sdk-ob
HL2SDK_L4D = ../../hl2sdk-l4d HL2SDK_L4D = ../../hl2sdk-l4d
HL2SDK_L4D2 = ../../hl2sdk-l4d2
##################################### #####################################
### EDIT BELOW FOR OTHER PROJECTS ### ### EDIT BELOW FOR OTHER PROJECTS ###
@ -35,28 +36,42 @@ CPP = gcc-4.1
override ENGSET = false override ENGSET = false
ifeq "$(ENGINE)" "orangebox" ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB) HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK_OB)/public HL2PUB = $(HL2SDK)/public
HL2LIB = $(HL2SDK_OB)/lib/linux HL2LIB = $(HL2SDK)/lib/linux
CFLAGS += -DSOURCE_ENGINE=3 CFLAGS += -DSOURCE_ENGINE=3
INCLUDE += -I$(HL2SDK_OB)/public/game/server INCLUDE += -I$(HL2SDK)/public/game/server
SRCDS = $(SRCDS_BASE)/orangebox SRCDS = $(SRCDS_BASE)/orangebox
BINARY = metamod.2.ep2.so BINARY = metamod.2.ep2.so
override ENGSET = true override ENGSET = true
endif endif
ifeq "$(ENGINE)" "left4dead" ifeq "$(ENGINE)" "left4dead"
HL2SDK = $(HL2SDK_L4D) HL2SDK = $(HL2SDK_L4D)
HL2PUB = $(HL2SDK_L4D)/public HL2PUB = $(HL2SDK)/public
HL2LIB = $(HL2SDK_L4D)/lib/linux HL2LIB = $(HL2SDK)/lib/linux
CFLAGS += -DSOURCE_ENGINE=4 CFLAGS += -DSOURCE_ENGINE=5
INCLUDE += -I$(HL2SDK_L4D)/public/game/server INCLUDE += -I$(HL2SDK)/public/game/server
SRCDS = $(SRCDS_BASE)/l4d SRCDS = $(SRCDS_BASE)/l4d
BINARY = metamod.2.l4d.so BINARY = metamod.2.l4d.so
override ENGSET = true override ENGSET = true
endif endif
ifeq "$(ENGINE)" "left4dead2"
HL2SDK = $(HL2SDK_L4D2)
HL2PUB = $(HL2SDK)/public
HL2LIB = $(HL2SDK)/lib/linux
CFLAGS += -DSOURCE_ENGINE=6
INCLUDE += -I$(HL2SDK)/public/game/server
SRCDS = $(SRCDS_BASE)/left4dead2_demo
BINARY = metamod.2.l4d2.so
override ENGSET = true
endif
CFLAGS += -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4 CFLAGS += -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=5 -DSE_LEFT4DEAD2=6
LINK += $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so -static-libgcc ifeq "$(ENGINE)" "left4dead2"
LINK += $(HL2LIB)/tier1_i486.a vstdlib_linux.so tier0_linux.so -static-libgcc
else
LINK += $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so -static-libgcc
endif
INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/vstdlib \ INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/vstdlib \
-I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I. -Isourcehook -I../loader -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I. -Isourcehook -I../loader
@ -97,13 +112,18 @@ all: check
mkdir -p $(BIN_DIR) mkdir -p $(BIN_DIR)
mkdir -p $(BIN_DIR)/provider mkdir -p $(BIN_DIR)/provider
mkdir -p $(BIN_DIR)/sourcehook mkdir -p $(BIN_DIR)/sourcehook
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so if [ "$(ENGINE)" = "left4dead2" ]; then \
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so ln -sf $(SRCDS)/bin/vstdlib_linux.so vstdlib_linux.so; \
ln -sf $(SRCDS)/bin/tier0_linux.so tier0_linux.so; \
else \
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so; \
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \
fi
$(MAKE) -f Makefile metamod $(MAKE) -f Makefile metamod
check: check:
if [ "$(ENGSET)" = "false" ]; then \ if [ "$(ENGSET)" = "false" ]; then \
echo "You must supply ENGINE=left4dead or ENGINE=orangebox"; \ echo "You must supply one of the following values for ENGINE: left4dead2, left4dead or orangebox"; \
exit 1; \ exit 1; \
fi fi

View File

@ -1,8 +1,8 @@
/** /**
* vim: set ts=4 : * vim: set ts=4 sw=4 tw=99 noet :
* ====================================================== * ======================================================
* Metamod:Source * Metamod:Source
* Copyright (C) 2004-2008 AlliedModders LLC and authors. * Copyright (C) 2004-2009 AlliedModders LLC and authors.
* All rights reserved. * All rights reserved.
* ====================================================== * ======================================================
* *
@ -21,8 +21,6 @@
* 2. Altered source versions must be plainly marked as such, and must not be * 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
*
* Version: $Id$
*/ */
#include <stdio.h> #include <stdio.h>
@ -113,12 +111,16 @@ bool Command_Meta(IMetamodSourceCommandInfo *info)
} }
#endif #endif
#if SOURCE_ENGINE == SE_LEFT4DEAD #if SOURCE_ENGINE == SE_LEFT4DEAD2
CONMSG(" Engine: Left 4 Dead 2 (2009)\n");
#elif SOURCE_ENGINE == SE_LEFT4DEAD
CONMSG(" Engine: Left 4 Dead (2008)\n"); CONMSG(" Engine: Left 4 Dead (2008)\n");
#elif SOURCE_ENGINE == SE_ORANGEBOX #elif SOURCE_ENGINE == SE_ORANGEBOX
CONMSG(" Engine: Episode 2 (Orange Box, 2007)\n"); CONMSG(" Engine: Episode 2 (Orange Box, 2007)\n");
#else #elif SOURCE_ENGINE == SE_DARKMESSIAH
CONMSG(" Engine: Dark Messiah (2006)\n"); CONMSG(" Engine: Dark Messiah (2006)\n");
#else
#error "SOURCE_ENGINE not defined to a known value"
#endif #endif
// Display user messages // Display user messages

View File

@ -6,21 +6,27 @@ EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32 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 - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32
Debug - Orange Box|Win32 = Debug - Orange Box|Win32 Debug - Orange Box|Win32 = Debug - Orange Box|Win32
Release - Dark Messiah|Win32 = Release - Dark Messiah|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 - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32
Release - Orange Box|Win32 = Release - Orange Box|Win32 Release - Orange Box|Win32 = Release - Orange Box|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Dark Messiah|Win32.ActiveCfg = Debug - Dark Messiah|Win32 {F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Dark Messiah|Win32.ActiveCfg = Debug - Dark Messiah|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32 {F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Left 4 Dead 2|Win32.ActiveCfg = Debug - Left 4 Dead 2|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Left 4 Dead 2|Win32.Build.0 = Debug - Left 4 Dead 2|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32 {F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32 {F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32 {F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32 {F7D47743-73B3-49B5-9D76-2333C5DFD565}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Dark Messiah|Win32.ActiveCfg = Release - Dark Messiah|Win32 {F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Dark Messiah|Win32.ActiveCfg = Release - Dark Messiah|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32 {F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Left 4 Dead 2|Win32.ActiveCfg = Release - Left 4 Dead 2|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Left 4 Dead 2|Win32.Build.0 = Release - Left 4 Dead 2|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32 {F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32 {F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32
{F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32 {F7D47743-73B3-49B5-9D76-2333C5DFD565}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32

View File

@ -40,7 +40,7 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4" AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;" AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=3" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=3"
@ -124,7 +124,7 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4" AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6"
Optimization="3" Optimization="3"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="true" OmitFramePointers="true"
@ -211,10 +211,10 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4" AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;" AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=4" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=5"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
@ -295,12 +295,12 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4" AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6"
Optimization="3" Optimization="3"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;" AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(HL2SDKL4D)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=4" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=5"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -358,6 +358,177 @@
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
</Configuration> </Configuration>
<Configuration
Name="Debug - Left 4 Dead 2|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6"
Optimization="0"
AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDKL4D2)\public&quot;;&quot;$(HL2SDKL4D2)\public\engine&quot;;&quot;$(HL2SDKL4D2)\public\game\server&quot;;&quot;$(HL2SDKL4D2)\public\tier0&quot;;&quot;$(HL2SDKL4D2)\public\tier1&quot;;&quot;$(HL2SDKL4D2)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=6"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDKL4D2)\lib\public\tier0.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\tier1.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)/metamod.2.l4d2.dll"
LinkIncremental="2"
IgnoreDefaultLibraryNames="libc.lib;libcd.lib;libcmt.lib"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/sourcemm.pdb"
SubSystem="2"
EnableCOMDATFolding="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(OutDir)/sourcemm.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Left 4 Dead 2|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6"
Optimization="3"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDKL4D2)\public&quot;;&quot;$(HL2SDKL4D2)\public\engine&quot;;&quot;$(HL2SDKL4D2)\public\game\server&quot;;&quot;$(HL2SDKL4D2)\public\tier0&quot;;&quot;$(HL2SDKL4D2)\public\tier1&quot;;&quot;$(HL2SDKL4D2)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=6"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
BufferSecurityCheck="false"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDKL4D2)\lib\public\tier0.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\tier1.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)/metamod.2.l4d2.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="libc.lib;libcd.lib;libcmtd.lib"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(OutDir)/sourcemm.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration <Configuration
Name="Debug - Dark Messiah|Win32" Name="Debug - Dark Messiah|Win32"
OutputDirectory="$(ConfigurationName)" OutputDirectory="$(ConfigurationName)"
@ -382,7 +553,7 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4" AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDK-DARKM)\public&quot;;&quot;$(HL2SDK-DARKM)\public\engine&quot;;&quot;$(HL2SDK-DARKM)\public\dlls&quot;;&quot;$(HL2SDK-DARKM)\public\tier0&quot;;&quot;$(HL2SDK-DARKM)\public\tier1&quot;;&quot;$(HL2SDK-DARKM)\public\vstdlib&quot;" AdditionalIncludeDirectories="..;..\..\loader;..\sourcehook;&quot;$(HL2SDK-DARKM)\public&quot;;&quot;$(HL2SDK-DARKM)\public\engine&quot;;&quot;$(HL2SDK-DARKM)\public\dlls&quot;;&quot;$(HL2SDK-DARKM)\public\tier0&quot;;&quot;$(HL2SDK-DARKM)\public\tier1&quot;;&quot;$(HL2SDK-DARKM)\public\vstdlib&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=2" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCE_ENGINE=2"
@ -466,7 +637,7 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4" AdditionalOptions="/D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6"
Optimization="3" Optimization="3"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="true" OmitFramePointers="true"

View File

@ -1,8 +1,8 @@
/** /**
* vim: set ts=4 : * vim: set ts=4 sw=4 tw=99 noet :
* ====================================================== * ======================================================
* Metamod:Source * Metamod:Source
* Copyright (C) 2004-2008 AlliedModders LLC and authors. * Copyright (C) 2004-2009 AlliedModders LLC and authors.
* All rights reserved. * All rights reserved.
* ====================================================== * ======================================================
* *
@ -21,8 +21,6 @@
* 2. Altered source versions must be plainly marked as such, and must not be * 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
*
* Version: $Id$
*/ */
#include <stdio.h> #include <stdio.h>
@ -385,12 +383,16 @@ const char *BaseProvider::GetGameDescription()
int BaseProvider::DetermineSourceEngine(const char *game) int BaseProvider::DetermineSourceEngine(const char *game)
{ {
#if SOURCE_ENGINE == SE_LEFT4DEAD #if SOURCE_ENGINE == SE_LEFT4DEAD2
return SOURCE_ENGINE_LEFT4DEAD2;
#elif SOURCE_ENGINE == SE_LEFT4DEAD
return SOURCE_ENGINE_LEFT4DEAD; return SOURCE_ENGINE_LEFT4DEAD;
#elif SOURCE_ENGINE == SE_ORANGEBOX #elif SOURCE_ENGINE == SE_ORANGEBOX
return SOURCE_ENGINE_ORANGEBOX; return SOURCE_ENGINE_ORANGEBOX;
#else #elif SOURCE_ENGINE == SE_DARKMESSIAH
return SOURCE_ENGINE_DARKMESSIAH; return SOURCE_ENGINE_DARKMESSIAH;
#else
#error "SOURCE_ENGINE not defined to a known value"
#endif #endif
} }

View File

@ -1,12 +1,10 @@
# (C)2004-2008 SourceMod Development Team # (C)2004-2009 SourceMod Development Team
# Makefile written by David "BAILOPAN" Anderson # Makefile written by David "BAILOPAN" Anderson
##################################### #####################################
### EDIT BELOW FOR OTHER PROJECTS ### ### EDIT BELOW FOR OTHER PROJECTS ###
##################################### #####################################
BINARY = server_i486.so
OBJECTS = loader.cpp \ OBJECTS = loader.cpp \
utility.cpp \ utility.cpp \
serverplugin.cpp \ serverplugin.cpp \
@ -22,6 +20,14 @@ C_GCC4_FLAGS = -fvisibility=hidden
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
CPP = gcc-4.1 CPP = gcc-4.1
ifeq "$(ENGINE)" "left4dead2"
BINARY = server_linux.so
CFLAGS += -DBINARY_SUFFIX=\"_linux.so\"
else
BINARY = server_i486.so
CFLAGS += -DBINARY_SUFFIX=\"_i486.so\"
endif
LINK += -static-libgcc LINK += -static-libgcc
INCLUDE += -I. -I../core/sourcehook INCLUDE += -I. -I../core/sourcehook
@ -36,10 +42,18 @@ CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
################################################ ################################################
ifeq "$(DEBUG)" "true" ifeq "$(DEBUG)" "true"
BIN_DIR = Debug ifeq "$(ENGINE)" ""
BIN_DIR = Debug
else
BIN_DIR = Debug.$(ENGINE)
endif
CFLAGS += $(C_DEBUG_FLAGS) CFLAGS += $(C_DEBUG_FLAGS)
else else
BIN_DIR = Release ifeq "$(ENGINE)" ""
BIN_DIR = Release
else
BIN_DIR = Release.$(ENGINE)
endif
CFLAGS += $(C_OPT_FLAGS) CFLAGS += $(C_OPT_FLAGS)
endif endif

View File

@ -1,8 +1,8 @@
/** /**
* vim: set ts=4 : * vim: set ts=4 sw=4 tw=99 noet :
* ====================================================== * ======================================================
* Metamod:Source * Metamod:Source
* Copyright (C) 2004-2008 AlliedModders LLC and authors. * Copyright (C) 2004-2009 AlliedModders LLC and authors.
* All rights reserved. * All rights reserved.
* ====================================================== * ======================================================
* *
@ -21,8 +21,6 @@
* 2. Altered source versions must be plainly marked as such, and must not be * 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
*
* Version: $Id$
*/ */
#include <time.h> #include <time.h>
@ -72,16 +70,17 @@ mm_LogFatal(const char *message, ...)
static const char *backend_names[] = static const char *backend_names[] =
{ {
"1.ep1", "1.ep1",
"2.darkm",
"2.ep2", "2.ep2",
"2.l4d", "2.l4d",
"2.darkm" "2.l4d2"
}; };
#if defined _WIN32 #if defined _WIN32
#define LIBRARY_EXT ".dll" #define LIBRARY_EXT ".dll"
#define LIBRARY_MINEXT ".dll" #define LIBRARY_MINEXT ".dll"
#elif defined __linux__ #elif defined __linux__
#define LIBRARY_EXT "_i486.so" #define LIBRARY_EXT BINARY_SUFFIX
#define LIBRARY_MINEXT ".so" #define LIBRARY_MINEXT ".so"
#endif #endif
@ -173,8 +172,8 @@ mm_GetProcAddress(const char *name)
#define TIER0_NAME "bin\\tier0.dll" #define TIER0_NAME "bin\\tier0.dll"
#define VSTDLIB_NAME "bin\\vstdlib.dll" #define VSTDLIB_NAME "bin\\vstdlib.dll"
#elif defined __linux__ #elif defined __linux__
#define TIER0_NAME "bin/tier0_i486.so" #define TIER0_NAME "bin/tier0" BINARY_SUFFIX
#define VSTDLIB_NAME "bin/vstdlib_i486.so" #define VSTDLIB_NAME "bin/vstdlib" BINARY_SUFFIX
#endif #endif
const char * const char *
@ -244,6 +243,10 @@ mm_DetermineBackend(QueryValveInterface engineFactory, const char *game_name)
if (engineFactory("VEngineServer022", NULL) != NULL && if (engineFactory("VEngineServer022", NULL) != NULL &&
engineFactory("VEngineCvar007", NULL) != NULL) engineFactory("VEngineCvar007", NULL) != NULL)
{ {
if (engineFactory("VPrecacheSystem001", NULL) != NULL)
{
return MMBackend_Left4Dead2;
}
return MMBackend_Left4Dead; return MMBackend_Left4Dead;
} }
else if (engineFactory("VEngineServer021", NULL) != NULL) else if (engineFactory("VEngineServer021", NULL) != NULL)

View File

@ -1,8 +1,8 @@
/** /**
* vim: set ts=4 : * vim: set ts=4 sw=4 tw=99 noet :
* ====================================================== * ======================================================
* Metamod:Source * Metamod:Source
* Copyright (C) 2004-2008 AlliedModders LLC and authors. * Copyright (C) 2004-2009 AlliedModders LLC and authors.
* All rights reserved. * All rights reserved.
* ====================================================== * ======================================================
* *
@ -21,8 +21,6 @@
* 2. Altered source versions must be plainly marked as such, and must not be * 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
*
* Version: $Id$
*/ */
#ifndef _INCLUDE_METAMOD_SOURCE_LOADER_H_ #ifndef _INCLUDE_METAMOD_SOURCE_LOADER_H_
@ -62,9 +60,10 @@ typedef void * HMODULE;
enum MetamodBackend enum MetamodBackend
{ {
MMBackend_Episode1 = 0, MMBackend_Episode1 = 0,
MMBackend_DarkMessiah,
MMBackend_Episode2, MMBackend_Episode2,
MMBackend_Left4Dead, MMBackend_Left4Dead,
MMBackend_DarkMessiah, MMBackend_Left4Dead2,
MMBackend_UNKNOWN MMBackend_UNKNOWN
}; };

View File

@ -1,8 +1,8 @@
/** /**
* vim: set ts=4 : * vim: set ts=4 sw=4 tw=99 noet :
* ====================================================== * ======================================================
* Metamod:Source * Metamod:Source
* Copyright (C) 2004-2008 AlliedModders LLC and authors. * Copyright (C) 2004-2009 AlliedModders LLC and authors.
* All rights reserved. * All rights reserved.
* ====================================================== * ======================================================
* *
@ -21,8 +21,6 @@
* 2. Altered source versions must be plainly marked as such, and must not be * 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
*
* Version: $Id$
*/ */
#include <stdio.h> #include <stdio.h>
@ -104,7 +102,7 @@ public:
mm_LogFatal("Could not detect engine version"); mm_LogFatal("Could not detect engine version");
return false; return false;
} }
else if (backend == MMBackend_Episode2 || backend == MMBackend_Left4Dead) else if (backend >= MMBackend_Episode2)
{ {
/* We need to insert the right type of call into this vtable */ /* We need to insert the right type of call into this vtable */
void **vtable_src; void **vtable_src;

View File

@ -14,6 +14,7 @@ chdir('..');
# Folder .vcproj Engine Binary Suffix type Platform # Folder .vcproj Engine Binary Suffix type Platform
Build('loader', 'mm_loader', '', 'server', 'full', 'both'); Build('loader', 'mm_loader', '', 'server', 'full', 'both');
Build('loader', 'mm_loader', 'Left4Dead2', 'server_linux', '', 'linux');
Build('core-legacy', 'mm_core-legacy', '', 'metamod.1.ep1', '', 'both'); Build('core-legacy', 'mm_core-legacy', '', 'metamod.1.ep1', '', 'both');
Build('core', 'mm_core', 'OrangeBox', 'metamod.2.ep2', '', 'both'); Build('core', 'mm_core', 'OrangeBox', 'metamod.2.ep2', '', 'both');
Build('core', 'mm_core', 'Left4Dead', 'metamod.2.l4d', '', 'both'); Build('core', 'mm_core', 'Left4Dead', 'metamod.2.l4d', '', 'both');
@ -94,6 +95,10 @@ sub BuildWindows
{ {
$param = "Release - Left 4 Dead"; $param = "Release - Left 4 Dead";
} }
elsif ($build eq "Left4Dead2")
{
$param = "Release - Left 4 Dead 2";
}
elsif ($build eq "DarkMessiah") elsif ($build eq "DarkMessiah")
{ {
$param = "Release - Dark Messiah"; $param = "Release - Dark Messiah";
@ -135,6 +140,11 @@ sub BuildLinux
$param = "ENGINE=left4dead"; $param = "ENGINE=left4dead";
$file .= '.left4dead'; $file .= '.left4dead';
} }
elsif ($build eq "Left4Dead2")
{
$param = "ENGINE=left4dead2";
$file .= '.left4dead2';
}
$file .= '/' . $binary; $file .= '/' . $binary;
print "Cleaning $srcdir...\n"; print "Cleaning $srcdir...\n";

View File

@ -22,9 +22,10 @@ $version .= '-hg' . Build::HgRevNum('.');
symstore("loader\\msvc9\\server.*", $version); symstore("loader\\msvc9\\server.*", $version);
symstore("core-legacy\\msvc9\\Release\\metamod.1.ep1.*", $version); symstore("core-legacy\\msvc9\\Release\\metamod.1.ep1.*", $version);
symstore("core\\msvc9\\Release - Dark Messiah\\metamod.2.darkm.*", $version);
symstore("core\\msvc9\\Release - Orange Box\\metamod.2.ep2.*", $version); symstore("core\\msvc9\\Release - Orange Box\\metamod.2.ep2.*", $version);
symstore("core\\msvc9\\Release - Left 4 Dead\\metamod.2.l4d.*", $version); symstore("core\\msvc9\\Release - Left 4 Dead\\metamod.2.l4d.*", $version);
symstore("core\\msvc9\\Release - Dark Messiah\\metamod.2.darkm.*", $version); symstore("core\\msvc9\\Release - Left 4 Dead 2\\metamod.2.l4d2.*", $version);
#Lowercase DLLs. Sigh. #Lowercase DLLs. Sigh.
my (@files); my (@files);