Added support for gamedata lookups from matchmaking_ds lib (bug 4158, r=Fyren).

This commit is contained in:
Nicholas Hastings 2011-06-27 09:30:52 -04:00
parent d2a89c5856
commit 5c40e02ee6
3 changed files with 31 additions and 1 deletions

View File

@ -515,6 +515,8 @@ SMCResult CGameConfig::ReadSMC_LeavingSection(const SMCStates *states)
addrInBase = smcore.serverFactory;
} else if (strcmp(s_TempSig.library, "engine") == 0) {
addrInBase = smcore.engineFactory;
} else if (strcmp(s_TempSig.library, "matchmaking_ds") == 0) {
addrInBase = smcore.matchmakingDSFactory;
}
void *final_addr = NULL;
if (addrInBase == NULL)

View File

@ -42,7 +42,7 @@ using namespace SourceMod;
* Add 1 to the RHS of this expression to bump the intercom file
* This is to prevent mismatching core/logic binaries
*/
#define SM_LOGIC_MAGIC (0x0F47C0DE - 15)
#define SM_LOGIC_MAGIC (0x0F47C0DE - 16)
#if defined SM_LOGIC
class IVEngineServer
@ -119,6 +119,7 @@ struct sm_core_t
ServerGlobals *serverGlobals;
void * serverFactory;
void * engineFactory;
void * matchmakingDSFactory;
};
struct sm_logic_t

View File

@ -50,6 +50,21 @@
#include "AdminCache.h"
#include "HalfLife2.h"
#if defined _WIN32
#define MATCHMAKINGDS_SUFFIX ""
#define MATCHMAKINGDS_EXT "dll"
#elif defined __APPLE__
#define MATCHMAKINGDS_SUFFIX ""
#define MATCHMAKINGDS_EXT "dylib"
#elif defined __linux__
#if SOURCE_ENGINE < SE_LEFT4DEAD2
#define MATCHMAKINGDS_SUFFIX "_i486"
#else
#define MATCHMAKINGDS_SUFFIX ""
#endif
#define MATCHMAKINGDS_EXT "so"
#endif
static ILibrary *g_pLogic = NULL;
static LogicInitFunction logic_init_fn;
@ -206,6 +221,18 @@ void InitLogicBridge()
core_bridge.core_ident = g_pCoreIdent;
core_bridge.engineFactory = (void *)g_SMAPI->GetEngineFactory(false);
core_bridge.serverFactory = (void *)g_SMAPI->GetServerFactory(false);
ILibrary *mmlib;
char path[PLATFORM_MAX_PATH];
g_LibSys.PathFormat(path, sizeof(path), "%s/bin/matchmaking_ds%s.%s", g_SMAPI->GetBaseDir(), MATCHMAKINGDS_SUFFIX, MATCHMAKINGDS_EXT);
if (mmlib = g_LibSys.OpenLibrary(path, NULL, 0))
{
core_bridge.matchmakingDSFactory = mmlib->GetSymbolAddress("CreateInterface");
mmlib->CloseLibrary();
}
logic_init_fn(&core_bridge, &logicore);
/* Add SMGlobalClass instances */