From 9e69afbbd6c8430e1861fe51202233634052b1a5 Mon Sep 17 00:00:00 2001 From: Fyren Date: Fri, 30 Oct 2009 13:26:13 +1300 Subject: [PATCH 1/8] Inital SM fixes for l4d2 and linux makefile updates --- core/ConCommandBaseIterator.h | 12 ++++---- core/ExtensionSys.cpp | 4 ++- core/GameConfigs.cpp | 2 ++ core/Makefile | 26 ++++++++++++++-- core/PluginSys.h | 2 +- core/UserMessages.cpp | 12 ++++---- core/UserMessages.h | 2 +- core/smn_console.cpp | 12 ++++---- core/sourcemm_api.h | 2 +- extensions/bintools/Makefile | 31 ++++++++++++++++--- extensions/sdktools/Makefile | 49 ++++++++++++++++++++----------- extensions/sdktools/trnatives.cpp | 2 +- extensions/sdktools/vnatives.cpp | 2 +- loader/Makefile | 2 +- loader/loader.cpp | 6 ++++ plugins/nextmap.sp | 2 ++ 16 files changed, 120 insertions(+), 48 deletions(-) diff --git a/core/ConCommandBaseIterator.h b/core/ConCommandBaseIterator.h index b75838b4..dfe84ac5 100644 --- a/core/ConCommandBaseIterator.h +++ b/core/ConCommandBaseIterator.h @@ -33,7 +33,7 @@ class ConCommandBaseIterator { -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) ICvarIteratorInternal *cvarIter; #else ConCommandBase *cvarIter; @@ -42,7 +42,7 @@ class ConCommandBaseIterator public: ConCommandBaseIterator() { -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) cvarIter = icvar->FactoryInternalIterator(); cvarIter->SetFirst(); #else @@ -52,14 +52,14 @@ public: ~ConCommandBaseIterator() { -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) g_pMemAlloc->Free(cvarIter); #endif } inline bool IsValid() { -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) return cvarIter->IsValid(); #else return cvarIter != NULL; @@ -68,7 +68,7 @@ public: inline void Next() { -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) cvarIter->Next(); #else cvarIter = const_cast(cvarIter->GetNext()); @@ -77,7 +77,7 @@ public: inline ConCommandBase *Get() { -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) return cvarIter->Get(); #else return cvarIter; diff --git a/core/ExtensionSys.cpp b/core/ExtensionSys.cpp index 3868b463..127f5aa6 100644 --- a/core/ExtensionSys.cpp +++ b/core/ExtensionSys.cpp @@ -63,6 +63,8 @@ CRemoteExtension::CRemoteExtension(IExtensionInterface *pAPI, const char *filena #if defined METAMOD_PLAPI_VERSION #if SOURCE_ENGINE == SE_LEFT4DEAD #define GAMEFIX "2.l4d" +#elif SOURCE_ENGINE == SE_LEFT4DEAD2 +#define GAMEFIX "2.l4d2" #elif SOURCE_ENGINE == SE_ORANGEBOX #define GAMEFIX "2.ep2" #elif SOURCE_ENGINE == SE_ORANGEBOXVALVE @@ -71,7 +73,7 @@ CRemoteExtension::CRemoteExtension(IExtensionInterface *pAPI, const char *filena #define GAMEFIX "2.darkm" #else #define GAMEFIX "2.ep1" -#endif //SOURCE_ENGINE == SE_LEFT4DEAD +#endif //(SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) #else //METAMOD_PLAPI_VERSION #define GAMEFIX "1.ep1" #endif //METAMOD_PLAPI_VERSION diff --git a/core/GameConfigs.cpp b/core/GameConfigs.cpp index b58b34ca..86bd1c18 100644 --- a/core/GameConfigs.cpp +++ b/core/GameConfigs.cpp @@ -117,6 +117,8 @@ static bool DoesEngineMatch(const char *value) if (strcmp(value, "orangebox_valve") == 0) #elif SOURCE_ENGINE == SE_LEFT4DEAD if (strcmp(value, "left4dead") == 0) +#elif SOURCE_ENGINE == SE_LEFT4DEAD2 + if (strcmp(value, "left4dead2") == 0) #else #error "Unknown engine type" #endif diff --git a/core/Makefile b/core/Makefile index 4b0cb1ba..c2368c6a 100644 --- a/core/Makefile +++ b/core/Makefile @@ -7,7 +7,8 @@ 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 +MMSOURCE17 = ../../mmsource-central ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -92,11 +93,27 @@ ifeq "$(ENGINE)" "left4dead" BINARY = sourcemod.2.l4d.so override ENGSET = true endif +ifeq "$(ENGINE)" "left4dead2" + HL2SDK = $(HL2SDK_L4D2) + HL2PUB = $(HL2SDK)/public + HL2LIB = $(HL2SDK)/lib/linux + CFLAGS += -DSOURCE_ENGINE=6 + METAMOD = $(MMSOURCE17)/core + INCLUDE += -I$(HL2SDK)/public/game/server + SRCDS = $(SRCDS_BASE)/left4dead2_demo + BINARY = sourcemod.2.l4d2.so + override ENGSET = true +endif -CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 -DSE_LEFT4DEAD=5 +CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 -DSE_LEFT4DEAD=5 -DSE_LEFT4DEAD2=6 +ifeq "$(ENGINE)" "left4dead2" +LINK += $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_linux.so \ + tier0_linux.so -static-libgcc +else LINK += $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_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 \ -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook \ @@ -136,8 +153,13 @@ $(BIN_DIR)/%.o: %.c all: check mkdir -p $(BIN_DIR) +ifeq "$(ENGINE)" "left4dead2" + 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; +endif $(MAKE) -f Makefile sourcemod check: diff --git a/core/PluginSys.h b/core/PluginSys.h index db3ab302..e26cad74 100644 --- a/core/PluginSys.h +++ b/core/PluginSys.h @@ -47,7 +47,7 @@ #include "sm_trie.h" #include "sourcemod.h" #include -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) #include "convar_sm_l4d.h" #elif (SOURCE_ENGINE == SE_ORANGEBOX) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE) #include "convar_sm_ob.h" diff --git a/core/UserMessages.cpp b/core/UserMessages.cpp index 667a07b7..3900c536 100644 --- a/core/UserMessages.cpp +++ b/core/UserMessages.cpp @@ -34,7 +34,7 @@ UserMessages g_UserMsgs; -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) SH_DECL_HOOK3(IVEngineServer, UserMessageBegin, SH_NOATTRIB, 0, bf_write *, IRecipientFilter *, int, const char *); #else SH_DECL_HOOK2(IVEngineServer, UserMessageBegin, SH_NOATTRIB, 0, bf_write *, IRecipientFilter *, int); @@ -168,13 +168,13 @@ bf_write *UserMessages::StartMessage(int msg_id, const cell_t players[], unsigne if (m_CurFlags & USERMSG_BLOCKHOOKS) { -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) buffer = ENGINE_CALL(UserMessageBegin)(static_cast(&m_CellRecFilter), msg_id, g_SMAPI->GetUserMessage(msg_id)); #else buffer = ENGINE_CALL(UserMessageBegin)(static_cast(&m_CellRecFilter), msg_id); #endif } else { -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) buffer = engine->UserMessageBegin(static_cast(&m_CellRecFilter), msg_id, g_SMAPI->GetUserMessage(msg_id)); #else buffer = engine->UserMessageBegin(static_cast(&m_CellRecFilter), msg_id); @@ -316,7 +316,7 @@ void UserMessages::_DecRefCounter() } } -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name) #else bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type) @@ -346,7 +346,7 @@ bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_typ RETURN_META_VALUE(MRES_IGNORED, NULL); } -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) bf_write *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name) #else bf_write *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type) @@ -500,7 +500,7 @@ void UserMessages::OnMessageEnd_Pre() { bf_write *engine_bfw; -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) engine_bfw = ENGINE_CALL(UserMessageBegin)(m_CurRecFilter, m_CurId, g_SMAPI->GetUserMessage(m_CurId)); #else engine_bfw = ENGINE_CALL(UserMessageBegin)(m_CurRecFilter, m_CurId); diff --git a/core/UserMessages.h b/core/UserMessages.h index 0ff262fc..d8af3fd6 100644 --- a/core/UserMessages.h +++ b/core/UserMessages.h @@ -79,7 +79,7 @@ public: //IUserMessages IUserMessageListener *pListener, bool intercept=false); public: -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) bf_write *OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name); bf_write *OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name); #else diff --git a/core/smn_console.cpp b/core/smn_console.cpp index 84651002..a12f5b81 100644 --- a/core/smn_console.cpp +++ b/core/smn_console.cpp @@ -46,7 +46,7 @@ #include "Logger.h" #include "ConsoleDetours.h" -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) #define NET_SETCONVAR 6 #else #define NET_SETCONVAR 5 @@ -69,7 +69,7 @@ struct GlobCmdIter struct ConCmdIter { -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) ICvarIteratorInternal *pLast; #else const ConCommandBase *pLast; @@ -103,7 +103,7 @@ public: else if (type == htConCmdIter) { ConCmdIter *iter = (ConCmdIter * )object; -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) // ICvarIteratorInternal has no virtual destructor g_pMemAlloc->Free(iter->pLast); #endif @@ -1183,7 +1183,7 @@ static cell_t FindFirstConCommand(IPluginContext *pContext, const cell_t *params pContext->LocalToPhysAddr(params[3], &pIsCmd); pContext->LocalToPhysAddr(params[4], &pFlags); -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) ICvarIteratorInternal *cvarIter = icvar->FactoryInternalIterator(); cvarIter->SetFirst(); if (!cvarIter->IsValid()) @@ -1210,7 +1210,7 @@ static cell_t FindFirstConCommand(IPluginContext *pContext, const cell_t *params } pIter = new ConCmdIter; -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) pIter->pLast = cvarIter; #else pIter->pLast = pConCmd; @@ -1245,7 +1245,7 @@ static cell_t FindNextConCommand(IPluginContext *pContext, const cell_t *params) return 0; } -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) ICvarIteratorInternal *cvarIter = pIter->pLast; cvarIter->Next(); if (!cvarIter->IsValid()) diff --git a/core/sourcemm_api.h b/core/sourcemm_api.h index f67a51e9..ed244c63 100644 --- a/core/sourcemm_api.h +++ b/core/sourcemm_api.h @@ -32,7 +32,7 @@ #ifndef _INCLUDE_SOURCEMOD_MM_API_H_ #define _INCLUDE_SOURCEMOD_MM_API_H_ -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) #include "convar_sm_l4d.h" #elif (SOURCE_ENGINE == SE_ORANGEBOX) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE) #include "convar_sm_ob.h" diff --git a/extensions/bintools/Makefile b/extensions/bintools/Makefile index e88a10d5..683e57bb 100644 --- a/extensions/bintools/Makefile +++ b/extensions/bintools/Makefile @@ -7,7 +7,8 @@ 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 +MMSOURCE17 = ../../../mmsource-central ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -79,16 +80,33 @@ ifeq "$(ENGINE)" "left4dead" USEMETA = true CFLAGS += -DHOOKING_ENABLED endif +ifeq "$(ENGINE)" "left4dead2" + HL2SDK = $(HL2SDK_L4D2) + HL2PUB = $(HL2SDK)/public + HL2LIB = $(HL2SDK)/lib/linux + CFLAGS += -DSOURCE_ENGINE=6 + METAMOD = $(MMSOURCE17)/core + INCLUDE += -I$(HL2SDK)/public/game/server + SRCDS = $(SRCDS_BASE)/left4dead2_demo + GAMEFIX = 2.l4d2 + override ENGSET = true + USEMETA = true + CFLAGS += -DHOOKING_ENABLED +endif ifeq "$(USEMETA)" "true" +ifeq "$(ENGINE)" "left4dead2" + LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_linux.so tier0_linux.so +else LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so +endif LINK += $(LINK_HL2) INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \ -I$(METAMOD) -I$(METAMOD)/sourcehook -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn \ -I$(SMSDK)/public/extensions -I$(SMSDK)/public/jit -I$(SMSDK)/public/jit/x86 - CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 -DSE_LEFT4DEAD=5 + CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 -DSE_LEFT4DEAD=5 -DSE_LEFT4DEAD2=6 else INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/extensions -I$(SMSDK)/public/jit \ -I$(SMSDK)/public/jit/x86 -I$(SMSDK)/public/sourcepawn @@ -142,8 +160,13 @@ $(BIN_DIR)/%.o: %.cpp all: check mkdir -p $(BIN_DIR)/sdk if [ "$(USEMETA)" = "true" ]; then \ - ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so; \ - ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \ + if [ "$(ENGINE)" = "left4dead2" ]; then \ + 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 \ fi $(MAKE) -f Makefile extension diff --git a/extensions/sdktools/Makefile b/extensions/sdktools/Makefile index 64c99878..18234dc8 100644 --- a/extensions/sdktools/Makefile +++ b/extensions/sdktools/Makefile @@ -7,7 +7,8 @@ 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 +MMSOURCE17 = ../../../mmsource-central ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -78,20 +79,31 @@ ifeq "$(ENGINE)" "left4dead" GAMEFIX = 2.l4d override ENGSET = true endif - -ifeq "$(USEMETA)" "true" - LINK_HL2 = $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_i486.so tier0_i486.so - - LINK += $(LINK_HL2) - - INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/tier0 \ - -I$(HL2PUB)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook -I$(SMSDK)/public -I$(SMSDK)/public/extensions \ - -I$(SMSDK)/public/sourcepawn - CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 -DSE_LEFT4DEAD=5 -else - INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn +ifeq "$(ENGINE)" "left4dead2" + HL2SDK = $(HL2SDK_L4D2) + HL2PUB = $(HL2SDK)/public + HL2LIB = $(HL2SDK)/lib/linux + CFLAGS += -DSOURCE_ENGINE=6 + METAMOD = $(MMSOURCE17)/core + INCLUDE += -I$(HL2SDK)/public/game/server -I$(HL2SDK)/common -I$(HL2SDK)/game/shared + SRCDS = $(SRCDS_BASE)/left4dead2_demo + GAMEFIX = 2.l4d2 + override ENGSET = true endif +ifeq "$(ENGINE)" "left4dead2" + LINK_HL2 = $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_linux.so tier0_linux.so +else + LINK_HL2 = $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_i486.so tier0_i486.so +endif + +LINK += $(LINK_HL2) + +INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/tier0 \ + -I$(HL2PUB)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook -I$(SMSDK)/public -I$(SMSDK)/public/extensions \ + -I$(SMSDK)/public/sourcepawn +CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 -DSE_LEFT4DEAD=5 -DSE_LEFT4DEAD2=6 + LINK += -m32 -ldl -lm CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \ @@ -137,10 +149,13 @@ $(BIN_DIR)/%.o: %.cpp all: check mkdir -p $(BIN_DIR)/sdk - if [ "$(USEMETA)" = "true" ]; then \ - ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so; \ - ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \ - fi +ifeq "$(ENGINE)" "left4dead2" + 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; +endif $(MAKE) -f Makefile extension check: diff --git a/extensions/sdktools/trnatives.cpp b/extensions/sdktools/trnatives.cpp index e0fb6659..1c5043fa 100644 --- a/extensions/sdktools/trnatives.cpp +++ b/extensions/sdktools/trnatives.cpp @@ -530,7 +530,7 @@ static cell_t smn_TRGetPointContents(IPluginContext *pContext, const cell_t *par { mask = enginetrace->GetPointContents(pos); } else { -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) mask = enginetrace->GetPointContents(pos, 0, &hentity); #else mask = enginetrace->GetPointContents(pos, &hentity); diff --git a/extensions/sdktools/vnatives.cpp b/extensions/sdktools/vnatives.cpp index 321f43d2..e81086d1 100644 --- a/extensions/sdktools/vnatives.cpp +++ b/extensions/sdktools/vnatives.cpp @@ -657,7 +657,7 @@ static cell_t FindEntityByClassname(IPluginContext *pContext, const cell_t *para return gamehelpers->EntityToBCompatRef(pEntity); } -#if SOURCE_ENGINE == SE_LEFT4DEAD +#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) static cell_t CreateEntityByName(IPluginContext *pContext, const cell_t *params) { static ValveCall *pCall = NULL; diff --git a/loader/Makefile b/loader/Makefile index 23a1d276..075ba76c 100644 --- a/loader/Makefile +++ b/loader/Makefile @@ -1,7 +1,7 @@ # (C)2004-2008 SourceMod Development Team # Makefile written by David "BAILOPAN" Anderson -MMSOURCE17 = ../../mmsource-1.7 +MMSOURCE17 = ../../mmsource-central ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### diff --git a/loader/loader.cpp b/loader/loader.cpp index 690add40..49b3274a 100644 --- a/loader/loader.cpp +++ b/loader/loader.cpp @@ -74,6 +74,7 @@ #define FILENAME_1_6_EP1 "sourcemod.2.ep1" PLATFORM_EXT #define FILENAME_1_6_L4D "sourcemod.2.l4d" PLATFORM_EXT #define FILENAME_1_6_DARKM "sourcemod.2.darkm" PLATFORM_EXT +#define FILENAME_1_6_L4D2 "sourcemod.2.l4d2" PLATFORM_EXT HINSTANCE g_hCore = NULL; bool load_attempted = false; @@ -236,6 +237,11 @@ DLL_EXPORT METAMOD_PLUGIN *CreateInterface_MMS(const MetamodVersionInfo *mvi, co filename = FILENAME_1_6_DARKM; break; } + case SOURCE_ENGINE_LEFT4DEAD2: + { + filename = FILENAME_1_6_L4D2; + break; + } default: { return NULL; diff --git a/plugins/nextmap.sp b/plugins/nextmap.sp index 85759372..a4b6ab48 100644 --- a/plugins/nextmap.sp +++ b/plugins/nextmap.sp @@ -222,4 +222,6 @@ FormatTimeDuration(String:buffer[], maxlen, time) { return Format(buffer, maxlen, "%is", seconds); } + + return Plugin_Handled; } From 533723cd8b2d4905c675b1c0641c8214762423ef Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Fri, 30 Oct 2009 13:27:05 +1300 Subject: [PATCH 2/8] L4D2 gamedata updates --- extensions/sdktools/vnatives.cpp | 29 ++ gamedata/core.games/engine.l4d2.txt | 51 ++++ gamedata/core.games/master.games.txt | 5 + gamedata/sdktools.games/engine.l4d2.txt | 358 +++++++++++++++++++++++ gamedata/sdktools.games/master.games.txt | 5 + 5 files changed, 448 insertions(+) create mode 100644 gamedata/core.games/engine.l4d2.txt create mode 100644 gamedata/sdktools.games/engine.l4d2.txt diff --git a/extensions/sdktools/vnatives.cpp b/extensions/sdktools/vnatives.cpp index e81086d1..561e931a 100644 --- a/extensions/sdktools/vnatives.cpp +++ b/extensions/sdktools/vnatives.cpp @@ -713,6 +713,34 @@ static cell_t CreateEntityByName(IPluginContext *pContext, const cell_t *params) } #endif +#if SOURCE_ENGINE == SE_LEFT4DEAD2 +static cell_t DispatchSpawn(IPluginContext *pContext, const cell_t *params) +{ + static ValveCall *pCall = NULL; + if (!pCall) + { + ValvePassInfo pass[3]; + InitPass(pass[0], Valve_CBaseEntity, PassType_Basic, PASSFLAG_BYVAL); + InitPass(pass[1], Valve_Bool, PassType_Basic, PASSFLAG_BYVAL); + InitPass(pass[2], Valve_POD, PassType_Basic, PASSFLAG_BYVAL); + if (!CreateBaseCall("DispatchSpawn", ValveCall_Static, &pass[2], pass, 2, &pCall)) + { + return pContext->ThrowNativeError("\"DispatchSpawn\" not supported by this mod"); + } else if (!pCall) { + return pContext->ThrowNativeError("\"DispatchSpawn\" wrapper failed to initialize"); + } + } + + int ret; + START_CALL(); + DECODE_VALVE_PARAM(1, vparams, 0); + /* All X-refs to DispatchSpawn I checked use true - Unsure of what it does */ + *(bool *)(vptr + 4) = true; + FINISH_CALL_SIMPLE(&ret); + + return (ret == -1) ? 0 : 1; +} +#else static cell_t DispatchSpawn(IPluginContext *pContext, const cell_t *params) { static ValveCall *pCall = NULL; @@ -736,6 +764,7 @@ static cell_t DispatchSpawn(IPluginContext *pContext, const cell_t *params) return (ret == -1) ? 0 : 1; } +#endif static cell_t DispatchKeyValue(IPluginContext *pContext, const cell_t *params) { diff --git a/gamedata/core.games/engine.l4d2.txt b/gamedata/core.games/engine.l4d2.txt new file mode 100644 index 00000000..c5195516 --- /dev/null +++ b/gamedata/core.games/engine.l4d2.txt @@ -0,0 +1,51 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your SourceMod install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after SM's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod) + */ + +"Games" +{ + /* CGlobalEntityList */ + "#default" + { + "#supported" + { + "game" "left4dead2" + } + + "Offsets" + { + /* Offset into LevelShutdown */ + "gEntList" + { + "windows" "11" + } + + "EntInfo" + { + "windows" "4" + "linux" "4" + } + } + + "Signatures" + { + "LevelShutdown" + { + "library" "server" + "windows" "\xE8\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xE8" + } + "gEntList" + { + "library" "server" + "linux" "@gEntList" + } + } + } +} diff --git a/gamedata/core.games/master.games.txt b/gamedata/core.games/master.games.txt index c35800de..7766bfd9 100644 --- a/gamedata/core.games/master.games.txt +++ b/gamedata/core.games/master.games.txt @@ -20,6 +20,11 @@ "engine" "left4dead" } + "engine.l4d2.txt" + { + "engine" "left4dead2" + } + "engine.ep2.txt" { "engine" "orangebox" diff --git a/gamedata/sdktools.games/engine.l4d2.txt b/gamedata/sdktools.games/engine.l4d2.txt new file mode 100644 index 00000000..1d28d191 --- /dev/null +++ b/gamedata/sdktools.games/engine.l4d2.txt @@ -0,0 +1,358 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your SourceMod install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after SM's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod) + */ + +"Games" +{ + /* Sounds */ + "#default" + { + "Keys" + { + "SlapSoundCount" "2" + "SlapSound1" "player/damage1.wav" + "SlapSound2" "player/damage2.wav" + } + } + + /* General Temp Entities */ + "#default" + { + "#supported" + { + "game" "left4dead2" + } + + "Offsets" + { + /* Offset into CBaseTempEntity constructor */ + "s_pTempEntities" + { + "windows" "17" + } + "GetTEName" + { + "windows" "4" + "linux" "4" + } + "GetTENext" + { + "windows" "8" + "linux" "8" + } + "TE_GetServerClass" + { + "windows" "0" + "linux" "0" + } + } + + "Signatures" + { + "CBaseTempEntity" + { + "library" "server" + "windows" "\x8B\xC1\x8B\x4C\x24\x04\xC7\x00\x2A\x2A\x2A\x2A\x89\x48\x04\x8B\x15\x2A\x2A\x2A\x2A\x89\x50\x08\xA3\x2A\x2A\x2A\x2A\xC2\x04\x00" + } + "s_pTempEntities" + { + "library" "server" + "linux" "@_ZN15CBaseTempEntity15s_pTempEntitiesE" + } + } + } + + /* Create Entity Signatures */ + "#default" + { + "#supported" + { + "game" "left4dead2" + } + + "Signatures" + { + "DispatchSpawn" + { + "library" "server" + "linux" "@_Z13DispatchSpawnP11CBaseEntityb" + "windows" "\x53\x55\x56\x8B\x74\x24\x10\x85\xF6\x57\x0F\x84\x2A\x2A\x2A\x2A\x8B\x1D\x2A\x2A\x2A\x2A\x8B\x03\x8B\x50\x2A\x8B\xCB" + } + "CreateEntityByName" + { + "library" "server" + "linux" "@_Z18CreateEntityByNamePKcib" + "windows" "\x56\x8B\x74\x24\x0C\x83\xFE\xFF\x57\x8B\x7C\x24\x0C\x74\x27\x8B\x0D\x2A\x2A\x2A\x2A\x8B\x01\x8B\x50\x2A\x56\xFF\xD2" + } + } + } + + /* CGlobalEntityList */ + "#default" + { + "#supported" + { + "game" "left4dead2" + } + + "Signatures" + { + /* Functions in CGlobalEntityList */ + "FindEntityByClassname" + { + "library" "server" + "windows" "\x53\x55\x56\x8B\xF1\x8B\x4C\x24\x10\x85\xC9\x57\x74\x19\x8B\x01\x8B\x50\x08\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x83\xC0\x01\xC1\xE0\x04\x8B\x3C\x30\xEB\x06\x8B\xBE\x2A\x2A\x2A\x2A\x85\xFF\x74\x39\x8B\x5C\x24\x18\x8B\x2D\x2A\x2A\x2A\x2A\xEB\x03" + "linux" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc" + } + } + } + + /* General GameRules */ + "#default" + { + "#supported" + { + "game" "left4dead2" + } + + "Offsets" + { + /* Offset into CreateGameRulesObject */ + "g_pGameRules" + { + "windows" "2" + } + } + + "Signatures" + { + /* This signature sometimes has multiple matches, but this + * does not matter as g_pGameRules is involved in all of them. + * The same g_pGameRules offset applies to each match. + * + * Sometimes this block of bytes is at the beginning of the static + * CreateGameRulesObject function and sometimes it is in the middle + * of an entirely different function. This depends on the game. + */ + "CreateGameRulesObject" + { + "library" "server" + "windows" "\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\x6A\x01\xFF\xD2" + } + "g_pGameRules" + { + "library" "server" + "linux" "@g_pGameRules" + } + } + } + + /* IServer interface pointer */ + "#default" + { + "Keys" + { + /* Signature for the beginning of IVEngineServer::CreateFakeClient. + * + * The engine binary is not actually scanned in order to look for + * this. SourceHook is used to used to determine the address of the + * function and this signature is used to verify that it contains + * the expected code. A pointer to sv (IServer interface) is used + * here. + */ + "CreateFakeClient_Windows" "\x8B\x44\x24\x2A\x50\xB9\x2A\x2A\x2A\x2A\xE8" + } + + "Offsets" + { + /* Offset into IVEngineServer::CreateFakeClient */ + "sv" + { + "windows" "6" + } + } + + "Signatures" + { + /* CBaseServer object for IServer interface */ + "sv" + { + "library" "engine" + "linux" "@sv" + } + } + } + + /* EntityFactoryDictionary function */ + "#default" + { + "Signatures" + { + "EntityFactory" + { + "library" "server" + "windows" "\xB8\x01\x00\x00\x00\x84\x2A\x2A\x2A\x2A\x2A\x75\x1D\x09\x2A\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x68\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x83\xC4\x04\xB8\x2A\x2A\x2A\x2A\xC3" + "linux" "@_Z23EntityFactoryDictionaryv" + } + } + } + + /* CBaseEntityOutput::FireOutput */ + "#default" + { + "#supported" + { + "game" "left4dead2" + } + "Signatures" + { + "FireOutput" + { + "library" "server" + "windows" "\x81\xEC\x1C\x01\x00\x00\x53\x55\x56\x8B\x71\x14\x85\xF6" + "linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" + } + } + "Offsets" + { + "FireOutputBackup" + { + "windows" "6" + "linux" "10" + } + } + } + + /* SetUserInfo data */ + "#default" + { + "Offsets" + { + /** + * CBaseClient::SetUserCVar(char const*,char const*); + * Linux offset straight from VTable dump. + * Windows offset is crazy. Found the windows SetName function using string "(%d)%-.*s" (aD_S in IDA) + * Cross referenced back to the vtable and counted manually (SetUserCvar is 1 higher, offsets start from 1) + */ + "SetUserCvar" + { + /* Not 100% sure on this, why would windows change and not linux - TEST ME */ + "windows" "18" + "linux" "63" + } + /** + * Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made. + * Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end. + * Linux: mov byte ptr [esi+0B0h], 0 + * Win: mov byte ptr [esi+0B0h], 0 + * + * L4D2: This has been moved into CBaseClient::UpdateUserSettings(), rest of the details are still relevant. + */ + "InfoChanged" + { + "windows" "176" + "linux" "176" + } + } + } + + /* Left 4 Dead */ + "left4dead" + { + "Offsets" + { + "GiveNamedItem" + { + "windows" "505" + "linux" "506" + } + "RemovePlayerItem" + { + "windows" "288" + "linux" "289" + } + "Weapon_GetSlot" + { + "windows" "286" + "linux" "287" + } + "Ignite" + { + "windows" "221" + "linux" "222" + } + "Extinguish" + { + "windows" "224" + "linux" "225" + } + "Teleport" + { + "windows" "117" + "linux" "118" + } + "CommitSuicide" + { + "windows" "473" + "linux" "473" + } + "GetVelocity" + { + "windows" "149" + "linux" "150" + } + "EyeAngles" + { + "windows" "140" + "linux" "141" + } + "AcceptInput" + { + "windows" "43" + "linux" "44" + } + "DispatchKeyValue" + { + "windows" "33" + "linux" "32" + } + "DispatchKeyValueFloat" + { + "windows" "32" + "linux" "33" + } + "DispatchKeyValueVector" + { + "windows" "31" + "linux" "34" + } + "SetEntityModel" + { + "windows" "26" + "linux" "27" + } + "WeaponEquip" + { + "windows" "279" + "linux" "280" + } + "Activate" + { + "windows" "35" + "linux" "36" + } + "PlayerRunCmd" + { + "windows" "451" + "linux" "452" + } + } + } +} diff --git a/gamedata/sdktools.games/master.games.txt b/gamedata/sdktools.games/master.games.txt index bbf79bf1..6d2458bb 100644 --- a/gamedata/sdktools.games/master.games.txt +++ b/gamedata/sdktools.games/master.games.txt @@ -20,6 +20,11 @@ "engine" "left4dead" } + "engine.l4d2.txt" + { + "engine" "left4dead2" + } + "engine.ep2.txt" { "engine" "orangebox" From 98e97920aeb294adad977e72b8ea7b5287a27d6c Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Fri, 30 Oct 2009 13:27:19 +1300 Subject: [PATCH 3/8] AMBuild updated for new L4D2 engine --- AMBuildScript | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AMBuildScript b/AMBuildScript index 442a109e..fb839d78 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -17,6 +17,8 @@ class SM: 'name': 'ORANGEBOXVALVE'} self.sdkInfo['l4d'] = {'sdk': 'HL2SDKL4D', 'ext': '2.l4d', 'def': '5', 'name': 'LEFT4DEAD'} + self.sdkInfo['l4d2'] = {'sdk': 'HL2SDKL4D2', 'ext': '2.l4d2', 'def': '6', + 'name': 'LEFT4DEAD2'} if AMBuild.target['platform'] == 'windows': self.sdkInfo['darkm'] = {'sdk': 'HL2SDK-DARKM', 'ext': '2.darkm', 'def': '2', 'name': 'DARKMESSIAH'} @@ -31,6 +33,7 @@ class SM: 'HL2SDKOB': 'hl2sdk-ob', 'HL2SDKL4D': 'hl2sdk-l4d', 'HL2SDKOBVALVE': 'hl2sdk-ob-valve', + 'HL2SDKL4D2': 'hl2sdk-l4d2', 'MYSQL5': 'mysql-5.0' } From eb68e4c6276f154d6b03a74c6ad23c0049f7a5f0 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Fri, 30 Oct 2009 14:29:45 +1300 Subject: [PATCH 4/8] SourceMod MSVC project files updated, windows tested and loading, gamedata fix. --- core/convar_sm_l4d.h | 3 + core/msvc9/sourcemod_mm.sln | 9 + core/msvc9/sourcemod_mm.vcproj | 264 ++++++++++++++++++++++ core/smn_halflife.cpp | 3 +- extensions/bintools/msvc9/bintools.sln | 6 + extensions/bintools/msvc9/bintools.vcproj | 158 +++++++++++++ extensions/sdktools/msvc9/sdktools.sln | 6 + extensions/sdktools/msvc9/sdktools.vcproj | 166 ++++++++++++++ gamedata/sdktools.games/engine.l4d2.txt | 2 +- loader/msvc9/loader.vcproj | 3 +- plugins/nextmap.sp | 3 +- 11 files changed, 619 insertions(+), 4 deletions(-) diff --git a/core/convar_sm_l4d.h b/core/convar_sm_l4d.h index 87da7c02..e6519da6 100644 --- a/core/convar_sm_l4d.h +++ b/core/convar_sm_l4d.h @@ -386,6 +386,9 @@ public: virtual void SetValue( const char *value ); virtual void SetValue( float value ); virtual void SetValue( int value ); +#if SOURCE_ENGINE == SE_LEFT4DEAD2 + virtual void SetValue( Color value ); +#endif // Reset to default value void Revert( void ); diff --git a/core/msvc9/sourcemod_mm.sln b/core/msvc9/sourcemod_mm.sln index 4c8558cd..f17308b0 100644 --- a/core/msvc9/sourcemod_mm.sln +++ b/core/msvc9/sourcemod_mm.sln @@ -7,18 +7,21 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution CrazyDebug - Dark Messiah|Win32 = CrazyDebug - Dark Messiah|Win32 CrazyDebug - Episode 1|Win32 = CrazyDebug - Episode 1|Win32 + CrazyDebug - Left 4 Dead 2|Win32 = CrazyDebug - Left 4 Dead 2|Win32 CrazyDebug - Left 4 Dead|Win32 = CrazyDebug - Left 4 Dead|Win32 CrazyDebug - Old Metamod|Win32 = CrazyDebug - Old Metamod|Win32 CrazyDebug - Orange Box Valve|Win32 = CrazyDebug - Orange Box Valve|Win32 CrazyDebug - Orange Box|Win32 = CrazyDebug - Orange Box|Win32 Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32 Debug - Episode 1|Win32 = Debug - Episode 1|Win32 + Debug - Left 4 Dead 2|Win32 = Debug - Left 4 Dead 2|Win32 Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32 Debug - Old Metamod|Win32 = Debug - Old Metamod|Win32 Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32 Debug - Orange Box|Win32 = Debug - Orange Box|Win32 Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32 Release - Episode 1|Win32 = Release - Episode 1|Win32 + Release - Left 4 Dead 2|Win32 = Release - Left 4 Dead 2|Win32 Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32 Release - Old Metamod|Win32 = Release - Old Metamod|Win32 Release - Orange Box Valve|Win32 = Release - Orange Box Valve|Win32 @@ -29,6 +32,8 @@ Global {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Dark Messiah|Win32.Build.0 = CrazyDebug - Dark Messiah|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Episode 1|Win32.ActiveCfg = CrazyDebug - Episode 1|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Episode 1|Win32.Build.0 = CrazyDebug - Episode 1|Win32 + {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Left 4 Dead 2|Win32.ActiveCfg = CrazyDebug - Left 4 Dead 2|Win32 + {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Left 4 Dead 2|Win32.Build.0 = CrazyDebug - Left 4 Dead 2|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Left 4 Dead|Win32.ActiveCfg = CrazyDebug - Left 4 Dead|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Left 4 Dead|Win32.Build.0 = CrazyDebug - Left 4 Dead|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Old Metamod|Win32.ActiveCfg = CrazyDebug - Old Metamod|Win32 @@ -41,6 +46,8 @@ Global {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Episode 1|Win32.ActiveCfg = Debug - Episode 1|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Episode 1|Win32.Build.0 = Debug - Episode 1|Win32 + {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Left 4 Dead 2|Win32.ActiveCfg = Debug - Left 4 Dead 2|Win32 + {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Left 4 Dead 2|Win32.Build.0 = Debug - Left 4 Dead 2|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Old Metamod|Win32.ActiveCfg = Debug - Old Metamod|Win32 @@ -53,6 +60,8 @@ Global {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Episode 1|Win32.ActiveCfg = Release - Episode 1|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Episode 1|Win32.Build.0 = Release - Episode 1|Win32 + {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Left 4 Dead 2|Win32.ActiveCfg = Release - Left 4 Dead 2|Win32 + {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Left 4 Dead 2|Win32.Build.0 = Release - Left 4 Dead 2|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32 diff --git a/core/msvc9/sourcemod_mm.vcproj b/core/msvc9/sourcemod_mm.vcproj index 4e836306..0c128507 100644 --- a/core/msvc9/sourcemod_mm.vcproj +++ b/core/msvc9/sourcemod_mm.vcproj @@ -1504,6 +1504,254 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1648,6 +1896,22 @@ Name="VCCLCompilerTool" /> + + + + + + Time(); + float fTime = Plat_FloatTime(); + return sp_ftoc(fTime); } diff --git a/extensions/bintools/msvc9/bintools.sln b/extensions/bintools/msvc9/bintools.sln index 11c01928..1cb74301 100644 --- a/extensions/bintools/msvc9/bintools.sln +++ b/extensions/bintools/msvc9/bintools.sln @@ -7,12 +7,14 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32 Debug - Episode 1|Win32 = Debug - Episode 1|Win32 + Debug - Left 4 Dead 2|Win32 = Debug - Left 4 Dead 2|Win32 Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32 Debug - Old Metamod|Win32 = Debug - Old Metamod|Win32 Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32 Debug - Orange Box|Win32 = Debug - Orange Box|Win32 Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32 Release - Episode 1|Win32 = Release - Episode 1|Win32 + Release - Left 4 Dead 2|Win32 = Release - Left 4 Dead 2|Win32 Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32 Release - Old Metamod|Win32 = Release - Old Metamod|Win32 Release - Orange Box Valve|Win32 = Release - Orange Box Valve|Win32 @@ -23,6 +25,8 @@ Global {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Episode 1|Win32.ActiveCfg = Debug - Episode 1|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Episode 1|Win32.Build.0 = Debug - Episode 1|Win32 + {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Left 4 Dead 2|Win32.ActiveCfg = Debug - Left 4 Dead 2|Win32 + {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Left 4 Dead 2|Win32.Build.0 = Debug - Left 4 Dead 2|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Old Metamod|Win32.ActiveCfg = Debug - Old Metamod|Win32 @@ -35,6 +39,8 @@ Global {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Episode 1|Win32.ActiveCfg = Release - Episode 1|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Episode 1|Win32.Build.0 = Release - Episode 1|Win32 + {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Left 4 Dead 2|Win32.ActiveCfg = Release - Left 4 Dead 2|Win32 + {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Left 4 Dead 2|Win32.Build.0 = Release - Left 4 Dead 2|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32 diff --git a/extensions/bintools/msvc9/bintools.vcproj b/extensions/bintools/msvc9/bintools.vcproj index 1839c103..3fbea1eb 100644 --- a/extensions/bintools/msvc9/bintools.vcproj +++ b/extensions/bintools/msvc9/bintools.vcproj @@ -974,6 +974,164 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extensions/sdktools/msvc9/sdktools.sln b/extensions/sdktools/msvc9/sdktools.sln index 4506b200..4836d17e 100644 --- a/extensions/sdktools/msvc9/sdktools.sln +++ b/extensions/sdktools/msvc9/sdktools.sln @@ -7,12 +7,14 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32 Debug - Episode 1|Win32 = Debug - Episode 1|Win32 + Debug - Left 4 Dead 2|Win32 = Debug - Left 4 Dead 2|Win32 Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32 Debug - Old Metamod|Win32 = Debug - Old Metamod|Win32 Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32 Debug - Orange Box|Win32 = Debug - Orange Box|Win32 Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32 Release - Episode 1|Win32 = Release - Episode 1|Win32 + Release - Left 4 Dead 2|Win32 = Release - Left 4 Dead 2|Win32 Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32 Release - Old Metamod|Win32 = Release - Old Metamod|Win32 Release - Orange Box Valve|Win32 = Release - Orange Box Valve|Win32 @@ -23,6 +25,8 @@ Global {7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Episode 1|Win32.ActiveCfg = Debug - Episode 1|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Episode 1|Win32.Build.0 = Debug - Episode 1|Win32 + {7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Left 4 Dead 2|Win32.ActiveCfg = Debug - Left 4 Dead 2|Win32 + {7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Left 4 Dead 2|Win32.Build.0 = Debug - Left 4 Dead 2|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Old Metamod|Win32.ActiveCfg = Debug - Old Metamod|Win32 @@ -35,6 +39,8 @@ Global {7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Episode 1|Win32.ActiveCfg = Release - Episode 1|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Episode 1|Win32.Build.0 = Release - Episode 1|Win32 + {7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Left 4 Dead 2|Win32.ActiveCfg = Release - Left 4 Dead 2|Win32 + {7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Left 4 Dead 2|Win32.Build.0 = Release - Left 4 Dead 2|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32 diff --git a/extensions/sdktools/msvc9/sdktools.vcproj b/extensions/sdktools/msvc9/sdktools.vcproj index c2c52353..09c1f262 100644 --- a/extensions/sdktools/msvc9/sdktools.vcproj +++ b/extensions/sdktools/msvc9/sdktools.vcproj @@ -1008,6 +1008,172 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gamedata/sdktools.games/engine.l4d2.txt b/gamedata/sdktools.games/engine.l4d2.txt index 1d28d191..17ba251e 100644 --- a/gamedata/sdktools.games/engine.l4d2.txt +++ b/gamedata/sdktools.games/engine.l4d2.txt @@ -264,7 +264,7 @@ } /* Left 4 Dead */ - "left4dead" + "left4dead2" { "Offsets" { diff --git a/loader/msvc9/loader.vcproj b/loader/msvc9/loader.vcproj index 0d0fb1e3..18b5d1ce 100644 --- a/loader/msvc9/loader.vcproj +++ b/loader/msvc9/loader.vcproj @@ -41,7 +41,7 @@ Date: Fri, 30 Oct 2009 14:34:34 +1300 Subject: [PATCH 5/8] Updated GuessSDKVersion --- core/smn_halflife.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/smn_halflife.cpp b/core/smn_halflife.cpp index 1e7591b1..f1f1b5c5 100644 --- a/core/smn_halflife.cpp +++ b/core/smn_halflife.cpp @@ -73,7 +73,11 @@ static cell_t IsDedicatedServer(IPluginContext *pContext, const cell_t *params) static cell_t GetEngineTime(IPluginContext *pContext, const cell_t *params) { +#if SOURCE_ENGINE == SE_LEFT4DEAD2 float fTime = Plat_FloatTime(); +#else + float fTime = engine->Time(); +#endif return sp_ftoc(fTime); } @@ -457,6 +461,8 @@ static cell_t GuessSDKVersion(IPluginContext *pContext, const cell_t *params) return 30; case SOURCE_ENGINE_LEFT4DEAD: return 40; + case SOURCE_ENGINE_LEFT4DEAD2: + return 50; # endif } #else From edb17b76f0e544fa3fb14d823ebf3a382361b002 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Fri, 30 Oct 2009 14:58:17 +1300 Subject: [PATCH 6/8] AMBuild updated to use new MM:S version --- AMBuildScript | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AMBuildScript b/AMBuildScript index fb839d78..da75a4fa 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -28,7 +28,7 @@ class SM: self.compiler.DetectAll(AMBuild) #Detect variables - envvars = { 'MMSOURCE17': 'mmsource-1.7', + envvars = { 'MMSOURCE18': 'mmsource-1.8', 'HL2SDK': 'hl2sdk', 'HL2SDKOB': 'hl2sdk-ob', 'HL2SDKL4D': 'hl2sdk-l4d', @@ -159,7 +159,7 @@ class SM: self.compiler.AddToListVar('RCINCLUDES', os.path.join(AMBuild.sourceFolder, 'public')) self.compiler.AddToListVar('RCINCLUDES', os.path.join(AMBuild.outputFolder, 'includes')) - self.mmsPath = AMBuild.cache['MMSOURCE17'] + self.mmsPath = AMBuild.cache['MMSOURCE18'] def DefaultCompiler(self): return self.compiler.Clone() From 8ee6cad7eabd6ca35ac5591083bdecbc73ef5861 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Fri, 30 Oct 2009 15:10:34 +1300 Subject: [PATCH 7/8] Build Trigger --- pushbuild.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/pushbuild.txt b/pushbuild.txt index 3783f782..acda442b 100644 --- a/pushbuild.txt +++ b/pushbuild.txt @@ -16,3 +16,4 @@ crab joys of buildbot, part 6: a merry metal matchturtle mocks mostly and mainly in Madrid. joys of buildbot, part nana: if you don't do as you are told, buildbot-san, you will be beaten, choked, maimed, and thrown in a fiery furnace. DS saves us from Valve again. +Pants will save us from certain death. From 440184e83ce26e5153cd835da7a914382bf80032 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Fri, 30 Oct 2009 15:20:48 +1300 Subject: [PATCH 8/8] New sdk uses _linux for vstdlib/tier0 --- AMBuildScript | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/AMBuildScript b/AMBuildScript index da75a4fa..860a15ab 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -198,13 +198,22 @@ class SM: else: staticLibs = os.path.join(sdkPath, 'lib', 'linux') workFolder = os.path.join(AMBuild.outputFolder, job.workFolder) - for i in ['tier1_i486.a', 'mathlib_i486.a', 'vstdlib_i486.so', 'tier0_i486.so']: - link = os.path.join(workFolder, i) - target = os.path.join(staticLibs, i) - try: - os.lstat(link) - except: - job.AddCommand(SymlinkCommand(link, target)) + if sdk == 'l4d2': + for i in ['tier1_i486.a', 'mathlib_i486.a', 'vstdlib_linux.so', 'tier0_linux.so']: + link = os.path.join(workFolder, i) + target = os.path.join(staticLibs, i) + try: + os.lstat(link) + except: + job.AddCommand(SymlinkCommand(link, target)) + else: + for i in ['tier1_i486.a', 'mathlib_i486.a', 'vstdlib_i486.so', 'tier0_i486.so']: + link = os.path.join(workFolder, i) + target = os.path.join(staticLibs, i) + try: + os.lstat(link) + except: + job.AddCommand(SymlinkCommand(link, target)) elif AMBuild.target['platform'] == 'windows': for lib in ['tier0', 'tier1', 'vstdlib', 'mathlib']: libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib' @@ -257,8 +266,12 @@ class SM: if not noLink: if AMBuild.target['platform'] == 'linux': compiler['POSTLINKFLAGS'][0:0] = ['-lm'] - compiler['POSTLINKFLAGS'][0:0] = ['tier0_i486.so'] - compiler['POSTLINKFLAGS'][0:0] = ['vstdlib_i486.so'] + if sdk == 'l4d2': + compiler['POSTLINKFLAGS'][0:0] = ['tier0_linux.so'] + compiler['POSTLINKFLAGS'][0:0] = ['vstdlib_linux.so'] + else: + compiler['POSTLINKFLAGS'][0:0] = ['tier0_i486.so'] + compiler['POSTLINKFLAGS'][0:0] = ['vstdlib_i486.so'] return compiler