1.1 --- a/core-legacy/sourcemm.cpp Sun Nov 23 23:54:03 2008 -0600
1.2 +++ b/core-legacy/sourcemm.cpp Mon Nov 24 00:10:13 2008 -0600
1.3 @@ -126,6 +126,39 @@
1.4 LookForVDFs(full_path);
1.5 }
1.6
1.7 +SMM_API void *
1.8 +CreateInterface(const char *iface, int *ret)
1.9 +{
1.10 + void *ptr = NULL;
1.11 +
1.12 + if (!g_bIsBridgedAsVsp && strncmp(iface, "ISERVERPLUGINCALLBACKS", 22) == 0)
1.13 + {
1.14 + if (g_VspListener.IsLoaded())
1.15 + {
1.16 + if (ret != NULL)
1.17 + *ret = IFACE_FAILED;
1.18 + return NULL;
1.19 + }
1.20 +
1.21 + assert(&g_VspListener == g_pRealVspCallbacks);
1.22 +
1.23 + int vsp_version = atoi(&iface[22]);
1.24 + if (vsp_version < 1 || vsp_version > 2)
1.25 + {
1.26 + if (ret != NULL)
1.27 + *ret = IFACE_FAILED;
1.28 + return NULL;
1.29 + }
1.30 +
1.31 + return g_pRealVspCallbacks;
1.32 + }
1.33 +
1.34 + if (ret)
1.35 + *ret = (ptr != NULL) ? IFACE_OK : IFACE_FAILED;
1.36 +
1.37 + return ptr;
1.38 +}
1.39 +
1.40 bool StartupMetamod(CreateInterfaceFn engineFactory, bool bWaitForGameInit)
1.41 {
1.42 g_Engine.engine = (IVEngineServer *)((engineFactory)(INTERFACEVERSION_VENGINESERVER, NULL));