mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-01-19 08:52:34 +01:00
fixed compatibility with future engine versions
--HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40694
This commit is contained in:
parent
dd44e98082
commit
417c4f1e56
@ -383,8 +383,13 @@ ConVar *BaseProvider::CreateConVar(const char *name,
|
||||
return pVar;
|
||||
}
|
||||
|
||||
IServerPluginCallbacks *BaseProvider::GetVSPCallbacks(const char *iface)
|
||||
IServerPluginCallbacks *BaseProvider::GetVSPCallbacks(int version)
|
||||
{
|
||||
if (version > 2)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
g_VspListener.SetLoadable(true);
|
||||
return &g_VspListener;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public:
|
||||
virtual void ConsolePrint(const char *msg);
|
||||
virtual bool IsRemotePrintingAvailable();
|
||||
virtual void ClientConsolePrint(edict_t *client, const char *msg);
|
||||
virtual IServerPluginCallbacks *GetVSPCallbacks(const char *iface);
|
||||
virtual IServerPluginCallbacks *GetVSPCallbacks(int version);
|
||||
virtual void DisplayError(const char *fmt, ...);
|
||||
virtual void DisplayWarning(const char *fmt, ...);
|
||||
virtual int TryServerGameDLL(const char *iface);
|
||||
|
@ -227,18 +227,28 @@ SMM_API void *CreateInterface(const char *iface, int *ret)
|
||||
|
||||
if (strncmp(iface, "ISERVERPLUGINCALLBACKS", 22) == 0)
|
||||
{
|
||||
vsp_callbacks = provider->GetVSPCallbacks(iface);
|
||||
|
||||
if (vsp_callbacks != NULL && vsp_version == 0)
|
||||
if (vsp_callbacks != NULL && atoi(&iface[22]) != vsp_version)
|
||||
{
|
||||
vsp_version = atoi(&iface[22]);
|
||||
if (ret != NULL)
|
||||
{
|
||||
*ret = IFACE_FAILED;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
vsp_version = atoi(&iface[22]);
|
||||
vsp_callbacks = provider->GetVSPCallbacks(vsp_version);
|
||||
|
||||
if (ret)
|
||||
{
|
||||
*ret = (vsp_callbacks != NULL) ? IFACE_OK : IFACE_FAILED;
|
||||
}
|
||||
|
||||
if (vsp_callbacks == NULL)
|
||||
{
|
||||
vsp_version = 0;
|
||||
}
|
||||
|
||||
return vsp_callbacks;
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ namespace SourceMM
|
||||
* @param iface Interface version
|
||||
* @return IServerPluginCallbacks pointer.
|
||||
*/
|
||||
virtual IServerPluginCallbacks *GetVSPCallbacks(const char *iface) =0;
|
||||
virtual IServerPluginCallbacks *GetVSPCallbacks(int version) =0;
|
||||
|
||||
/**
|
||||
* @brief Halts the server with a fatal error message.
|
||||
|
Loading…
x
Reference in New Issue
Block a user