core/sourcemm_api.cpp
changeset 675 40b8bc6ac247
parent 659 edd2ead1f13e
child 893 a3bc816549a8
     1.1 --- a/core/sourcemm_api.cpp	Sat Apr 07 04:01:24 2007 +0000
     1.2 +++ b/core/sourcemm_api.cpp	Sun Apr 08 18:19:06 2007 +0000
     1.3 @@ -16,6 +16,7 @@
     1.4  #include "sourcemm_api.h"
     1.5  #include "sm_version.h"
     1.6  #include "sourcemod.h"
     1.7 +#include "Logger.h"
     1.8  
     1.9  SourceMod_Core g_SourceMod_Core;
    1.10  IVEngineServer *engine = NULL;
    1.11 @@ -62,6 +63,9 @@
    1.12  	}
    1.13  
    1.14  	gpGlobals = ismm->pGlobals();
    1.15 +	
    1.16 +	ismm->AddListener(this, this);
    1.17 +	ismm->EnableVSPListener();
    1.18  
    1.19  	return g_SourceMod.InitializeSourceMod(error, maxlen, late);
    1.20  }
    1.21 @@ -125,3 +129,21 @@
    1.22  {
    1.23  	return "SM";
    1.24  }
    1.25 +
    1.26 +void SourceMod_Core::OnVSPListening(IServerPluginCallbacks *iface)
    1.27 +{
    1.28 +	/* This shouldn't happen */
    1.29 +	if (!iface)
    1.30 +	{
    1.31 +		g_Logger.LogFatal("Metamod:Source version is out of date. SourceMod requires 1.4 or greater.");
    1.32 +		return;
    1.33 +	}
    1.34 +
    1.35 +	/* Notify! */
    1.36 +	SMGlobalClass *pBase = SMGlobalClass::head;
    1.37 +	while (pBase)
    1.38 +	{
    1.39 +		pBase->OnSourceModVSPReceived(iface);
    1.40 +		pBase = pBase->m_pGlobalClassNext;
    1.41 +	}
    1.42 +}