fix region selector

This commit is contained in:
rei-2 committed 2024-10-19 17:51:13 -04:00
1 parent 417d890064
commit c5061ee2fc
5 files changed
+26 -7

No files matched your search

+2 -1
View File
@@ -529,7 +529,7 @@
<ClCompile Include="src\Hooks\DoEnginePostProcessing.cpp" />
<ClCompile Include="src\Hooks\DSP_Process.cpp" />
<ClCompile Include="src\Hooks\IEngineTrace_TraceRay.cpp" />
<ClCompile Include="src\Hooks\ISteamNetworkingUtils_GetDirectPingToPOP.cpp" />
<ClCompile Include="src\Hooks\ISteamNetworkingUtils_GetPingToDataCenter.cpp" />
<ClCompile Include="src\Hooks\IVEngineClient_ClientCmd_Unrestricted.cpp" />
<ClCompile Include="src\Hooks\IEngineVGui_Paint.cpp" />
<ClCompile Include="src\Hooks\GetClientInterpAmount.cpp" />
@@ -629,6 +629,7 @@
<ClInclude Include="src\Features\Visuals\Visuals.h" />
<ClInclude Include="src\Hooks\Direct3DDevice9.h" />
<ClInclude Include="src\SDK\Definitions\Interfaces\CTFGameRules.h" />
<ClInclude Include="src\SDK\Definitions\Interfaces\CTFGCClientSystem.h" />
<ClInclude Include="src\SDK\Definitions\Interfaces\IGameMovement.h" />
<ClInclude Include="src\SDK\Definitions\Interfaces\IInput.h" />
<ClInclude Include="src\SDK\Definitions\Interfaces\IPanel.h" />
+2 -1
View File
@@ -154,7 +154,7 @@
<ClCompile Include="src\Hooks\CNetChannel_SendDatagram.cpp" />
<ClCompile Include="src\Hooks\CNetChannel_SendNetMsg.cpp" />
<ClCompile Include="src\Hooks\ClientModeTFNormal_UpdateSteamRichPresence.cpp" />
<ClCompile Include="src\Hooks\ISteamNetworkingUtils_GetDirectPingToPOP.cpp" />
<ClCompile Include="src\Hooks\ISteamNetworkingUtils_GetPingToDataCenter.cpp" />
<ClCompile Include="src\Hooks\RecvProxy_SimulationTime.cpp" />
<ClCompile Include="src\Hooks\CAttributeManager_AttribHookValue.cpp" />
<ClCompile Include="src\Hooks\TF_IsHolidayActive.cpp" />
@@ -437,6 +437,7 @@
<ClInclude Include="src\SDK\Definitions\Misc\UtlIntrusiveList.h" />
<ClInclude Include="src\SDK\Definitions\Main\CCaptureFlag.h" />
<ClInclude Include="src\SDK\Definitions\Interfaces\IPanel.h" />
<ClInclude Include="src\SDK\Definitions\Interfaces\CTFGCClientSystem.h" />
</ItemGroup>
<ItemGroup>
<None Include="cpp.hint" />
@@ -1,5 +1,7 @@
#include "../SDK/SDK.h"
MAKE_SIGNATURE(CTFGCClientSystem_PingThink, "client.dll", "48 89 4C 24 ? 55 41 54 41 55 48 8D AC 24 ? ? ? ? 48 81 EC", 0x0);
void POPID_ToString(SteamNetworkingPOPID popID, char* out)
{
out[0] = static_cast<char>(popID >> 16);
@@ -50,17 +52,26 @@ unsigned int GetDatacenter(uint32_t uHash)
return 0;
}
MAKE_HOOK(ISteamNetworkingUtils_GetDirectPingToPOP, U::Memory.GetVFunc(I::SteamNetworkingUtils, 9), int, __fastcall,
void* rcx, SteamNetworkingPOPID popID)
MAKE_HOOK(ISteamNetworkingUtils_GetPingToDataCenter, U::Memory.GetVFunc(I::SteamNetworkingUtils, 8), int, __fastcall,
void* rcx, SteamNetworkingPOPID popID, SteamNetworkingPOPID* pViaRelayPoP)
{
int iOriginal = CALL_ORIGINAL(rcx, popID);
int iReturn = CALL_ORIGINAL(rcx, popID, pViaRelayPoP);
if (!Vars::Misc::Queueing::ForceRegions.Value)
return iOriginal;
return iReturn;
char popIDName[5];
POPID_ToString(popID, popIDName);
if (auto uDatacenter = GetDatacenter(FNV1A::Hash32(popIDName)))
return Vars::Misc::Queueing::ForceRegions.Value & uDatacenter ? 1 : 999999;
return iOriginal;
return iReturn;
}
MAKE_HOOK(CTFPartyClient_RequestQueueForMatch, S::CTFPartyClient_RequestQueueForMatch(), void, __fastcall,
void* rcx, int eMatchGroup)
{
*reinterpret_cast<bool*>(uintptr_t(I::TFGCClientSystem) + 1116) = true;
S::CTFGCClientSystem_PingThink.As<void(__fastcall*)(void*)>()(I::TFGCClientSystem);
return CALL_ORIGINAL(rcx, eMatchGroup);
}
+1
View File
@@ -6,6 +6,7 @@
#include "Interfaces/CClientState.h"
#include "Interfaces/CGlobalVarsBase.h"
#include "Interfaces/CTFGameRules.h"
#include "Interfaces/CTFGCClientSystem.h"
#include "Interfaces/CTFPartyClient.h"
#include "Interfaces/IClientEntityList.h"
#include "Interfaces/ICVar.h"
@@ -0,0 +1,5 @@
#include "Interface.h"
class CTFGCClientSystem;
MAKE_INTERFACE_SIGNATURE(CTFGCClientSystem, TFGCClientSystem, "client.dll", "48 8D 05 ? ? ? ? C3 CC CC CC CC CC CC CC CC 48 8B 05 ? ? ? ? C3 CC CC CC CC CC CC CC CC 48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24", 0x0, 0);