Refactor m_rockstar_id into its proper type of a 64-bit signed integer. (#2901)

This commit is contained in:
gir489 2024-03-31 15:11:52 -04:00 committed by GitHub
parent 4e1deb4ef0
commit 8425cae0f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 5 deletions

View File

@ -3,7 +3,7 @@ include(FetchContent)
FetchContent_Declare( FetchContent_Declare(
gtav_classes gtav_classes
GIT_REPOSITORY https://github.com/Yimura/GTAV-Classes.git GIT_REPOSITORY https://github.com/Yimura/GTAV-Classes.git
GIT_TAG a3031a89788141f292a83d18587277e04d367c4a GIT_TAG ddd118410c5ede28e3a5978ebda93b83634d3293
GIT_PROGRESS TRUE GIT_PROGRESS TRUE
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
BUILD_COMMAND "" BUILD_COMMAND ""

View File

@ -91,9 +91,9 @@ namespace rage
{ {
return big::g_pointers->m_gta.m_read_bitbuf_bool(this, boolean, 1); return big::g_pointers->m_gta.m_read_bitbuf_bool(this, boolean, 1);
} }
bool ReadPeerId(uint64_t* peer_id) bool ReadRockstarId(int64_t* rockstar_id)
{ {
return this->ReadQWord(peer_id, 0x40); return this->ReadInt64(rockstar_id, sizeof(rockstar_id) * 8);
} }
uint64_t ReadBits(size_t numBits) uint64_t ReadBits(size_t numBits)
{ {
@ -207,6 +207,10 @@ namespace rage
{ {
return big::g_pointers->m_gta.m_write_bitbuf_int64(this, integer, bits); return big::g_pointers->m_gta.m_write_bitbuf_int64(this, integer, bits);
} }
bool WriteRockstarId(int64_t rockstar_id)
{
return big::g_pointers->m_gta.m_write_bitbuf_int64(this, rockstar_id, sizeof(rockstar_id) * 8);
}
bool ReadInt64(int64_t* integer, int bits) bool ReadInt64(int64_t* integer, int bits)
{ {
uint32_t v8; uint32_t v8;

View File

@ -22,7 +22,7 @@ inline void gamer_handle_deserialize(rage::rlGamerHandle& hnd, rage::datBitBuffe
if ((hnd.m_platform = buf.Read<uint8_t>(sizeof(hnd.m_platform) * 8)) != rage::rlPlatforms::PC) if ((hnd.m_platform = buf.Read<uint8_t>(sizeof(hnd.m_platform) * 8)) != rage::rlPlatforms::PC)
return; return;
buf.ReadPeerId(&hnd.m_rockstar_id); buf.ReadRockstarId(&hnd.m_rockstar_id);
hnd.m_padding = buf.Read<uint8_t>(sizeof(hnd.m_padding) * 8); hnd.m_padding = buf.Read<uint8_t>(sizeof(hnd.m_padding) * 8);
} }

View File

@ -21,7 +21,7 @@ namespace
buf.Write<uint8_t>(hnd.m_platform, sizeof(hnd.m_platform) * 8); buf.Write<uint8_t>(hnd.m_platform, sizeof(hnd.m_platform) * 8);
if (hnd.m_platform == rage::rlPlatforms::PC) if (hnd.m_platform == rage::rlPlatforms::PC)
{ {
buf.WriteInt64(hnd.m_rockstar_id, sizeof(hnd.m_rockstar_id) * 8); buf.WriteRockstarId(hnd.m_rockstar_id);
buf.Write<uint8_t>(hnd.m_padding, sizeof(hnd.m_padding) * 8); buf.Write<uint8_t>(hnd.m_padding, sizeof(hnd.m_padding) * 8);
} }
} }