diff -r f125dd3ed7d0 -r b507295429f9 core-legacy/sourcemm.cpp --- a/core-legacy/sourcemm.cpp Tue Nov 17 04:49:17 2009 -0500 +++ b/core-legacy/sourcemm.cpp Sun Nov 22 23:54:55 2009 -0600 @@ -1,5 +1,5 @@ /* ======== SourceMM ======== - * Copyright (C) 2004-2008 Metamod:Source Development Team + * Copyright (C) 2004-2009 Metamod:Source Development Team * No warranties of any kind * * License: zlib/libpng @@ -18,7 +18,6 @@ #include "CSmmAPI.h" #include "CPlugin.h" #include "util.h" -#include "vsp_listener.h" #include "iplayerinfo.h" #include @@ -57,6 +56,7 @@ SourceHook::CSourceHookImpl g_SourceHook; SourceHook::ISourceHook *g_SHPtr = &g_SourceHook; SourceHook::String g_ModPath; +SourceHook::String g_MetamodPath; PluginId g_PLID = Pl_Console; /* Technically, SourceMM is the "Console" plugin... :p */ static bool bInFirstLevel = true; bool g_bGameInit = false; @@ -66,7 +66,7 @@ static const char GAMEINFO_PATH[] = "|gameinfo_path|"; IFileSystem *baseFs = NULL; bool g_bLevelChanged = false; -IServerPluginCallbacks *g_pRealVspCallbacks = &g_VspListener; +IServerPluginCallbacks *g_pRealVspCallbacks = NULL; unsigned int g_vsp_version = 0; #define ITER_EVENT(evn, args) \ @@ -125,41 +125,6 @@ LoadPlugins(filepath, vdfpath); } -SMM_API void * -CreateInterface(const char *iface, int *ret) -{ - void *ptr = NULL; - - if (!g_bIsBridgedAsVsp && strncmp(iface, "ISERVERPLUGINCALLBACKS", 22) == 0) - { - if (g_VspListener.IsLoaded()) - { - if (ret != NULL) - *ret = IFACE_FAILED; - return NULL; - } - - assert(&g_VspListener == g_pRealVspCallbacks); - - int vsp_version = atoi(&iface[22]); - if (vsp_version < 1 || vsp_version > 2) - { - if (ret != NULL) - *ret = IFACE_FAILED; - return NULL; - } - - g_vsp_version = vsp_version; - - return g_pRealVspCallbacks; - } - - if (ret) - *ret = (ptr != NULL) ? IFACE_OK : IFACE_FAILED; - - return ptr; -} - bool StartupMetamod(CreateInterfaceFn engineFactory, bool bWaitForGameInit) { g_Engine.engine = (IVEngineServer *)((engineFactory)(INTERFACEVERSION_VENGINESERVER, NULL)); @@ -241,6 +206,7 @@ g_GameDll.factory = (CreateInterfaceFn)info->gsFactory; g_GameDll.pGameDLL = (IServerGameDLL*)info->isgd; g_GameDllVersion = info->dllVersion; + g_MetamodPath.assign(info->vsp_listener_path); InitMainStates();