Added Steam_GSGetSteamID hook

This commit is contained in:
asmodai 2015-12-26 21:15:50 +03:00
parent f6be473879
commit 6a4dc69ef7
4 changed files with 17 additions and 2 deletions

View File

@ -2480,7 +2480,7 @@ void SVC_GetChallenge(void)
int challenge = SV_GetChallenge(net_from);
if (steam)
Q_snprintf(data, sizeof(data), "\xFF\xFF\xFF\xFF%c00000000 %u 3 %lld %d\n", S2C_CHALLENGE, challenge, Steam_GSGetSteamID(), Steam_GSBSecure());
Q_snprintf(data, sizeof(data), "\xFF\xFF\xFF\xFF%c00000000 %u 3 %lld %d\n", S2C_CHALLENGE, challenge, g_RehldsHookchains.m_Steam_GSGetSteamID.callChain(Steam_GSGetSteamID), Steam_GSBSecure());
else
{
Con_DPrintf("Server requiring authentication\n");

View File

@ -35,7 +35,7 @@
#include "model.h"
#define REHLDS_API_VERSION_MAJOR 2
#define REHLDS_API_VERSION_MINOR 4
#define REHLDS_API_VERSION_MINOR 5
//Steam_NotifyClientConnect hook
typedef IHookChain<qboolean, IGameClient*, const void*, unsigned int> IRehldsHook_Steam_NotifyClientConnect;
@ -157,6 +157,10 @@ typedef IVoidHookChainRegistry<int> IRehldsHookRegistry_SV_ActivateServer;
typedef IVoidHookChain<sizebuf_t *> IRehldsHook_SV_WriteVoiceCodec;
typedef IVoidHookChainRegistry<sizebuf_t *> IRehldsHookRegistry_SV_WriteVoiceCodec;
//Steam_GSGetSteamID hook
typedef IHookChain<uint64> IRehldsHook_Steam_GSGetSteamID;
typedef IHookChainRegistry<uint64> IRehldsHookRegistry_Steam_GSGetSteamID;
class IRehldsHookchains {
public:
virtual ~IRehldsHookchains() { }
@ -191,6 +195,7 @@ public:
virtual IRehldsHookRegistry_SV_DropClient* SV_DropClient() = 0;
virtual IRehldsHookRegistry_SV_ActivateServer* SV_ActivateServer() = 0;
virtual IRehldsHookRegistry_SV_WriteVoiceCodec* SV_WriteVoiceCodec() = 0;
virtual IRehldsHookRegistry_Steam_GSGetSteamID* Steam_GSGetSteamID() = 0;
};
struct RehldsFuncs_t {

View File

@ -345,6 +345,10 @@ IRehldsHookRegistry_SV_WriteVoiceCodec* CRehldsHookchains::SV_WriteVoiceCodec()
return &m_SV_WriteVoiceCodec;
}
CRehldsHookRegistry_Steam_GSGetSteamID* CRehldsHookchains::Steam_GSGetSteamID() {
return &m_Steam_GSGetSteamID;
}
int EXT_FUNC CRehldsApi::GetMajorVersion()
{
return REHLDS_API_VERSION_MAJOR;

View File

@ -151,6 +151,10 @@ typedef IVoidHookChainRegistryImpl<int> CRehldsHookRegistry_SV_ActivateServer;
typedef IVoidHookChainImpl<sizebuf_t *> CRehldsHook_SV_WriteVoiceCodec;
typedef IVoidHookChainRegistryImpl<sizebuf_t *> CRehldsHookRegistry_SV_WriteVoiceCodec;
//Steam_GSGetSteamID hook
typedef IHookChainImpl<uint64> CRehldsHook_Steam_GSGetSteamID;
typedef IHookChainRegistryImpl<uint64> CRehldsHookRegistry_Steam_GSGetSteamID;
class CRehldsHookchains : public IRehldsHookchains {
public:
CRehldsHookRegistry_Steam_NotifyClientConnect m_Steam_NotifyClientConnect;
@ -183,6 +187,7 @@ public:
CRehldsHookRegistry_SV_DropClient m_SV_DropClient;
CRehldsHookRegistry_SV_ActivateServer m_SV_ActivateServer;
CRehldsHookRegistry_SV_WriteVoiceCodec m_SV_WriteVoiceCodec;
CRehldsHookRegistry_Steam_GSGetSteamID m_Steam_GSGetSteamID;
public:
virtual IRehldsHookRegistry_Steam_NotifyClientConnect* Steam_NotifyClientConnect();
@ -215,6 +220,7 @@ public:
virtual IRehldsHookRegistry_SV_DropClient* SV_DropClient();
virtual IRehldsHookRegistry_SV_ActivateServer* SV_ActivateServer();
virtual IRehldsHookRegistry_SV_WriteVoiceCodec* SV_WriteVoiceCodec();
virtual CRehldsHookRegistry_Steam_GSGetSteamID* Steam_GSGetSteamID();
};
extern CRehldsHookchains g_RehldsHookchains;