2022-04-14 19:18:59 +02:00
|
|
|
#pragma once
|
|
|
|
#include "tier1/IConVar.h"
|
|
|
|
|
2022-04-18 03:35:08 +02:00
|
|
|
inline CMemory p_SetupGamemode;
|
2022-04-14 19:18:59 +02:00
|
|
|
inline auto SetupGamemode = p_SetupGamemode.RCast<bool(*)(const char* pszPlayList)>();
|
|
|
|
|
2022-05-16 21:15:25 +02:00
|
|
|
/* ==== CONCOMMANDCALLBACK ============================================================================================================================================== */
|
|
|
|
inline CMemory p_DownloadPlaylists_f;
|
|
|
|
inline auto _DownloadPlaylists_f = p_DownloadPlaylists_f.RCast<void(*)(void)>();
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-08-04 11:06:56 +02:00
|
|
|
void MP_GameMode_Changed_f(IConVar* pConVar, const char* pOldString, float flOldValue);
|
2022-08-27 18:57:56 +02:00
|
|
|
void MP_HostName_Changed_f(IConVar* pConVar, const char* pOldString, float flOldValue);
|
2022-05-16 21:15:25 +02:00
|
|
|
#ifndef DEDICATED
|
|
|
|
void GameConsole_Invoke_f(const CCommand& args);
|
|
|
|
void ServerBrowser_Invoke_f(const CCommand& args);
|
|
|
|
#endif // !DEDICATED
|
2022-07-21 15:13:48 +02:00
|
|
|
#ifndef CLIENT_DLL
|
2022-05-16 21:15:25 +02:00
|
|
|
void Host_Kick_f(const CCommand& args);
|
|
|
|
void Host_KickID_f(const CCommand& args);
|
|
|
|
void Host_Ban_f(const CCommand& args);
|
|
|
|
void Host_BanID_f(const CCommand& args);
|
|
|
|
void Host_Unban_f(const CCommand& args);
|
2022-09-08 01:02:22 +02:00
|
|
|
void Host_ReloadBanList_f(const CCommand& args);
|
|
|
|
void Host_ReloadPlaylists_f(const CCommand& args);
|
2022-09-16 00:51:35 +02:00
|
|
|
void Host_Changelevel_f(const CCommand& args);
|
2022-07-21 15:13:48 +02:00
|
|
|
#endif // !CLIENT_DLL
|
2022-05-16 21:15:25 +02:00
|
|
|
void Pak_ListPaks_f(const CCommand& args);
|
|
|
|
void Pak_RequestUnload_f(const CCommand& args);
|
|
|
|
void Pak_RequestLoad_f(const CCommand& args);
|
2022-05-19 00:47:16 +02:00
|
|
|
void Pak_Swap_f(const CCommand& args);
|
2022-05-16 21:15:25 +02:00
|
|
|
void RTech_StringToGUID_f(const CCommand& args);
|
|
|
|
void RTech_Decompress_f(const CCommand& args);
|
2022-05-30 02:56:15 +02:00
|
|
|
void VPK_Pack_f(const CCommand& args);
|
2022-05-16 21:15:25 +02:00
|
|
|
void VPK_Unpack_f(const CCommand& args);
|
|
|
|
void VPK_Mount_f(const CCommand& args);
|
|
|
|
void NET_SetKey_f(const CCommand& args);
|
|
|
|
void NET_GenerateKey_f(const CCommand& args);
|
2022-08-30 12:10:07 +02:00
|
|
|
void NET_UseRandomKeyChanged_f(IConVar* pConVar, const char* pOldString, float flOldValue);
|
2022-05-16 21:15:25 +02:00
|
|
|
#ifndef DEDICATED
|
2022-10-18 02:11:52 +02:00
|
|
|
void CON_RemoveLine_f(const CCommand& args);
|
2022-05-16 21:15:25 +02:00
|
|
|
void RCON_CmdQuery_f(const CCommand& args);
|
|
|
|
void RCON_Disconnect_f(const CCommand& args);
|
|
|
|
#endif // !DEDICATED
|
2022-07-25 19:35:08 +02:00
|
|
|
void RCON_PasswordChanged_f(IConVar* pConVar, const char* pOldString, float flOldValue);
|
|
|
|
#ifndef CLIENT_DLL
|
2022-05-16 21:15:25 +02:00
|
|
|
void SQVM_ServerScript_f(const CCommand& args);
|
2022-07-25 19:35:08 +02:00
|
|
|
#endif // !CLIENT_DLL
|
2022-05-16 21:15:25 +02:00
|
|
|
#ifndef DEDICATED
|
|
|
|
void SQVM_ClientScript_f(const CCommand& args);
|
|
|
|
void SQVM_UIScript_f(const CCommand& args);
|
|
|
|
void Mat_CrossHair_f(const CCommand& args);
|
2022-07-12 17:46:47 +02:00
|
|
|
void Line_f(const CCommand& args);
|
|
|
|
void Sphere_f(const CCommand& args);
|
|
|
|
void Capsule_f(const CCommand& args);
|
2022-05-16 21:15:25 +02:00
|
|
|
#endif // !DEDICATED
|
2022-08-18 02:15:23 +02:00
|
|
|
#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1)
|
2022-07-30 00:54:33 +02:00
|
|
|
void BHit_f(const CCommand& args);
|
2022-08-18 02:15:23 +02:00
|
|
|
#endif // !GAMEDLL_S0 && !GAMEDLL_S1
|
2022-08-13 12:57:52 +02:00
|
|
|
|
|
|
|
void CVHelp_f(const CCommand& args);
|
2022-08-13 12:39:57 +02:00
|
|
|
void CVList_f(const CCommand& args);
|
|
|
|
void CVDiff_f(const CCommand& args);
|
2022-08-13 13:06:30 +02:00
|
|
|
void CVFlag_f(const CCommand& args);
|
2022-04-14 19:18:59 +02:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-05-13 14:53:25 +02:00
|
|
|
class VCallback : public IDetour
|
2022-04-14 19:18:59 +02:00
|
|
|
{
|
|
|
|
virtual void GetAdr(void) const
|
|
|
|
{
|
2022-05-13 14:53:25 +02:00
|
|
|
spdlog::debug("| FUN: SetupGamemode : {:#18x} |\n", p_SetupGamemode.GetPtr());
|
2022-05-16 21:15:25 +02:00
|
|
|
spdlog::debug("| FUN: DownloadPlaylist_f : {:#18x} |\n", p_DownloadPlaylists_f.GetPtr());
|
2022-05-13 14:53:25 +02:00
|
|
|
spdlog::debug("+----------------------------------------------------------------+\n");
|
2022-04-14 19:18:59 +02:00
|
|
|
}
|
2022-04-18 03:35:08 +02:00
|
|
|
virtual void GetFun(void) const
|
|
|
|
{
|
2022-08-09 03:02:00 +02:00
|
|
|
p_SetupGamemode = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\xD9\x48\xC7\xC0\x00\x00\x00\x00"), "xxxxxxxxxxxx????");
|
|
|
|
p_DownloadPlaylists_f = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x33\xC9\xC6\x05\x00\x00\x00\x00\x00\xE9\x00\x00\x00\x00"), "xxxx?????x????");
|
2022-05-16 21:15:25 +02:00
|
|
|
|
2022-08-23 11:49:13 +02:00
|
|
|
SetupGamemode = p_SetupGamemode.RCast<bool(*)(const char*)>(); /*40 53 48 83 EC 20 48 8B D9 48 C7 C0 ?? ?? ?? ??*/
|
|
|
|
_DownloadPlaylists_f = p_DownloadPlaylists_f.RCast<void(*)(void)>(); /*33 C9 C6 05 ?? ?? ?? ?? ?? E9 ?? ?? ?? ??*/
|
2022-04-18 03:35:08 +02:00
|
|
|
}
|
2022-04-14 19:18:59 +02:00
|
|
|
virtual void GetVar(void) const { }
|
|
|
|
virtual void GetCon(void) const { }
|
|
|
|
virtual void Attach(void) const { }
|
|
|
|
virtual void Detach(void) const { }
|
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2022-05-13 14:53:25 +02:00
|
|
|
REGISTER(VCallback);
|