More player database improvements (#1725)

This commit is contained in:
maybegreat48
2023-07-15 20:37:20 +00:00
committed by GitHub
parent a40b4a0dd8
commit 973121076e
18 changed files with 388 additions and 38 deletions

View File

@ -1,11 +1,17 @@
#include "hooking.hpp"
#include "services/player_database/player_database_service.hpp"
namespace big
{
inline bool block_session_presence()
{
return g.protections.rid_join || (g_player_database_service && g_player_database_service->is_redirect_join_active());
}
bool hooks::update_presence_attribute_int(void* presence_data, int profile_index, char* attr, std::uint64_t value)
{
auto hash = rage::joaat(attr);
if (g.protections.rid_join && (hash == RAGE_JOAAT("gstok") || hash == RAGE_JOAAT("gsid") || hash == RAGE_JOAAT("gstype") || hash == RAGE_JOAAT("gshost") || hash == RAGE_JOAAT("gsjoin")))
if (block_session_presence() && (hash == RAGE_JOAAT("gstok") || hash == RAGE_JOAAT("gsid") || hash == RAGE_JOAAT("gstype") || hash == RAGE_JOAAT("gshost") || hash == RAGE_JOAAT("gsjoin")))
{
return true;
}
@ -16,7 +22,7 @@ namespace big
bool hooks::update_presence_attribute_string(void* presence_data, int profile_index, char* attr, char* value)
{
auto hash = rage::joaat(attr);
if (g.protections.rid_join && hash == RAGE_JOAAT("gsinfo"))
if (block_session_presence() && hash == RAGE_JOAAT("gsinfo"))
{
return true;
}