Fixed gamer_handle_serialize/deserialize using the wrong sizes. (#2886)

This commit is contained in:
gir489 2024-03-28 15:15:33 -04:00 committed by GitHub
parent 4636ef8346
commit 21da47f3e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -19,11 +19,11 @@
inline void gamer_handle_deserialize(rage::rlGamerHandle& hnd, rage::datBitBuffer& buf) inline void gamer_handle_deserialize(rage::rlGamerHandle& hnd, rage::datBitBuffer& buf)
{ {
if ((hnd.m_platform = buf.Read<uint8_t>(sizeof(hnd.m_platform))) != 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.ReadPeerId(&hnd.m_rockstar_id);
hnd.m_padding = buf.Read<uint8_t>(sizeof(hnd.m_padding)); hnd.m_padding = buf.Read<uint8_t>(sizeof(hnd.m_padding) * 8);
} }
inline bool is_kick_instruction(rage::datBitBuffer& buffer) inline bool is_kick_instruction(rage::datBitBuffer& buffer)

View File

@ -18,11 +18,11 @@ namespace
{ {
static void gamer_handle_serialize(rage::rlGamerHandle& hnd, rage::datBitBuffer& buf) static void gamer_handle_serialize(rage::rlGamerHandle& hnd, rage::datBitBuffer& buf)
{ {
buf.Write<uint8_t>(hnd.m_platform, sizeof(hnd.m_platform)); 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.WriteQWord(hnd.m_rockstar_id, sizeof(hnd.m_rockstar_id)); buf.WriteQWord(hnd.m_rockstar_id, sizeof(hnd.m_rockstar_id) * 8);
buf.Write<uint8_t>(hnd.m_padding, sizeof(hnd.m_padding)); buf.Write<uint8_t>(hnd.m_padding, sizeof(hnd.m_padding) * 8);
} }
} }