This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/src/hooks/misc/add_gamer_to_session.cpp
gir489 49a34f5789
Some checks failed
Nightly Build / Check Recent Commit (push) Failing after 5s
Nightly Build / Build Nightly (push) Has been skipped
Nightly Build / Recreate Release (push) Has been skipped
Closes #3345 (#3346)
2024-07-14 17:10:40 +02:00

22 lines
918 B
C++

#include "gta_util.hpp"
#include "hooking/hooking.hpp"
#include "services/players/player_service.hpp"
#include <network/CNetGamePlayerDataMsg.hpp>
#include <network/Network.hpp>
#include <network/RemoteGamerInfoMsg.hpp>
namespace big
{
bool hooks::add_gamer_to_session(rage::netConnectionManager* mgr, std::uint32_t msg_id, int* req_id, RemoteGamerInfoMsg* info, int flags, void* a6)
{
if (g.session.hide_token_spoofing_when_host
&& info->m_gamer_info.m_gamer_handle.m_rockstar_id == g_player_service->get_self()->get_rockstar_id())
{
info->m_gamer_info.m_host_token = g.session.original_host_token;
info->m_gamer_info.m_peer_id = (info->m_gamer_info.m_peer_id & 0xFFFFFFFF) | (g.session.original_host_token & 0xFFFFFFFF00000000); // TODO: P2pSecurity info message
}
return g_hooking->get_original<hooks::add_gamer_to_session>()(mgr, msg_id, req_id, info, flags, a6);
}
}