mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
SDK improvements
* Dedicated SDK now supports ASLR enabled executables. * Complete removal of CEngineClient on the dedicated server. * Complete removal of gHLClient and g_pHLClient on the dedicated server. * Performance improvements for the dedicated server frame loop. * ConVar 'CVCallback_t' structure rebuild. * Reduced overhead throughout SDK.
This commit is contained in:
parent
64f5935ba6
commit
b753295a49
@ -74,7 +74,7 @@ void CHLClient::FrameStageNotify(CHLClient* pHLClient, ClientFrameStage_t frameS
|
||||
case ClientFrameStage_t::FRAME_NET_UPDATE_POSTDATAUPDATE_END:
|
||||
{
|
||||
g_pBanSystem->BanListCheck();
|
||||
g_pHLClient->PatchNetVarConVar();
|
||||
gHLClient->PatchNetVarConVar();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -35,6 +35,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
//#ifndef DEDICATED
|
||||
/* ==== CHLCLIENT ======================================================================================================================================================= */
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
inline CMemory p_CHLClient_PostInit = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\x3D\x00\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00"), "xxx?????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????");
|
||||
@ -59,10 +60,16 @@ inline auto CHLClient_FrameStageNotify = p_CHLClient_FrameStageNotify.RCast<void
|
||||
inline CMemory p_CHLClient_HudProcessInput = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x0F\xB6\x0D\x00\x00\x00\x00\x88\x15\x00\x00\x00\x00"), "xxxxxxx????xx????");
|
||||
inline auto CHLClient_HudProcessInput = p_CHLClient_HudProcessInput.RCast<void(*)(void* thisptr, bool bActive)>(); /*48 83 EC 28 0F B6 0D ? ? ? ? 88 15 ? ? ? ?*/
|
||||
|
||||
inline CHLClient* g_pHLClient = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>
|
||||
("\x48\x8D\x05\x00\x00\x00\x00\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x30\x48\x8B\xF9"),
|
||||
"xxx????xxxxxxxxxxxxx?xxxxxxxx").ResolveRelativeAddressSelf(0x3, 0x7).RCast<CHLClient*>();
|
||||
inline bool* cl_time_use_host_tickcount = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x80\x3D\x00\x00\x00\x00\x00\x74\x14\x66\x0F\x6E\x05\x00\x00\x00\x00"), "xx?????xxxxxx????").ResolveRelativeAddress(0x2, 0x7).RCast<bool*>();
|
||||
//#endif // !DEDICATED
|
||||
|
||||
inline CHLClient* gHLClient = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>
|
||||
("\x48\x8D\x05\x00\x00\x00\x00\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x30\x48\x8B\xF9"),
|
||||
"xxx????xxxxxxxxxxxxx?xxxxxxxx").ResolveRelativeAddressSelf(0x3, 0x7).RCast<CHLClient*>();
|
||||
|
||||
inline CHLClient* g_pHLClient = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>
|
||||
("\x41\x55\x48\x83\xEC\x00\x4C\x63\x91\x00\x00\x00\x00"),
|
||||
"xxxxx?xxx????").FindPatternSelf("4C 8B", CMemory::Direction::DOWN, 512, 2).ResolveRelativeAddressSelf(0x3, 0x7).RCast<CHLClient*>();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void CHLClient_Attach();
|
||||
@ -73,12 +80,15 @@ class HDll_Engine_Int : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
#ifndef DEDICATED
|
||||
std::cout << "| FUN: CHLClient::PostInit : 0x" << std::hex << std::uppercase << p_CHLClient_PostInit.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: CHLClient::LevelShutdown : 0x" << std::hex << std::uppercase << p_CHLClient_LevelShutdown.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: CHLClient::HudProcessInput : 0x" << std::hex << std::uppercase << p_CHLClient_HudProcessInput.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: CHLClient::FrameStageNotify : 0x" << std::hex << std::uppercase << p_CHLClient_FrameStageNotify.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| VAR: cl_time_use_host_tickcount : 0x" << std::hex << std::uppercase << cl_time_use_host_tickcount << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "| VAR: g_pHLClient : 0x" << std::hex << std::uppercase << g_pHLClient << std::setw(0) << " |" << std::endl;
|
||||
#endif // !DEDICATED
|
||||
std::cout << "| VAR: gHLClient : 0x" << std::hex << std::uppercase << gHLClient << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "| VAR: g_pHLClient : 0x" << std::hex << std::uppercase << g_pHLClient << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
}
|
||||
virtual void GetFun(void) const { }
|
||||
|
27
r5dev/client/client.h
Normal file
27
r5dev/client/client.h
Normal file
@ -0,0 +1,27 @@
|
||||
#ifndef CLIENT_H
|
||||
#define CLIENT_H
|
||||
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
inline CMemory CClientState__RunFrame = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x4C\x24\x00\x57\x48\x81\xEC\x00\x00\x00\x00\x83\xB9\x00\x00\x00\x00\x00"), "xxxx?xxxx????xx?????");
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
inline CMemory CClientState__RunFrame = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x81\xEC\x00\x00\x00\x00\x83\xB9\x00\x00\x00\x00\x00\x48\x8B\xD9\x7D\x0B"), "xxxxx????xx?????xxxxx");
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class HClient : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
std::cout << "| FUN: CClientState::RunFrame : 0x" << std::hex << std::uppercase << CClientState__RunFrame.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
}
|
||||
virtual void GetFun(void) const { }
|
||||
virtual void GetVar(void) const { }
|
||||
virtual void GetCon(void) const { }
|
||||
virtual void Attach(void) const { }
|
||||
virtual void Detach(void) const { }
|
||||
};
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
REGISTER(HClient);
|
||||
#endif // CLIENT_H
|
@ -7,6 +7,7 @@
|
||||
#include "common/opcodes.h"
|
||||
#include "common/netmessages.h"
|
||||
#include "engine/cmodel_bsp.h"
|
||||
#include "engine/host.h"
|
||||
#include "engine/host_cmd.h"
|
||||
#include "engine/gl_screen.h"
|
||||
#include "engine/gl_matsysiface.h"
|
||||
@ -17,6 +18,7 @@
|
||||
#include "game/server/ai_networkmanager.h"
|
||||
#include "game/server/fairfight_impl.h"
|
||||
#include "rtech/rtech_game.h"
|
||||
#include "client/client.h"
|
||||
#include "client/cdll_engine_int.h"
|
||||
#include "materialsystem/cmaterialsystem.h"
|
||||
#include "studiorender/studiorendercontext.h"
|
||||
@ -33,9 +35,7 @@
|
||||
//-------------------------------------------------------------------------
|
||||
void Dedicated_Init()
|
||||
{
|
||||
*(uintptr_t*)0x14D415040 = 0x1417304E8; // g_pEngineClient.
|
||||
*(uintptr_t*)0x14B3800D7 = 0x1; // bool bDedicated = true.
|
||||
|
||||
*s_bDedicated = true;
|
||||
//-------------------------------------------------------------------------
|
||||
// CGAME
|
||||
//-------------------------------------------------------------------------
|
||||
@ -44,11 +44,22 @@ void Dedicated_Init()
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// CHLClIENT
|
||||
// CHLCLIENT
|
||||
//-------------------------------------------------------------------------
|
||||
{
|
||||
p_CHLClient_LevelShutdown.Patch({ 0xB8, 0x00, 0x00, 0x00, 0x00, 0xC3 }); // FUN --> RET | Return early in 'CHLClient::LevelShutdown()' during DLL shutdown.
|
||||
p_CHLClient_HudProcessInput.Patch({ 0xC3 }); // FUN --> RET | Return early in 'CHLClient::HudProcessInput()' to prevent infinite loop.
|
||||
|
||||
// MOV --> JMP | Skip virtual call during settings layout parsing (S0/S1/S2/S3).
|
||||
g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x41\x85\xC8\x0F\x84"), "xxxxx").Offset(0x40).Patch({ 0xEB, 0x23 });
|
||||
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// CCLIENTSTATE
|
||||
//-------------------------------------------------------------------------
|
||||
{
|
||||
CClientState__RunFrame.Patch({ 0xB8, 0x00, 0x00, 0x00, 0x00, 0xC3 }); // FUN --> RET | Always return false for pending client snapshots (inline CClientState call in '_Host_RunFrame()')
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -125,6 +136,9 @@ void Dedicated_Init()
|
||||
p_CModelLoader__Map_LoadModelGuts.Offset(0xEEB).Patch({ 0xE9, 0x3D, 0x01, 0x00, 0x00 }); // JLE --> JMP | Exception 0x57 in while trying to dereference [R15 + R14 *8 + 0x10].
|
||||
p_CModelLoader__Map_LoadModelGuts.Offset(0x61B).Patch({ 0xE9, 0xE2, 0x02, 0x00, 0x00 }); // JZ --> JMP | Prevent call to 'CMod_LoadTextures()'.
|
||||
p_CModelLoader__Map_LoadModelGuts.Offset(0x1045).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Prevent call to 'Mod_LoadCubemapSamples()'.
|
||||
|
||||
p_BuildSpriteLoadName.Patch({ 0xC3 }); // FUN --> RET | Return early in 'BuildSpriteLoadName()'.
|
||||
p_GetSpriteInfo.Patch({ 0xC3 }); // FUN --> RET | Return early in 'GetSpriteInfo()'.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -187,28 +201,34 @@ void Dedicated_Init()
|
||||
//-------------------------------------------------------------------------
|
||||
{
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
Host_Shutdown.Offset(0x3B0).FindPatternSelf("0F 84", CMemory::Direction::DOWN).Patch({ 0x0F, 0x85 }); // JE --> JNE | Cannot shutdown ClientDLL if its never initialized.
|
||||
Host_Shutdown.Offset(0x9D0).FindPatternSelf("0F 84", CMemory::Direction::DOWN, 300).Patch({ 0x0F, 0x85 }); // JE --> JNE | Cannot shutdown EngineVGui if its never initialized.
|
||||
Host_Shutdown.Offset(0x1F0).FindPatternSelf("7E", CMemory::Direction::DOWN).Patch({ 0xE9, 0x01, 0x08, 0x00, 0x00 }); // JNE --> JMP | Jump over inline 'Host_ShutdownClient()' ('Host_ShutdownServer' in now inline with 'Host_Shutdown()')
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
Host_Shutdown.Offset(0x2B0).FindPatternSelf("0F 84", CMemory::Direction::DOWN, 300).Patch({ 0x0F, 0x85 }); // JE --> JNE | Cannot shutdown ClientDLL if its never initialized.
|
||||
Host_Shutdown.Offset(0x5C0).FindPatternSelf("0F 84", CMemory::Direction::DOWN, 300).Patch({ 0x0F, 0x85 }); // JE --> JNE | Cannot shutdown EngineVGui if its never initialized.
|
||||
#endif
|
||||
Host_Shutdown.Offset(0x1F0).FindPatternSelf("7E", CMemory::Direction::DOWN).Patch({ 0xE9, 0xF9, 0x04, 0x00, 0x00 }); // JNE --> JMP | Jump over inline 'Host_ShutdownClient()' ('Host_ShutdownServer' in now inline with 'Host_Shutdown()')
|
||||
#endif // 0x700
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: HOST_NEWGAME
|
||||
//-------------------------------------------------------------------------
|
||||
{
|
||||
p_Host_NewGame.Offset(0x4E0).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 });
|
||||
p_Host_NewGame.Offset(0x637).Patch({ 0xE9, 0xC1, 0x00, 0x00, 0x00 }); // JNE --> JMP | Prevent connect localhost from being executed in Host_NewGame.
|
||||
p_Host_NewGame.Offset(0x50).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Invalid CHLClient virtual call 'g_pHLClient->nullsub()'.
|
||||
p_Host_NewGame.Offset(0x4E0).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Matsys 'JT_HelpWithAnything()'.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: HOST_CHANGELEVEL
|
||||
//-------------------------------------------------------------------------
|
||||
{
|
||||
p_Host_ChangeLevel.Offset(0x5D).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Invalid CHLClient virtual call 'g_pHLClient->nullsub()'.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: _HOST_RUNFRAME
|
||||
//-------------------------------------------------------------------------
|
||||
{
|
||||
_Host_RunFrame.Offset(0xFB0).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | NOP call to unused VGUI code to prevent crash at SIGNONSTATE_PRESPAWN.
|
||||
_Host_RunFrame.Offset(0x1023).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | NOP NULL call as client is never initialized.
|
||||
p_Host_RunFrame.Offset(0xB85).Patch({ 0xEB, 0x6F }); // CMP --> JMP | Jump over inline '_Host_RunFrame_Client()'
|
||||
p_Host_RunFrame_Render.Patch({ 0xC3 }); // FUN --> RET | Extraneous function for Dedicated.
|
||||
p_VCR_EnterPausedState.Patch({ 0xC3 }); // FUN --> RET | Extraneous function for Dedicated.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -256,10 +276,7 @@ void Dedicated_Init()
|
||||
// RUNTIME: GL_SCREEN
|
||||
//-------------------------------------------------------------------------
|
||||
{
|
||||
SCR_BeginLoadingPlaque.Offset(0x5B).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | virtual call to 'CHLClient::MilesQueueEvent'.
|
||||
SCR_BeginLoadingPlaque.Offset(0x82).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | virtual call to 'CHLClient::CHudMessage'.
|
||||
SCR_BeginLoadingPlaque.Offset(0xA4).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | virtual call to 'CEngineVGui::OnLevelLoadingStarted'.
|
||||
SCR_BeginLoadingPlaque.Offset(0x1D6).Patch({ 0xEB, 0x27 }); // JNE --> JMP | Prevent connect command from crashing by invalid call to UI function.
|
||||
SCR_BeginLoadingPlaque.Patch({ 0xC3 }); // FUN --> RET | Return early to prevent execution of 'SCR_BeginLoadingPlaque()'.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -267,7 +284,7 @@ void Dedicated_Init()
|
||||
//-------------------------------------------------------------------------
|
||||
#if defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
{
|
||||
CL_ClearState.Offset(0x0).Patch({ 0xC3 }); // FUN --> RET | Invalid 'CL_ClearState()' call from Host_Shutdown causing segfault.
|
||||
p_CL_ClearState.Offset(0x0).Patch({ 0xC3 }); // FUN --> RET | Invalid 'CL_ClearState()' call from Host_Shutdown causing segfault.
|
||||
}
|
||||
#endif
|
||||
//-------------------------------------------------------------------------
|
||||
@ -276,6 +293,13 @@ void Dedicated_Init()
|
||||
UpdateCurrentVideoConfig.Offset(0x0).Patch({ 0xB8, 0x01, 0x00, 0x00, 0x00, 0xC3 }); // FUN --> RET | Return early to prevent the server from writing a videoconfig.txt file to the disk (overwriting the existing one).
|
||||
HandleConfigFile.Offset(0x0).Patch({ 0xB8, 0x01, 0x00, 0x00, 0x00, 0xC3 }); // FUN --> RET | Return early to prevent the server from writing various input and ConVar config files to the disk (overwriting the existing one).
|
||||
ResetPreviousGameState.Offset(0x0).Patch({ 0xC3 }); // FUN --> RET | Return early to prevent the server from writing a previousgamestate.txt file to the disk (overwriting the existing one).
|
||||
LoadPlayerConfig.Offset(0x0).Patch({ 0xC3 }); // FUN --> RET | Return early to prevent the server from executing 'config_default_pc.cfg' (execPlayerConfig) and (only for >S3) running 'chat_wheel' code.
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: COMMUNITIES
|
||||
//-------------------------------------------------------------------------
|
||||
Community_Frame.Offset(0x0).Patch({ 0xC3 }); // FUN --> RET | Return early to prevent 'Community_Frame()' from being ran every frame on the server (CLIENT ONLY).
|
||||
//GetEngineClientThread.Offset(0x0).Patch({ 0xB8, 0x00, 0x00, 0x00, 0x00, 0xC3 }); // FUN --> RET | Return nullptr for mp_gamemode thread assignment during registration callback.
|
||||
|
||||
// This mandatory pak file should only exist on the client.
|
||||
if (!FileExists("vpk\\client_frontend.bsp.pak000_000.vpk"))
|
||||
|
@ -77,13 +77,6 @@ inline CMemory Host_Disconnect = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsi
|
||||
inline CMemory Host_Disconnect = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x30\x0F\xB6\xD9"), "xxxxxxxxx");
|
||||
#endif // 0x14023CCA0 // 40 53 48 83 EC 30 0F B6 D9 //
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: _HOST_RUNFRAME
|
||||
//-------------------------------------------------------------------------
|
||||
inline CMemory _Host_RunFrame = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x48\x89\x58\x18\x48\x89\x70\x20\xF3\x0F\x11\x48\x00"), "xxxxxxxxxxxxxxx?"); // _Host_RunFrame() with inlined CFrameTimer::MarkFrame()?
|
||||
// 0x140231C00 // 48 8B C4 48 89 58 18 48 89 70 20 F3 0F 11 48 ? //
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: DETOUR_LEVELINIT
|
||||
//-------------------------------------------------------------------------
|
||||
@ -101,17 +94,29 @@ inline CMemory Server_S2C_CONNECT_1 = g_mGameDll.FindPatternSIMD(reinterpret_cas
|
||||
//-------------------------------------------------------------------------
|
||||
inline CMemory UpdateCurrentVideoConfig = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x00\x41\x56\x48\x8D\xAC\x24\x00\x00\x00\x00\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00\x4C\x8B\xF1"), "xx?xxxxxx????xxx????xxx????xxx");
|
||||
inline CMemory HandleConfigFile = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x56\x48\x81\xEC\x00\x00\x00\x00\x8B\xF1"), "xxxxx????xx");
|
||||
inline CMemory ResetPreviousGameState = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\xE8\x00\x00\x00\x00\x44\x89\x3D\x00\x00\x00\x00\x00\x8B\x00\x24\x00"), "x????xxx?????x?x?").ResolveRelativeAddressSelf(0x1, 0x5);
|
||||
inline CMemory ResetPreviousGameState = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\xE8\x00\x00\x00\x00\x44\x89\x3D\x00\x00\x00\x00\x00\x8B\x00\x24\x00"), "x????xxx?????x?x?").ResolveRelativeAddressSelf(0x1, 0x5);
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) || defined (GAMEDLL_S2)
|
||||
inline CMemory LoadPlayerConfig = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x81\xEC\x00\x00\x00\x00\x48\x83\x3D\x00\x00\x00\x00\x00\x75\x0C"), "xxx????xxx?????xx");
|
||||
#elif defined (GAMEDLL_S3)
|
||||
inline CMemory LoadPlayerConfig = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x89\x4C\x24\x08\x48\x81\xEC\x00\x00\x00\x00\x48\x83\x3D\x00\x00\x00\x00\x00"), "xxxxxxx????xxx?????");
|
||||
#endif
|
||||
inline CMemory Community_Frame = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\xE8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x48\x8B\x0D\x00\x00\x00\x00\x48\x85\xC9\x0F\x84\x00\x00\x00\x00\x48\x8B\x01"), "x????x????xxx????xxxxx????xxx").FollowNearCallSelf();
|
||||
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
inline CMemory GetEngineClientThread = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x65\x48\x8B\x04\x25\x00\x00\x00\x00\x48\x8B\xD9\xB9\x00\x00\x00\x00\x48\x8B\x10\x8B\x04\x11\x39\x05\x00\x00\x00\x00\x7F\x15"), "xxxxxxxxxxx????xxxx????xxxxxxxx????xx");
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
inline CMemory GetEngineClientThread = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x65\x48\x8B\x04\x25\x00\x00\x00\x00\x48\x8B\xD9\xB9\x00\x00\x00\x00\x48\x8B\x10\x8B\x04\x11\x39\x05\x00\x00\x00\x00\x7F\x21"), "xxxxxxxxxxx????xxxx????xxxxxxxx????xx");
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// .RDATA
|
||||
//-------------------------------------------------------------------------
|
||||
inline CMemory g_pClientVPKDir = g_mGameDll.FindStringReadOnly("vpk/%sclient_%s.bsp.pak000%s", true);
|
||||
inline CMemory g_pClientBSP = g_mGameDll.FindStringReadOnly("vpk/client_%s.bsp", true);
|
||||
inline CMemory g_pClientCommonBSP = g_mGameDll.FindStringReadOnly("vpk/client_mp_common.bsp", true);
|
||||
inline CMemory g_pClientMPLobby = g_mGameDll.FindStringReadOnly("vpk/client_mp_lobby", true);
|
||||
inline CMemory g_pClientMP = g_mGameDll.FindStringReadOnly("vpk/client_mp_", true);
|
||||
inline CMemory g_pClientSP = g_mGameDll.FindStringReadOnly("vpk/client_sp_", true);
|
||||
inline CMemory g_pClientVPKDir;
|
||||
inline CMemory g_pClientBSP;
|
||||
inline CMemory g_pClientCommonBSP;
|
||||
inline CMemory g_pClientMPLobby;
|
||||
inline CMemory g_pClientMP;
|
||||
inline CMemory g_pClientSP;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -132,12 +137,12 @@ class HOpcodes : public IDetour
|
||||
std::cout << "| FUN: Host_Init_1 : 0x" << std::hex << std::uppercase << gHost_Init_1.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: Host_Init_2 : 0x" << std::hex << std::uppercase << gHost_Init_2.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: Host_Disconnect : 0x" << std::hex << std::uppercase << Host_Disconnect.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: _Host_RunFrame : 0x" << std::hex << std::uppercase << _Host_RunFrame.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
std::cout << "| FUN: Server_S2C_CONNECT_1 : 0x" << std::hex << std::uppercase << Server_S2C_CONNECT_1.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: UpdateCurrentVideoConfig : 0x" << std::hex << std::uppercase << UpdateCurrentVideoConfig.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: HandleConfigFile : 0x" << std::hex << std::uppercase << HandleConfigFile.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: ResetPreviousGameState : 0x" << std::hex << std::uppercase << ResetPreviousGameState.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: LoadPlayerConfig : 0x" << std::hex << std::uppercase << LoadPlayerConfig.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
std::cout << "| CON: g_pClientVPKDir : 0x" << std::hex << std::uppercase << g_pClientVPKDir.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| CON: g_pClientBSP : 0x" << std::hex << std::uppercase << g_pClientBSP.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
@ -149,7 +154,15 @@ class HOpcodes : public IDetour
|
||||
}
|
||||
virtual void GetFun(void) const { }
|
||||
virtual void GetVar(void) const { }
|
||||
virtual void GetCon(void) const { }
|
||||
virtual void GetCon(void) const
|
||||
{
|
||||
g_pClientVPKDir = g_mGameDll.FindStringReadOnly("vpk/%sclient_%s.bsp.pak000%s", true);
|
||||
g_pClientBSP = g_mGameDll.FindStringReadOnly("vpk/client_%s.bsp", true);
|
||||
g_pClientCommonBSP = g_mGameDll.FindStringReadOnly("vpk/client_mp_common.bsp", true);
|
||||
g_pClientMPLobby = g_mGameDll.FindStringReadOnly("vpk/client_mp_lobby", true);
|
||||
g_pClientMP = g_mGameDll.FindStringReadOnly("vpk/client_mp_", true);
|
||||
g_pClientSP = g_mGameDll.FindStringReadOnly("vpk/client_sp_", true);
|
||||
}
|
||||
virtual void Attach(void) const { }
|
||||
virtual void Detach(void) const { }
|
||||
};
|
||||
|
@ -11,6 +11,7 @@ using std::ifstream;
|
||||
using std::ofstream;
|
||||
using std::stringstream;
|
||||
using std::ostringstream;
|
||||
using std::unordered_map;
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
typedef const unsigned char* rsig_t;
|
||||
|
@ -21,8 +21,15 @@ void R5Dev_Init()
|
||||
#else
|
||||
Console_Init();
|
||||
#endif // !DEDICATED
|
||||
|
||||
SpdLog_Init();
|
||||
spdlog::info("\n");
|
||||
for (int i = 0; i < (&R5R_EMBLEM)[1] - R5R_EMBLEM; i++)
|
||||
{
|
||||
std::string svEscaped = StringEscape(R5R_EMBLEM[i]);
|
||||
spdlog::info("{}{}{}\n", g_svRedF.c_str(), svEscaped.c_str(), g_svReset.c_str());
|
||||
}
|
||||
spdlog::info("\n");
|
||||
|
||||
Systems_Init();
|
||||
WinSys_Attach();
|
||||
|
||||
@ -30,14 +37,6 @@ void R5Dev_Init()
|
||||
Input_Init();
|
||||
DirectX_Init();
|
||||
#endif // !DEDICATED
|
||||
|
||||
spdlog::info("\n");
|
||||
for (int i = 0; i < (&R5R_LOGO)[1] - R5R_LOGO; i++)
|
||||
{
|
||||
std::string svEscaped = StringEscape(R5R_LOGO[i]);
|
||||
spdlog::info("{}{}{}\n", g_svRedF.c_str(), svEscaped.c_str(), g_svReset.c_str());
|
||||
}
|
||||
spdlog::info("\n");
|
||||
}
|
||||
|
||||
//#############################################################################
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "vpc/IAppSystem.h"
|
||||
#include "vpc/keyvalues.h"
|
||||
#include "vpc/interfaces.h"
|
||||
#include "vstdlib/callback.h"
|
||||
#include "vstdlib/completion.h"
|
||||
#include "vstdlib/keyvaluessystem.h"
|
||||
#include "common/opcodes.h"
|
||||
@ -36,8 +37,9 @@
|
||||
#include "vgui/vgui_debugpanel.h"
|
||||
#include "vgui/vgui_fpspanel.h"
|
||||
#include "vguimatsurface/MatSystemSurface.h"
|
||||
#include "client/cdll_engine_int.h"
|
||||
#endif // !DEDICATED
|
||||
#include "client/client.h"
|
||||
#include "client/cdll_engine_int.h"
|
||||
#include "client/vengineclient_impl.h"
|
||||
#ifndef CLIENT_DLL
|
||||
#include "server/server.h"
|
||||
|
@ -9,7 +9,7 @@ __declspec(dllexport) void DummyExport()
|
||||
// Required for detours.
|
||||
}
|
||||
|
||||
const std::string R5R_LOGO[] =
|
||||
const std::string R5R_EMBLEM[] =
|
||||
{
|
||||
R"(+-------------------------------------------------------------------+)",
|
||||
R"(| ___ ___ ___ _ _ _ ___ __ _ _ |)",
|
||||
|
@ -1,8 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
inline CMemory p_Host_RunFrame; /*48 8B C4 48 89 58 18 48 89 70 20 F3 0F 11 48 ?*/
|
||||
inline auto _Host_RunFrame = p_Host_RunFrame.RCast<void(*)(void* unused, float time)>();
|
||||
|
||||
inline CMemory p_Host_RunFrame_Render; /*40 53 48 83 EC 20 48 8B 0D ? ? ? ? 48 85 C9 75 34*/
|
||||
inline auto _Host_RunFrame_Render = p_Host_RunFrame_Render.RCast<void(*)(void)>();
|
||||
|
||||
inline CMemory p_Host_Error; /*48 89 4C 24 ? 48 89 54 24 ? 4C 89 44 24 ? 4C 89 4C 24 ? 53 57 48 81 EC ? ? ? ?*/
|
||||
inline auto Host_Error = p_Host_Error.RCast<int(*)(char* error, ...)>();
|
||||
|
||||
inline CMemory p_VCR_EnterPausedState;
|
||||
inline auto VCR_EnterPausedState = p_VCR_EnterPausedState.RCast<void(*)(void)>();
|
||||
|
||||
inline bool* g_bAbortServerSet = nullptr;
|
||||
inline jmp_buf* host_abortserver = nullptr;
|
||||
|
||||
@ -11,14 +20,29 @@ class HHost : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
std::cout << "| FUN: Host_Error : 0x" << std::hex << std::uppercase << p_Host_Error.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: g_bAbortServerSet : 0x" << std::hex << std::uppercase << g_bAbortServerSet << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "| FUN: host_abortserver : 0x" << std::hex << std::uppercase << host_abortserver << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "| FUN: _Host_RunFrame : 0x" << std::hex << std::uppercase << p_Host_RunFrame.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: _Host_RunFrame_Render : 0x" << std::hex << std::uppercase << p_Host_RunFrame_Render.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: Host_Error : 0x" << std::hex << std::uppercase << p_Host_Error.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: VCR_EnterPausedState : 0x" << std::hex << std::uppercase << p_VCR_EnterPausedState.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| VAR: host_abortserver : 0x" << std::hex << std::uppercase << host_abortserver << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "| VAR: g_bAbortServerSet : 0x" << std::hex << std::uppercase << g_bAbortServerSet << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
}
|
||||
virtual void GetFun(void) const
|
||||
{
|
||||
p_Host_RunFrame = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x48\x89\x58\x18\x48\x89\x70\x20\xF3\x0F\x11\x48\x00"), "xxxxxxxxxxxxxxx?");
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
p_Host_RunFrame_Render = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x20\x48\x8B\x1D\x00\x00\x00\x00\x33\xFF"), "xxxx?xxxxxxxx????xx");
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
p_Host_RunFrame_Render = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\x0D\x00\x00\x00\x00\x48\x85\xC9\x75\x34"), "xxxxxxxxx????xxxxx");
|
||||
#endif
|
||||
p_Host_Error = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x4C\x24\x00\x48\x89\x54\x24\x00\x4C\x89\x44\x24\x00\x4C\x89\x4C\x24\x00\x53\x57\x48\x81\xEC\x00\x00\x00\x00"), "xxxx?xxxx?xxxx?xxxx?xxxxx????");
|
||||
p_VCR_EnterPausedState = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x65\x48\x8B\x04\x25\x00\x00\x00\x00\xBB\x00\x00\x00\x00\xC6\x05\x00\x00\x00\x00\x00"), "xxxxxxxxxxx????x????xx?????");
|
||||
|
||||
_Host_RunFrame = p_Host_RunFrame.RCast<void(*)(void*, float)>();
|
||||
_Host_RunFrame_Render = p_Host_Error.RCast<void(*)(void)>();
|
||||
Host_Error = p_Host_Error.RCast<int(*)(char*, ...)>();
|
||||
VCR_EnterPausedState = p_VCR_EnterPausedState.RCast<void(*)(void)>();
|
||||
}
|
||||
virtual void GetVar(void) const
|
||||
{
|
||||
|
@ -51,7 +51,6 @@ bool g_bLevelResourceInitialized = false;
|
||||
FORCEINLINE void CHostState::FrameUpdate(CHostState* rcx, void* rdx, float time)
|
||||
{
|
||||
static bool bInitialized = false;
|
||||
static ConVar* single_frame_shutdown_for_reload = g_pCVar->FindVar("single_frame_shutdown_for_reload");
|
||||
if (!bInitialized)
|
||||
{
|
||||
g_pHostState->Setup();
|
||||
@ -109,7 +108,7 @@ FORCEINLINE void CHostState::FrameUpdate(CHostState* rcx, void* rdx, float time)
|
||||
DevMsg(eDLL_T::ENGINE, "%s - Shutdown host game\n", "CHostState::FrameUpdate");
|
||||
|
||||
g_bLevelResourceInitialized = false;
|
||||
CHostState_GameShutDown(g_pHostState);
|
||||
CHostState_State_GameShutDown(g_pHostState);
|
||||
g_pHostState->UnloadPakFile();
|
||||
break;
|
||||
}
|
||||
@ -152,13 +151,11 @@ FORCEINLINE void CHostState::FrameUpdate(CHostState* rcx, void* rdx, float time)
|
||||
//-----------------------------------------------------------------------------
|
||||
FORCEINLINE void CHostState::Init(void)
|
||||
{
|
||||
static ConVar* single_frame_shutdown_for_reload = g_pCVar->FindVar("single_frame_shutdown_for_reload");
|
||||
|
||||
if (m_iNextState != HostStates_t::HS_SHUTDOWN)
|
||||
{
|
||||
if (m_iNextState == HostStates_t::HS_GAME_SHUTDOWN)
|
||||
{
|
||||
CHostState_GameShutDown(this);
|
||||
CHostState_State_GameShutDown(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -196,7 +193,7 @@ FORCEINLINE void CHostState::Setup(void) const
|
||||
*m_bRestrictServerCommands = true; // Restrict commands.
|
||||
ConCommandBase* disconnect = g_pCVar->FindCommandBase("disconnect");
|
||||
disconnect->AddFlags(FCVAR_SERVER_CAN_EXECUTE); // Make sure server is not restricted to this.
|
||||
g_pCVar->FindVar("net_usesocketsforloopback")->SetValue(1);
|
||||
net_usesocketsforloopback->SetValue(1);
|
||||
|
||||
if (net_userandomkey->GetBool())
|
||||
{
|
||||
@ -220,7 +217,6 @@ FORCEINLINE void CHostState::Think(void) const
|
||||
static CFastTimer banListTimer;
|
||||
static CFastTimer pylonTimer;
|
||||
static CFastTimer statsTimer;
|
||||
static ConVar* hostname = g_pCVar->FindVar("hostname");
|
||||
|
||||
for (;;) // Loop running at 20-tps.
|
||||
{
|
||||
@ -361,7 +357,7 @@ FORCEINLINE void CHostState::State_NewGame(void)
|
||||
m_iCurrentState = HostStates_t::HS_RUN; // Set current state to run.
|
||||
|
||||
// If our next state isn't a shutdown or its a forced shutdown then set next state to run.
|
||||
if (m_iNextState != HostStates_t::HS_SHUTDOWN || !g_pCVar->FindVar("host_hasIrreversibleShutdown")->GetBool())
|
||||
if (m_iNextState != HostStates_t::HS_SHUTDOWN || !host_hasIrreversibleShutdown->GetBool())
|
||||
{
|
||||
m_iNextState = HostStates_t::HS_RUN;
|
||||
}
|
||||
@ -388,7 +384,7 @@ FORCEINLINE void CHostState::State_ChangeLevelSP(void)
|
||||
m_iCurrentState = HostStates_t::HS_RUN; // Set current state to run.
|
||||
|
||||
// If our next state isn't a shutdown or its a forced shutdown then set next state to run.
|
||||
if (m_iNextState != HostStates_t::HS_SHUTDOWN || !g_pCVar->FindVar("host_hasIrreversibleShutdown")->GetBool())
|
||||
if (m_iNextState != HostStates_t::HS_SHUTDOWN || !host_hasIrreversibleShutdown->GetBool())
|
||||
{
|
||||
m_iNextState = HostStates_t::HS_RUN;
|
||||
}
|
||||
@ -422,7 +418,7 @@ FORCEINLINE void CHostState::State_ChangeLevelMP(void)
|
||||
m_iCurrentState = HostStates_t::HS_RUN; // Set current state to run.
|
||||
|
||||
// If our next state isn't a shutdown or its a forced shutdown then set next state to run.
|
||||
if (m_iNextState != HostStates_t::HS_SHUTDOWN || !g_pCVar->FindVar("host_hasIrreversibleShutdown")->GetBool())
|
||||
if (m_iNextState != HostStates_t::HS_SHUTDOWN || !host_hasIrreversibleShutdown->GetBool())
|
||||
{
|
||||
m_iNextState = HostStates_t::HS_RUN;
|
||||
}
|
||||
|
@ -56,8 +56,8 @@ inline auto CHostState_FrameUpdate = p_CHostState_FrameUpdate.RCast<void(*)(CHos
|
||||
inline CMemory p_CHostState_State_Run = nullptr; /*48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 C8 45 33 E4*/
|
||||
inline auto CHostState_State_Run = p_CHostState_State_Run.RCast<void(*)(HostStates_t* pState, void* pUnused, float flFrameTime)>();
|
||||
|
||||
inline CMemory p_CHostState_GameShutDown = nullptr; /*48 89 5C 24 ? 57 48 83 EC 20 48 8B D9 E8 ? ? ? ? 48 8B 0D ? ? ? ?*/
|
||||
inline auto CHostState_GameShutDown = p_CHostState_GameShutDown.RCast<void(*)(CHostState* thisptr)>();
|
||||
inline CMemory p_CHostState_State_GameShutDown = nullptr; /*48 89 5C 24 ? 57 48 83 EC 20 48 8B D9 E8 ? ? ? ? 48 8B 0D ? ? ? ?*/
|
||||
inline auto CHostState_State_GameShutDown = p_CHostState_State_GameShutDown.RCast<void(*)(CHostState* thisptr)>();
|
||||
|
||||
extern bool g_bLevelResourceInitialized;
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -73,10 +73,10 @@ class HHostState : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
std::cout << "| FUN: CHostState::FrameUpdate : 0x" << std::hex << std::uppercase << p_CHostState_FrameUpdate.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: CHostState::State_Run : 0x" << std::hex << std::uppercase << p_CHostState_State_Run.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: CHostState::GameShutDown : 0x" << std::hex << std::uppercase << p_CHostState_GameShutDown.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| VAR: g_pHostState : 0x" << std::hex << std::uppercase << g_pHostState << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "| FUN: CHostState::FrameUpdate : 0x" << std::hex << std::uppercase << p_CHostState_FrameUpdate.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: CHostState::State_Run : 0x" << std::hex << std::uppercase << p_CHostState_State_Run.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: CHostState::State_GameShutDown : 0x" << std::hex << std::uppercase << p_CHostState_State_GameShutDown.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| VAR: g_pHostState : 0x" << std::hex << std::uppercase << g_pHostState << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
}
|
||||
virtual void GetFun(void) const
|
||||
@ -90,8 +90,8 @@ class HHostState : public IDetour
|
||||
p_CHostState_GameShutDown = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x56\x48\x83\xEC\x20\x8B\x05\x00\x00\x00\x00\x48\x8B\xF1"), "xxxx?xxxxxxx????xxx");
|
||||
CHostState_GameShutDown = p_CHostState_GameShutDown.RCast<void(*)(CHostState* thisptr)>();
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
p_CHostState_GameShutDown = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x20\x48\x8B\xD9\xE8\x00\x00\x00\x00\x48\x8B\x0D\x00\x00\x00\x00"), "xxxx?xxxxxxxxx????xxx????");
|
||||
CHostState_GameShutDown = p_CHostState_GameShutDown.RCast<void(*)(CHostState* thisptr)>();
|
||||
p_CHostState_State_GameShutDown = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x20\x48\x8B\xD9\xE8\x00\x00\x00\x00\x48\x8B\x0D\x00\x00\x00\x00"), "xxxx?xxxxxxxxx????xxx????");
|
||||
CHostState_State_GameShutDown = p_CHostState_State_GameShutDown.RCast<void(*)(CHostState* thisptr)>();
|
||||
#endif
|
||||
}
|
||||
virtual void GetVar(void) const
|
||||
|
@ -18,6 +18,9 @@ inline auto CModelLoader__Map_LoadModelGuts = p_CModelLoader__Map_LoadModelGuts.
|
||||
|
||||
inline CMemory p_CModelLoader__Map_IsValid = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x53\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\xDA"), "xxxxxxx????xxx");
|
||||
inline auto CModelLoader__Map_IsValid = p_CModelLoader__Map_IsValid.RCast<bool(*)(void* thisptr, const char* pszMapName)>(); /*48 8B C4 53 48 81 EC ? ? ? ? 48 8B DA*/
|
||||
|
||||
inline CMemory p_GetSpriteInfo = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x83\xEC\x30\x4C\x8B\xAC\x24\x00\x00\x00\x00\xBE\x00\x00\x00\x00"), "xxxx?xxxx?xxxx?xxxxxxxxxxxxxxxxx????x????");
|
||||
inline auto GetSpriteInfo = p_GetSpriteInfo.RCast<void* (*)(const char* pName, bool bIsAVI, bool bIsBIK, int& nWidth, int& nHeight, int& nFrameCount, void* a7)>();
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
inline CMemory p_CModelLoader__FindModel = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x41\x57\x48\x83\xEC\x48\x80\x3A\x2A"), "xxxxxxxxxxx");
|
||||
inline auto CModelLoader__FindModel = p_CModelLoader__FindModel.RCast<void* (*)(void* thisptr, const char* pszModelName)>(); /*40 55 41 57 48 83 EC 48 80 3A 2A*/
|
||||
@ -36,7 +39,12 @@ inline auto CModelLoader__Map_LoadModelGuts = p_CModelLoader__Map_LoadModelGuts.
|
||||
|
||||
inline CMemory p_CModelLoader__Map_IsValid = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\xDA\x48\x85\xD2\x0F\x84\x00\x00\x00\x00\x80\x3A\x00\x0F\x84\x00\x00\x00\x00\x4C\x8B\xCA"), "xxxxx????xxxxxxxx????xxxxx????xxx");
|
||||
inline auto CModelLoader__Map_IsValid = p_CModelLoader__Map_IsValid.RCast<bool(*)(void* thisptr, const char* pszMapName)>(); /*40 53 48 81 EC ? ? ? ? 48 8B DA 48 85 D2 0F 84 ? ? ? ? 80 3A 00 0F 84 ? ? ? ? 4C 8B CA*/
|
||||
|
||||
inline CMemory p_GetSpriteInfo = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x83\xEC\x30\x4C\x8B\xBC\x24\x00\x00\x00\x00"), "xxxx?xxxx?xxxx?xxxxxxxxxxxxxxxxx????");
|
||||
inline auto GetSpriteInfo = p_GetSpriteInfo.RCast<void* (*)(const char* pName, bool bIsAVI, bool bIsBIK, int& nWidth, int& nHeight, int& nFrameCount, void* a7)>();
|
||||
#endif
|
||||
inline CMemory p_BuildSpriteLoadName = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x41\x56\x48\x81\xEC\x00\x00\x00\x00\x4D\x8B\xF1\x48\x8B\xF2"), "xxxx?xxxx?xxxx?xxxx?xxxxx????xxxxxx");
|
||||
inline auto BuildSpriteLoadName = p_BuildSpriteLoadName.RCast<void* (*)(const char* pName, char* pOut, int outLen, bool& bIsAVI, bool& bIsBIK)>();
|
||||
|
||||
inline void* g_pModelLoader = g_mGameDll.FindPatternSIMD(
|
||||
reinterpret_cast<rsig_t>("\x48\x89\x4C\x24\x00\x53\x55\x56\x41\x54\x41\x55\x41\x56\x41\x57\x48\x81\xEC\x00\x00\x00\x00"),
|
||||
@ -56,6 +64,8 @@ class HModelLoader : public IDetour
|
||||
std::cout << "| FUN: CModelLoader::Map_LoadModelGuts : 0x" << std::hex << std::uppercase << p_CModelLoader__Map_LoadModelGuts.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: CModelLoader::Map_IsValid : 0x" << std::hex << std::uppercase << p_CModelLoader__Map_IsValid.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: CModelLoader::Studio_LoadModel : 0x" << std::hex << std::uppercase << p_CModelLoader__Studio_LoadModel.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: GetSpriteInfo : 0x" << std::hex << std::uppercase << p_GetSpriteInfo.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: BuildSpriteLoadName : 0x" << std::hex << std::uppercase << p_BuildSpriteLoadName.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| VAR: g_pModelLoader : 0x" << std::hex << std::uppercase << g_pModelLoader << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@
|
||||
void NET_ShutDown(void* thisptr, const char* szReason, std::uint8_t a1, char a2)
|
||||
{
|
||||
#if !defined (GAMEDLL_S0) || !defined (GAMEDLL_S1) // !TEMP UNTIL CHOSTSTATE IS BUILD AGNOSTIC! //
|
||||
DownloadPlaylists_f_CompletionFunc(); // Re-load playlist from disk after getting disconnected from the server.
|
||||
_DownloadPlaylists_f_CompletionFunc(); // Re-load playlist from disk after getting disconnected from the server.
|
||||
#endif // !GAMEDLL_S0 || !GAMEDLL_S1
|
||||
v_NET_Shutdown(thisptr, szReason, a1, a2);
|
||||
}
|
||||
|
@ -18,6 +18,9 @@ inline CMemory CGameServer__SpawnServer = g_mGameDll.FindPatternSIMD(reinterpret
|
||||
inline CMemory CGameServer__SpawnServer = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x53\x55\x56\x57\x41\x54\x41\x55\x41\x57"), "xxxxxxxxxxxxx");
|
||||
// 0x140312D80 // 48 8B C4 53 55 56 57 41 54 41 55 41 57 //
|
||||
#endif
|
||||
inline bool* s_bDedicated = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>(
|
||||
"\x48\x89\x4C\x24\x00\x48\x89\x54\x24\x00\x4C\x89\x44\x24\x00\x4C\x89\x4C\x24\x00\x53\x57\xB8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x48\x2B\xE0\x48\x8B\xD9\x48\x8D\xBC\x24\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x48\x89\x7C\x24\x00\x48\x8D\x54\x24\x00\x33\xFF"),
|
||||
"xxxx?xxxx?xxxx?xxxx?xxx????x????xxxxxxxxxx????x????xxxx?xxxx?xx").FindPatternSelf("40 38 3D", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<bool*>();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -32,6 +35,7 @@ class HSV_Main : public IDetour
|
||||
std::cout << "| FUN: SV_ShutdownGameDLL : 0x" << std::hex << std::uppercase << p_SV_ShutdownGameDLL.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: SV_CreateBaseline : 0x" << std::hex << std::uppercase << p_SV_CreateBaseline.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| FUN: CGameServer::SpawnServer : 0x" << std::hex << std::uppercase << CGameServer__SpawnServer.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "| VAR: s_bDedicated : 0x" << std::hex << std::uppercase << s_bDedicated << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
}
|
||||
virtual void GetFun(void) const { }
|
||||
|
@ -32,8 +32,6 @@ void CRConServer::Init(void)
|
||||
return;
|
||||
}
|
||||
|
||||
static ConVar* hostport = g_pCVar->FindVar("hostport");
|
||||
|
||||
m_pAdr2 = new CNetAdr2(rcon_address->GetString(), hostport->GetString());
|
||||
m_pSocket->CreateListenSocket(*m_pAdr2, false);
|
||||
m_svPasswordHash = sha256(rcon_password->GetString());
|
||||
|
@ -573,7 +573,7 @@ void IBrowser::HostServerSection(void)
|
||||
{
|
||||
if (ImGui::Button("Reload Playlist from Disk##ServerHost_ReloadPlaylist", ImVec2(ImGui::GetWindowSize().x, 32)))
|
||||
{
|
||||
DownloadPlaylists_f_CompletionFunc();
|
||||
_DownloadPlaylists_f_CompletionFunc();
|
||||
KeyValues::InitPlaylist(); // Re-Init playlist.
|
||||
}
|
||||
}
|
||||
@ -640,9 +640,6 @@ void IBrowser::UpdateHostingStatus(void)
|
||||
void IBrowser::SendHostingPostRequest(void)
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
static ConVar* hostport = g_pCVar->FindVar("hostport");
|
||||
static ConVar* mp_gamemode = g_pCVar->FindVar("mp_gamemode");
|
||||
|
||||
m_szHostToken = std::string();
|
||||
bool result = g_pR5net->PostServerHost(m_szHostRequestMessage, m_szHostToken,
|
||||
ServerListing
|
||||
|
@ -14,11 +14,12 @@
|
||||
#include "engine/sv_main.h"
|
||||
#include "engine/host_cmd.h"
|
||||
#include "server/vengineserver_impl.h"
|
||||
#include "client/cdll_engine_int.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
int HModAppSystemGroup_Main(CModAppSystemGroup* pModAppSystemGroup)
|
||||
int CModAppSystemGroup::Main(CModAppSystemGroup* pModAppSystemGroup)
|
||||
{
|
||||
int nRunResult = RUN_OK;
|
||||
HEbisuSDK_Init(); // Not here in retail. We init EbisuSDK here though.
|
||||
@ -26,27 +27,16 @@ int HModAppSystemGroup_Main(CModAppSystemGroup* pModAppSystemGroup)
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) // !TODO: rebuild does not work for S1 (CModAppSystemGroup and CEngine member offsets do align with all other builds).
|
||||
return CModAppSystemGroup_Main(modAppSystemGroup);
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
if (pModAppSystemGroup->m_bIsServerOnly()) // This will never be true anyway but we implement it for the sake of it.
|
||||
|
||||
g_pEngine->SetQuitting(EngineDllQuitting_t::QUIT_NOTQUITTING);
|
||||
if (g_pEngine->Load(pModAppSystemGroup->IsServerOnly(), g_pEngineParms->baseDirectory))
|
||||
{
|
||||
if (g_pEngine->Load(true, g_pEngineParms->baseDirectory))
|
||||
if (CEngineAPI_MainLoop())
|
||||
{
|
||||
// Below is vfunc call that is supposed to be used for real dedicated servers. The class instance is sadly stripped to some degree.
|
||||
//(*(void(__fastcall**)(__int64))(*(_QWORD*)qword_14C119C10 + 72i64))(qword_14C119C10);// dedicated->RunServer()
|
||||
SV_ShutdownGameDLL();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_pEngine->SetQuitting(EngineDllQuitting_t::QUIT_NOTQUITTING);
|
||||
if (g_pEngine->Load(false, g_pEngineParms->baseDirectory))
|
||||
{
|
||||
if (CEngineAPI_MainLoop())
|
||||
{
|
||||
nRunResult = RUN_RESTART;
|
||||
}
|
||||
g_pEngine->Unload();
|
||||
SV_ShutdownGameDLL();
|
||||
nRunResult = RUN_RESTART;
|
||||
}
|
||||
g_pEngine->Unload();
|
||||
SV_ShutdownGameDLL();
|
||||
}
|
||||
return nRunResult;
|
||||
#endif
|
||||
@ -55,18 +45,29 @@ int HModAppSystemGroup_Main(CModAppSystemGroup* pModAppSystemGroup)
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Instantiate all main libraries
|
||||
//-----------------------------------------------------------------------------
|
||||
bool HModAppSystemGroup_Create(CModAppSystemGroup* pModAppSystemGroup)
|
||||
bool CModAppSystemGroup::Create(CModAppSystemGroup* pModAppSystemGroup)
|
||||
{
|
||||
#ifdef DEDICATED
|
||||
* g_bDedicated = true;
|
||||
pModAppSystemGroup->SetServerOnly();
|
||||
*g_bDedicated = true;
|
||||
g_pConCommand->PurgeShipped();
|
||||
#endif // DEDICATED
|
||||
g_pConCommand->Init();
|
||||
g_pConCommand->InitShipped();
|
||||
g_pConVar->InitShipped();
|
||||
g_pFactory->GetFactoriesFromRegister();
|
||||
|
||||
for (auto& map : g_pCVar->DumpToMap())
|
||||
{
|
||||
g_vsvCommandBases.push_back(map.first.c_str());
|
||||
}
|
||||
if (pModAppSystemGroup->IsServerOnly())
|
||||
{
|
||||
memset(gHLClient, '\0', sizeof(void*));
|
||||
gHLClient = nullptr;
|
||||
memset(g_pHLClient, '\0', sizeof(void*));
|
||||
g_pHLClient = nullptr;
|
||||
}
|
||||
|
||||
g_bAppSystemInit = true;
|
||||
return CModAppSystemGroup_Create(pModAppSystemGroup);
|
||||
@ -75,12 +76,12 @@ bool HModAppSystemGroup_Create(CModAppSystemGroup* pModAppSystemGroup)
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void IApplication_Attach()
|
||||
{
|
||||
DetourAttach((LPVOID*)&CModAppSystemGroup_Main, &HModAppSystemGroup_Main);
|
||||
DetourAttach((LPVOID*)&CModAppSystemGroup_Create, &HModAppSystemGroup_Create);
|
||||
DetourAttach((LPVOID*)&CModAppSystemGroup_Main, &CModAppSystemGroup::Main);
|
||||
DetourAttach((LPVOID*)&CModAppSystemGroup_Create, &CModAppSystemGroup::Create);
|
||||
}
|
||||
|
||||
void IApplication_Detach()
|
||||
{
|
||||
DetourDetach((LPVOID*)&CModAppSystemGroup_Main, &HModAppSystemGroup_Main);
|
||||
DetourDetach((LPVOID*)&CModAppSystemGroup_Create, &HModAppSystemGroup_Create);
|
||||
DetourDetach((LPVOID*)&CModAppSystemGroup_Main, &CModAppSystemGroup::Main);
|
||||
DetourDetach((LPVOID*)&CModAppSystemGroup_Create, &CModAppSystemGroup::Create);
|
||||
}
|
||||
|
@ -22,7 +22,20 @@ enum
|
||||
class CModAppSystemGroup
|
||||
{
|
||||
public:
|
||||
MEMBER_AT_OFFSET(bool, m_bIsServerOnly, 0xA8);
|
||||
static int Main(CModAppSystemGroup* pModAppSystemGroup);
|
||||
static bool Create(CModAppSystemGroup* pModAppSystemGroup);
|
||||
|
||||
bool IsServerOnly(void) const
|
||||
{
|
||||
return m_bServerOnly;
|
||||
}
|
||||
void SetServerOnly(void)
|
||||
{
|
||||
m_bServerOnly = true;
|
||||
}
|
||||
private:
|
||||
char pad[0xA8];
|
||||
bool m_bServerOnly;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -49,9 +62,6 @@ inline CMemory p_CSourceAppSystemGroup__Create = g_mGameDll.FindPatternSIMD(rein
|
||||
inline auto CSourceAppSystemGroup__Create = p_CSourceAppSystemGroup__Create.RCast<bool(*)(CModAppSystemGroup* pModAppSystemGroup)>(); /*48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 8B F9 E8 ? ? ? ? 33 C9*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
int HModAppSystemGroup_Main(CModAppSystemGroup* modAppSystemGroup);
|
||||
bool HModAppSystemGroup_Create(CModAppSystemGroup* modAppSystemGroup);
|
||||
|
||||
void IApplication_Attach();
|
||||
void IApplication_Detach();
|
||||
|
||||
|
@ -22,10 +22,6 @@ void KeepAliveToPylon()
|
||||
{
|
||||
if (g_pHostState->m_bActiveGame && sv_pylonvisibility->GetBool()) // Check for active game.
|
||||
{
|
||||
static ConVar* hostname = g_pCVar->FindVar("hostname");
|
||||
static ConVar* hostport = g_pCVar->FindVar("hostport");
|
||||
static ConVar* mp_gamemode = g_pCVar->FindVar("mp_gamemode");
|
||||
|
||||
std::string m_szHostToken = std::string();
|
||||
std::string m_szHostRequestMessage = std::string();
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
//=============================================================================//
|
||||
|
||||
#include "core/stdafx.h"
|
||||
#include "vstdlib/callback.h"
|
||||
#include "tier1/IConVar.h"
|
||||
#include "tier1/cvar.h"
|
||||
#include "engine/sys_utils.h"
|
||||
@ -39,7 +40,7 @@ ConVar::~ConVar(void)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: register ConVar
|
||||
// Purpose: initialize ConVar's
|
||||
//-----------------------------------------------------------------------------
|
||||
void ConVar::Init(void) const
|
||||
{
|
||||
@ -151,6 +152,21 @@ void ConVar::Init(void) const
|
||||
//-------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: initialize shipped ConVar's
|
||||
//-----------------------------------------------------------------------------
|
||||
void ConVar::InitShipped(void) const
|
||||
{
|
||||
single_frame_shutdown_for_reload = g_pCVar->FindVar("single_frame_shutdown_for_reload");
|
||||
mp_gamemode = g_pCVar->FindVar("mp_gamemode");
|
||||
hostname = g_pCVar->FindVar("hostname");
|
||||
hostport = g_pCVar->FindVar("hostport");
|
||||
host_hasIrreversibleShutdown = g_pCVar->FindVar("host_hasIrreversibleShutdown");
|
||||
net_usesocketsforloopback = g_pCVar->FindVar("net_usesocketsforloopback");
|
||||
|
||||
mp_gamemode->SetCallback(&MP_GameMode_Changed_f);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Add's flags to ConVar.
|
||||
// Input : nFlags -
|
||||
@ -481,6 +497,15 @@ void ConVar::SetDefault(const char* pszDefault)
|
||||
assert(m_pszDefaultValue);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: sets the ConVar callback.
|
||||
// Input : *pCallback -
|
||||
//-----------------------------------------------------------------------------
|
||||
void ConVar::SetCallback(void* pCallback)
|
||||
{
|
||||
*m_Callback.m_ppCallback = *&pCallback;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: changes the ConVar string value.
|
||||
// Input : *pszTempVal - flOldValue
|
||||
@ -678,7 +703,7 @@ void ConVar::ClearHostNames(void)
|
||||
const char* pszName = pszHostnameArray[i];
|
||||
ConVar* pCVar = g_pCVar->FindVar(pszName);
|
||||
|
||||
if (pCVar != nullptr)
|
||||
if (pCVar)
|
||||
{
|
||||
pCVar->m_Value.m_pszString = "0.0.0.0";
|
||||
}
|
||||
|
@ -91,6 +91,7 @@ public:
|
||||
~ConVar(void);
|
||||
|
||||
void Init(void) const;
|
||||
void InitShipped(void) const;
|
||||
|
||||
void AddFlags(int nFlags);
|
||||
void RemoveFlags(int nFlags);
|
||||
@ -123,6 +124,8 @@ public:
|
||||
const char* GetDefault(void) const;
|
||||
void SetDefault(const char* pszDefault);
|
||||
|
||||
void SetCallback(void* pCallback);
|
||||
|
||||
void ChangeStringValue(const char* pszTempValue, float flOldValue);
|
||||
bool SetColorFromString(const char* pszValue);
|
||||
bool ClampValue(float& value);
|
||||
@ -140,6 +143,13 @@ public:
|
||||
float m_fValue;
|
||||
int m_nValue;
|
||||
};
|
||||
struct CVCallback_t
|
||||
{
|
||||
void** m_ppCallback;
|
||||
int64_t m_iFlags;
|
||||
char m_Pad[8];
|
||||
int64_t m_iTimesChanged;
|
||||
};
|
||||
|
||||
void* m_pIConVarVTable {}; //0x0040
|
||||
ConVar* m_pParent {}; //0x0048
|
||||
@ -149,7 +159,7 @@ public:
|
||||
float m_fMinVal {}; //0x0074
|
||||
bool m_bHasMax {}; //0x0078
|
||||
float m_fMaxVal {}; //0x007C
|
||||
char pad_0080[32] {}; //0x0080
|
||||
CVCallback_t m_Callback {}; //0x0080
|
||||
}; //Size: 0x00A0
|
||||
|
||||
/* ==== ICONVAR ========================================================================================================================================================= */
|
||||
|
@ -155,6 +155,13 @@ void ConCommand::Init(void)
|
||||
new ConCommand("net_toggletrace", "Logs the sending and receiving datagram to a file on the disk.", FCVAR_CHEAT | FCVAR_DEVELOPMENTONLY, _NET_TraceNetChan_f_CompletionFunc, nullptr);
|
||||
new ConCommand("net_setkey", "Sets user specified base64 net key.", FCVAR_RELEASE, _NET_SetKey_f_CompletionFunc, nullptr);
|
||||
new ConCommand("net_generatekey", "Generates and sets a random base64 net key.", FCVAR_RELEASE, _NET_GenerateKey_f_CompletionFunc, nullptr);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: shipped ConCommand initialization
|
||||
//-----------------------------------------------------------------------------
|
||||
void ConCommand::InitShipped(void)
|
||||
{
|
||||
#ifndef DEDICATED
|
||||
//-------------------------------------------------------------------------
|
||||
// MATERIAL SYSTEM
|
||||
@ -162,6 +169,58 @@ void ConCommand::Init(void)
|
||||
#endif // !DEDICATED
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: unregister unused ConCommand's for dedicated.
|
||||
//-----------------------------------------------------------------------------
|
||||
void ConCommand::PurgeShipped(void) const
|
||||
{
|
||||
const char* pszCommandToRemove[] =
|
||||
{
|
||||
"bind",
|
||||
"bind_held",
|
||||
"bind_list",
|
||||
"bind_list_abilities",
|
||||
"bind_US_standard",
|
||||
"bind_held_US_standard",
|
||||
"connect",
|
||||
"gameui_activate",
|
||||
"gameui_hide",
|
||||
"weaponSelectOrdnance",
|
||||
"weaponSelectPrimary0",
|
||||
"weaponSelectPrimary1",
|
||||
"weaponSelectPrimary2",
|
||||
"silent_connect",
|
||||
"+scriptCommand1",
|
||||
"-scriptCommand1",
|
||||
"+scriptCommand2",
|
||||
"-scriptCommand2",
|
||||
"+scriptCommand3",
|
||||
"-scriptCommand3",
|
||||
"+scriptCommand4",
|
||||
"-scriptCommand4",
|
||||
"+scriptCommand5",
|
||||
"-scriptCommand5",
|
||||
"+scriptCommand6",
|
||||
"-scriptCommand6",
|
||||
"+scriptCommand7",
|
||||
"-scriptCommand7",
|
||||
"+scriptCommand8",
|
||||
"-scriptCommand8",
|
||||
"+scriptCommand9",
|
||||
"-scriptCommand9",
|
||||
};
|
||||
|
||||
for (int i = 0; i < (&pszCommandToRemove)[1] - pszCommandToRemove; i++)
|
||||
{
|
||||
ConCommandBase* pCommandBase = g_pCVar->FindCommandBase(pszCommandToRemove[i]);
|
||||
|
||||
if (pCommandBase)
|
||||
{
|
||||
g_pCVar->UnregisterConCommand(pCommandBase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Returns true if this is a command
|
||||
// Output : bool
|
||||
@ -276,6 +335,15 @@ ConCommandBase* ConCommandBase::GetNext(void) const
|
||||
return m_pNext;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Returns the ConCommandBase name.
|
||||
// Output : const char*
|
||||
//-----------------------------------------------------------------------------
|
||||
const char* ConCommandBase::GetName(void) const
|
||||
{
|
||||
return m_pszName;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Returns the ConCommandBase help text.
|
||||
// Output : const char*
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
CCommand() = delete;
|
||||
|
||||
int MaxCommandLength();
|
||||
std::int64_t ArgC(void) const;
|
||||
int64_t ArgC(void) const;
|
||||
const char** ArgV(void) const;
|
||||
const char* ArgS(void) const;
|
||||
const char* GetCommandString(void) const;
|
||||
@ -71,7 +71,7 @@ public:
|
||||
private:
|
||||
int m_nQueuedVal;
|
||||
int m_nArgc;
|
||||
std::int64_t m_nArgv0Size;
|
||||
int64_t m_nArgv0Size;
|
||||
char m_pArgSBuffer[COMMAND_MAX_LENGTH];
|
||||
char m_pArgvBuffer[COMMAND_MAX_LENGTH];
|
||||
const char* m_ppArgv[COMMAND_MAX_ARGC];
|
||||
@ -93,6 +93,7 @@ public:
|
||||
|
||||
int GetFlags(void) const;
|
||||
ConCommandBase* GetNext(void) const;
|
||||
const char* GetName(void) const;
|
||||
const char* GetHelpText(void) const;
|
||||
const char* GetUsageText(void) const;
|
||||
|
||||
@ -120,6 +121,8 @@ public:
|
||||
ConCommand(void) {};
|
||||
ConCommand(const char* szName, const char* szHelpString, int nFlags, void* pCallback, void* pCommandCompletionCallback);
|
||||
void Init(void);
|
||||
void InitShipped(void);
|
||||
void PurgeShipped(void) const;
|
||||
bool IsCommand(void) const;
|
||||
|
||||
void* m_nNullCallBack {}; //0x0040
|
||||
|
@ -5,6 +5,13 @@
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ENGINE |
|
||||
ConVar* single_frame_shutdown_for_reload = nullptr;
|
||||
|
||||
ConVar* hostname = nullptr;
|
||||
ConVar* hostport = nullptr;
|
||||
ConVar* host_hasIrreversibleShutdown = nullptr;
|
||||
ConVar* mp_gamemode = nullptr;
|
||||
|
||||
ConVar* cm_debug_cmdquery = nullptr;
|
||||
ConVar* cm_return_false_cmdquery_all = nullptr;
|
||||
ConVar* cm_return_false_cmdquery_cheats = nullptr;
|
||||
@ -97,6 +104,7 @@ ConVar* sq_showvmwarning = nullptr;
|
||||
//-----------------------------------------------------------------------------
|
||||
// NETCHANNEL |
|
||||
ConVar* net_userandomkey = nullptr;
|
||||
ConVar* net_usesocketsforloopback = nullptr;
|
||||
ConVar* r5net_matchmaking_hostname = nullptr;
|
||||
ConVar* r5net_show_debug = nullptr;
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -107,6 +115,26 @@ ConVar* r5net_show_debug = nullptr;
|
||||
ConVar* rui_drawEnable = nullptr;
|
||||
#endif // !DEDICATED
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: registers input commands.
|
||||
// Input : *pszCommandName -
|
||||
//-----------------------------------------------------------------------------
|
||||
ConCommandBase* CCVar::RegisterConCommand(ConCommandBase* pCommandToRemove)
|
||||
{
|
||||
static int index = 9;
|
||||
return CallVFunc<ConCommandBase*>(index, this, pCommandToRemove);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: unregisters input commands.
|
||||
// Input : *pszCommandName -
|
||||
//-----------------------------------------------------------------------------
|
||||
ConCommandBase* CCVar::UnregisterConCommand(ConCommandBase* pCommandToRemove)
|
||||
{
|
||||
static int index = 10;
|
||||
return CallVFunc<ConCommandBase*>(index, this, pCommandToRemove);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: finds base commands.
|
||||
// Input : *pszCommandName -
|
||||
@ -140,7 +168,7 @@ ConCommand* CCVar::FindCommand(const char* pszCommandName)
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: iterates over all ConVars
|
||||
//-----------------------------------------------------------------------------
|
||||
CCVarIteratorInternal* CCVar::FactoryInternalIterator()
|
||||
CCVarIteratorInternal* CCVar::FactoryInternalIterator(void)
|
||||
{
|
||||
static int index = 41;
|
||||
return CallVFunc<CCVarIteratorInternal*>(index, this);
|
||||
@ -149,12 +177,12 @@ CCVarIteratorInternal* CCVar::FactoryInternalIterator()
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: returns all ConVars
|
||||
//-----------------------------------------------------------------------------
|
||||
std::unordered_map<std::string, ConCommandBase*> CCVar::DumpToMap()
|
||||
unordered_map<string, ConCommandBase*> CCVar::DumpToMap(void)
|
||||
{
|
||||
std::stringstream ss;
|
||||
stringstream ss;
|
||||
CCVarIteratorInternal* itint = FactoryInternalIterator(); // Allocate new InternalIterator.
|
||||
|
||||
std::unordered_map<std::string, ConCommandBase*> allConVars;
|
||||
unordered_map<string, ConCommandBase*> allConVars;
|
||||
|
||||
for (itint->SetFirst(); itint->IsValid(); itint->Next()) // Loop through all instances.
|
||||
{
|
||||
@ -167,5 +195,5 @@ std::unordered_map<std::string, ConCommandBase*> CCVar::DumpToMap()
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
std::vector<std::string> g_vsvCommandBases;
|
||||
vector<string> g_vsvCommandBases;
|
||||
CCVar* g_pCVar = reinterpret_cast<CCVar*>(p_CEngineAPI_Connect.FindPatternSelf("48 8D 0D", CMemory::Direction::DOWN, 40).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr());
|
||||
|
@ -3,6 +3,14 @@
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// ENGINE |
|
||||
extern ConVar* single_frame_shutdown_for_reload;
|
||||
|
||||
extern ConVar* hostname;
|
||||
extern ConVar* hostport;
|
||||
extern ConVar* host_hasIrreversibleShutdown;
|
||||
|
||||
extern ConVar* mp_gamemode;
|
||||
|
||||
extern ConVar* cm_debug_cmdquery;
|
||||
extern ConVar* cm_return_false_cmdquery_all;
|
||||
extern ConVar* cm_return_false_cmdquery_cheats;
|
||||
@ -93,6 +101,7 @@ extern ConVar* sq_showvmwarning;
|
||||
//-------------------------------------------------------------------------
|
||||
// NETCHANNEL |
|
||||
extern ConVar* net_userandomkey;
|
||||
extern ConVar* net_usesocketsforloopback;
|
||||
extern ConVar* r5net_matchmaking_hostname;
|
||||
extern ConVar* r5net_show_debug;
|
||||
//-------------------------------------------------------------------------
|
||||
@ -115,11 +124,13 @@ public:
|
||||
class CCVar
|
||||
{
|
||||
public:
|
||||
ConCommandBase* RegisterConCommand(ConCommandBase* pCommandToAdd);
|
||||
ConCommandBase* UnregisterConCommand(ConCommandBase* pCommandToRemove);
|
||||
ConCommandBase* FindCommandBase(const char* pszCommandName); // @0x1405983A0 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
|
||||
ConVar* FindVar(const char* pszVarName); // @0x1405983B0 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
|
||||
ConCommand* FindCommand(const char* pszCommandName);
|
||||
CCVarIteratorInternal* FactoryInternalIterator();
|
||||
std::unordered_map<string, ConCommandBase*> DumpToMap();
|
||||
CCVarIteratorInternal* FactoryInternalIterator(void);
|
||||
unordered_map<string, ConCommandBase*> DumpToMap(void);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -95,6 +95,7 @@
|
||||
<ClCompile Include="..\vpc\keyvalues.cpp" />
|
||||
<ClCompile Include="..\vphysics\QHull.cpp" />
|
||||
<ClCompile Include="..\vpklib\packedstore.cpp" />
|
||||
<ClCompile Include="..\vstdlib\callback.cpp" />
|
||||
<ClCompile Include="..\vstdlib\completion.cpp" />
|
||||
<ClCompile Include="..\vstdlib\keyvaluessystem.cpp" />
|
||||
<ClCompile Include="..\windows\console.cpp" />
|
||||
@ -107,6 +108,7 @@
|
||||
<ClInclude Include="..\appframework\iappsystem.h" />
|
||||
<ClInclude Include="..\bsplib\bsplib.h" />
|
||||
<ClInclude Include="..\client\cdll_engine_int.h" />
|
||||
<ClInclude Include="..\client\client.h" />
|
||||
<ClInclude Include="..\client\vengineclient_impl.h" />
|
||||
<ClInclude Include="..\common\igameserverdata.h" />
|
||||
<ClInclude Include="..\common\netmessages.h" />
|
||||
@ -351,6 +353,7 @@
|
||||
<ClInclude Include="..\vpc\keyvalues.h" />
|
||||
<ClInclude Include="..\vphysics\QHull.h" />
|
||||
<ClInclude Include="..\vpklib\packedstore.h" />
|
||||
<ClInclude Include="..\vstdlib\callback.h" />
|
||||
<ClInclude Include="..\vstdlib\completion.h" />
|
||||
<ClInclude Include="..\vstdlib\keyvaluessystem.h" />
|
||||
<ClInclude Include="..\windows\console.h" />
|
||||
|
@ -414,6 +414,9 @@
|
||||
<ClCompile Include="..\public\module.cpp">
|
||||
<Filter>sdk\public</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\vstdlib\callback.cpp">
|
||||
<Filter>sdk\vstdlib</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\client\cdll_engine_int.h">
|
||||
@ -1178,6 +1181,12 @@
|
||||
<ClInclude Include="..\engine\host.h">
|
||||
<Filter>sdk\engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\client\client.h">
|
||||
<Filter>sdk\client</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\vstdlib\callback.h">
|
||||
<Filter>sdk\vstdlib</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\shared\resource\lockedserver.png">
|
||||
|
@ -124,6 +124,7 @@
|
||||
<ClInclude Include="..\appframework\iappsystem.h" />
|
||||
<ClInclude Include="..\bsplib\bsplib.h" />
|
||||
<ClInclude Include="..\client\cdll_engine_int.h" />
|
||||
<ClInclude Include="..\client\client.h" />
|
||||
<ClInclude Include="..\client\vengineclient_impl.h" />
|
||||
<ClInclude Include="..\common\igameserverdata.h" />
|
||||
<ClInclude Include="..\common\netmessages.h" />
|
||||
@ -352,6 +353,7 @@
|
||||
<ClInclude Include="..\vpc\keyvalues.h" />
|
||||
<ClInclude Include="..\vphysics\QHull.h" />
|
||||
<ClInclude Include="..\vpklib\packedstore.h" />
|
||||
<ClInclude Include="..\vstdlib\callback.h" />
|
||||
<ClInclude Include="..\vstdlib\completion.h" />
|
||||
<ClInclude Include="..\vstdlib\keyvaluessystem.h" />
|
||||
<ClInclude Include="..\windows\console.h" />
|
||||
@ -436,6 +438,7 @@
|
||||
<ClCompile Include="..\vpc\keyvalues.cpp" />
|
||||
<ClCompile Include="..\vphysics\QHull.cpp" />
|
||||
<ClCompile Include="..\vpklib\packedstore.cpp" />
|
||||
<ClCompile Include="..\vstdlib\callback.cpp" />
|
||||
<ClCompile Include="..\vstdlib\completion.cpp" />
|
||||
<ClCompile Include="..\vstdlib\keyvaluessystem.cpp" />
|
||||
<ClCompile Include="..\windows\console.cpp" />
|
||||
|
@ -852,6 +852,12 @@
|
||||
<ClInclude Include="..\engine\host.h">
|
||||
<Filter>sdk\engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\client\client.h">
|
||||
<Filter>sdk\client</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\vstdlib\callback.h">
|
||||
<Filter>sdk\vstdlib</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\common\opcodes.cpp">
|
||||
@ -1073,6 +1079,9 @@
|
||||
<ClCompile Include="..\public\module.cpp">
|
||||
<Filter>sdk\public</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\vstdlib\callback.cpp">
|
||||
<Filter>sdk\vstdlib</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\Dedicated.def" />
|
||||
|
@ -103,6 +103,7 @@
|
||||
<ClCompile Include="..\vpc\keyvalues.cpp" />
|
||||
<ClCompile Include="..\vphysics\QHull.cpp" />
|
||||
<ClCompile Include="..\vpklib\packedstore.cpp" />
|
||||
<ClCompile Include="..\vstdlib\callback.cpp" />
|
||||
<ClCompile Include="..\vstdlib\completion.cpp" />
|
||||
<ClCompile Include="..\vstdlib\keyvaluessystem.cpp" />
|
||||
<ClCompile Include="..\windows\console.cpp" />
|
||||
@ -115,6 +116,7 @@
|
||||
<ClInclude Include="..\appframework\iappsystem.h" />
|
||||
<ClInclude Include="..\bsplib\bsplib.h" />
|
||||
<ClInclude Include="..\client\cdll_engine_int.h" />
|
||||
<ClInclude Include="..\client\client.h" />
|
||||
<ClInclude Include="..\client\vengineclient_impl.h" />
|
||||
<ClInclude Include="..\common\igameserverdata.h" />
|
||||
<ClInclude Include="..\common\netmessages.h" />
|
||||
@ -370,6 +372,7 @@
|
||||
<ClInclude Include="..\vpc\keyvalues.h" />
|
||||
<ClInclude Include="..\vphysics\QHull.h" />
|
||||
<ClInclude Include="..\vpklib\packedstore.h" />
|
||||
<ClInclude Include="..\vstdlib\callback.h" />
|
||||
<ClInclude Include="..\vstdlib\completion.h" />
|
||||
<ClInclude Include="..\vstdlib\keyvaluessystem.h" />
|
||||
<ClInclude Include="..\windows\console.h" />
|
||||
|
@ -444,6 +444,9 @@
|
||||
<ClCompile Include="..\public\module.cpp">
|
||||
<Filter>sdk\public</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\vstdlib\callback.cpp">
|
||||
<Filter>sdk\vstdlib</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\client\cdll_engine_int.h">
|
||||
@ -1241,6 +1244,12 @@
|
||||
<ClInclude Include="..\engine\host.h">
|
||||
<Filter>sdk\engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\client\client.h">
|
||||
<Filter>sdk\client</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\vstdlib\callback.h">
|
||||
<Filter>sdk\vstdlib</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\shared\resource\lockedserver.png">
|
||||
|
20
r5dev/vstdlib/callback.cpp
Normal file
20
r5dev/vstdlib/callback.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
//=============================================================================//
|
||||
//
|
||||
// Purpose: Callback functions for ConVar's.
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#include "core/stdafx.h"
|
||||
#include "tier1/cvar.h"
|
||||
#include "tier1/IConVar.h"
|
||||
#include "vstdlib/callback.h"
|
||||
|
||||
/*
|
||||
=====================
|
||||
MP_GameMode_Changed_f
|
||||
=====================
|
||||
*/
|
||||
bool MP_GameMode_Changed_f(ConVar* pVTable)
|
||||
{
|
||||
return SetupGamemode(mp_gamemode->GetString());
|
||||
}
|
24
r5dev/vstdlib/callback.h
Normal file
24
r5dev/vstdlib/callback.h
Normal file
@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
#include "tier1/IConVar.h"
|
||||
|
||||
inline CMemory p_SetupGamemode = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\xD9\x48\xC7\xC0\x00\x00\x00\x00"), "xxxxxxxxxxxx????");
|
||||
inline auto SetupGamemode = p_SetupGamemode.RCast<bool(*)(const char* pszPlayList)>();
|
||||
|
||||
bool MP_GameMode_Changed_f(ConVar* pVTable);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class HCallback : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
std::cout << "| FUN: SetupGamemode : 0x" << std::hex << std::uppercase << p_SetupGamemode.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
}
|
||||
virtual void GetFun(void) const { }
|
||||
virtual void GetVar(void) const { }
|
||||
virtual void GetCon(void) const { }
|
||||
virtual void Attach(void) const { }
|
||||
virtual void Detach(void) const { }
|
||||
};
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
REGISTER(HCallback);
|
@ -554,7 +554,7 @@ void _NET_TraceNetChan_f_CompletionFunc(const CCommand& args)
|
||||
static bool bTraceNetChannel = false;
|
||||
if (!bTraceNetChannel)
|
||||
{
|
||||
g_pCVar->FindVar("net_usesocketsforloopback")->SetValue(1);
|
||||
net_usesocketsforloopback->SetValue(1);
|
||||
DevMsg(eDLL_T::ENGINE, "\n");
|
||||
DevMsg(eDLL_T::ENGINE, "+--------------------------------------------------------+\n");
|
||||
DevMsg(eDLL_T::ENGINE, "|>>>>>>>>>>>>>| NETCHANNEL TRACE ACTIVATED |<<<<<<<<<<<<<|\n");
|
||||
|
@ -4,13 +4,13 @@
|
||||
/* ==== CONCOMMANDCALLBACK ============================================================================================================================================== */
|
||||
#if defined (GAMEDLL_S1)
|
||||
inline CMemory p_Host_Map_f_CompletionFunc = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x18\x55\x41\x56\x41\x00\x00\x00\x00\x40\x02"), "xxxxxxxxx????xx");
|
||||
inline auto Host_Map_f_CompletionFunc = p_Host_Map_f_CompletionFunc.RCast<void (*)(CCommand* pCommand, char a2)>(); /*48 89 5C 24 18 55 41 56 41 ?? ?? ?? ?? 40 02*/
|
||||
inline auto _Host_Map_f_CompletionFunc = p_Host_Map_f_CompletionFunc.RCast<void (*)(CCommand* pCommand, char a2)>(); /*48 89 5C 24 18 55 41 56 41 ?? ?? ?? ?? 40 02*/
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
inline CMemory p_Host_Map_f_CompletionFunc = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x41\x56\x41\x57\x48\x81\xEC\x00\x00\x00\x00\x83\x3D"), "xxxxxxxxx????xx");
|
||||
inline auto Host_Map_f_CompletionFunc = p_Host_Map_f_CompletionFunc.RCast<void (*)(CCommand* pCommand, char a2)>(); /*40 55 41 56 41 57 48 81 EC ?? ?? ?? ?? 83 3D*/
|
||||
inline auto _Host_Map_f_CompletionFunc = p_Host_Map_f_CompletionFunc.RCast<void (*)(CCommand* pCommand, char a2)>(); /*40 55 41 56 41 57 48 81 EC ?? ?? ?? ?? 83 3D*/
|
||||
#endif
|
||||
inline CMemory p_DownloadPlaylists_f_CompletionFunc = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x33\xC9\xC6\x05\x00\x00\x00\x00\x00\xE9\x00\x00\x00\x00"), "xxxx?????x????");
|
||||
inline auto DownloadPlaylists_f_CompletionFunc = p_DownloadPlaylists_f_CompletionFunc.RCast<void(*)(void)>(); /*33 C9 C6 05 ?? ?? ?? ?? ?? E9 ?? ?? ?? ??*/
|
||||
inline auto _DownloadPlaylists_f_CompletionFunc = p_DownloadPlaylists_f_CompletionFunc.RCast<void(*)(void)>(); /*33 C9 C6 05 ?? ?? ?? ?? ?? E9 ?? ?? ?? ??*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef DEDICATED
|
||||
|
Loading…
x
Reference in New Issue
Block a user