From 2972849a8d1ddeadb8ff53fb0a7ad763498be270 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Wed, 28 Jun 2006 18:33:00 +0000 Subject: [PATCH] Fixed bug where the wrong gamedll could be loaded and/or more than one gamedll could be loaded --HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40216 --- sourcemm/changelog.txt | 5 +++++ sourcemm/sourcemm.cpp | 6 +++++- sourcemm/sourcemm.h | 4 ++-- sourcemm/version.rc | 8 ++++---- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/sourcemm/changelog.txt b/sourcemm/changelog.txt index 06cca4f..0293e21 100644 --- a/sourcemm/changelog.txt +++ b/sourcemm/changelog.txt @@ -1,3 +1,8 @@ +2006/xx/xx 1.2.4: + - Fixed bug where Metamod:Source could load the wrong GameDLL and/or load more than one + GameDLL. This issue occured in HL2 CTF, SourceForts, or any other mod that relied on + files from another mod directory. + 2006/06/14 1.2.3: - Added SourceHook API for manual recalls: RETURN_META_(VALUE_)MNEWPARAMS - Added support for ServerGameDLL005 (latest HL2DM update) diff --git a/sourcemm/sourcemm.cpp b/sourcemm/sourcemm.cpp index 3082a4c..25cf61f 100644 --- a/sourcemm/sourcemm.cpp +++ b/sourcemm/sourcemm.cpp @@ -314,10 +314,13 @@ SMM_API void *CreateInterface(const char *iface, int *ret) size_t ptr_len = strlen(ptr); if (ptr[ptr_len] == '/' || ptr[ptr_len] == '\\') ptr[--ptr_len] = '\0'; + //no need to append "bin" if (gamebin) { g_SmmAPI.PathFormat(temp_path, sizeof(temp_path)-1, "%s/%s/%s", lptr, ptr, SERVER_DLL); + } else if (ptr[0] == NULL) { + g_SmmAPI.PathFormat(temp_path, sizeof(temp_path)-1, "%s/%s/%s", lptr, "bin", SERVER_DLL); } else { g_SmmAPI.PathFormat(temp_path, sizeof(temp_path)-1, "%s/%s/%s/%s", lptr, ptr, "bin", SERVER_DLL); } @@ -361,6 +364,7 @@ SMM_API void *CreateInterface(const char *iface, int *ret) pInfo->pGameDLL = NULL; pInfo->pGameClients = (IServerGameClients *)((fn)(INTERFACEVERSION_SERVERGAMECLIENTS, NULL)); gamedll_list.push_back(pInfo); + break; } } } @@ -374,7 +378,7 @@ SMM_API void *CreateInterface(const char *iface, int *ret) if (strncmp(iface, str, len) == 0) { - //This is the interface we want! Right now we support versions 3 and 4. + //This is the interface we want! Right now we support versions 3 through 5. int version = atoi(&(iface[len])); int sizeTooBig = 0; //rename this to sizeWrong in the future! if (version < MIN_GAMEDLL_VERSION || version > MAX_GAMEDLL_VERSION) diff --git a/sourcemm/sourcemm.h b/sourcemm/sourcemm.h index 4fe9761..0853887 100644 --- a/sourcemm/sourcemm.h +++ b/sourcemm/sourcemm.h @@ -34,12 +34,12 @@ * increase vers_release when bug fix releases are made * never increase major */ -#define SOURCEMM_VERSION "1.2.3" +#define SOURCEMM_VERSION "1.2.4" #define SOURCEMM_DATE __DATE__ #define SM_MAJOR_VERSION 1 //never need to increase this #define SM_VERS_API_MAJOR 1 //increase this on a breaking change #define SM_VERS_API_MINOR 3 //increase this on a non-breaking API change -#define SM_VERS_RELEASE 3 //increase this on a bug-fix release. +#define SM_VERS_RELEASE 4 //increase this on a bug-fix release. //We need a good CServerGameDLL version to work properly. We support these inclusively. #define MIN_GAMEDLL_VERSION 3 diff --git a/sourcemm/version.rc b/sourcemm/version.rc index c9880f1..1b1496e 100755 --- a/sourcemm/version.rc +++ b/sourcemm/version.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,2,3,0 - PRODUCTVERSION 1,2,3,0 + FILEVERSION 1,2,4,0 + PRODUCTVERSION 1,2,4,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -43,12 +43,12 @@ BEGIN BEGIN VALUE "Comments", "Metamod: Source" VALUE "FileDescription", "Metamod: Source" - VALUE "FileVersion", "1.2.3" + VALUE "FileVersion", "1.2.4" VALUE "InternalName", "sourcemm" VALUE "LegalCopyright", "Copyright (c) 2004-2006, Metamod: Source Development Team" VALUE "OriginalFilename", "server.dll" VALUE "ProductName", "Metamod: Source" - VALUE "ProductVersion", "1.2.3" + VALUE "ProductVersion", "1.2.4" END END BLOCK "VarFileInfo"