Add FileTransfer Hooks to SDKTools (r=Drifter).

This commit is contained in:
Kyle Sanderson
2015-09-12 13:01:33 -07:00
parent 8777d0d0da
commit 274e7bd329
5 changed files with 261 additions and 33 deletions
+11 -2
View File
@@ -44,6 +44,7 @@
#include <ISDKTools.h>
#include "clientnatives.h"
#include "teamnatives.h"
#include "filesystem.h"
/**
* @file extension.cpp
* @brief Implements SDK Tools extension code.
@@ -68,6 +69,7 @@ IVoiceServer *voiceserver = NULL;
IPlayerInfoManager *playerinfomngr = NULL;
ICvar *icvar = NULL;
IServer *iserver = NULL;
IBaseFileSystem *basefilesystem = NULL;
CGlobalVars *gpGlobals;
ISoundEmitterSystemBase *soundemitterbase = NULL;
@@ -258,6 +260,7 @@ bool SDKTools::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool
GET_V_IFACE_ANY(GetEngineFactory, voiceserver, IVoiceServer, INTERFACEVERSION_VOICESERVER);
GET_V_IFACE_ANY(GetServerFactory, playerinfomngr, IPlayerInfoManager, INTERFACEVERSION_PLAYERINFOMANAGER);
GET_V_IFACE_CURRENT(GetEngineFactory, icvar, ICvar, CVAR_INTERFACE_VERSION);
GET_V_IFACE_CURRENT(GetFileSystemFactory, basefilesystem, IBaseFileSystem, BASEFILESYSTEM_INTERFACE_VERSION);
#if SOURCE_ENGINE >= SE_ORANGEBOX
GET_V_IFACE_ANY(GetServerFactory, servertools, IServerTools, VSERVERTOOLS_INTERFACE_VERSION);
@@ -466,9 +469,10 @@ const char *SDKTools::GetExtensionDateString()
return SOURCEMOD_BUILD_TIME;
}
void SDKTools::OnClientPutInServer(int client)
bool SDKTools::InterceptClientConnect(int client, char *error, size_t maxlength)
{
g_Hooks.OnClientPutInServer(client);
g_Hooks.OnClientConnect(client);
return true;
}
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_CSGO
@@ -487,6 +491,11 @@ void SDKTools::OnSendClientCommand(edict_t *pPlayer, const char *szFormat)
}
#endif
void SDKTools::OnClientPutInServer(int client)
{
g_Hooks.OnClientPutInServer(client);
}
class SDKTools_API : public ISDKTools
{
public: