From 72d09f1edb1e21de9845cf222dfb7667f2417be4 Mon Sep 17 00:00:00 2001 From: maybegreat48 <96936658+maybegreat48@users.noreply.github.com> Date: Thu, 24 Nov 2022 00:09:08 +0000 Subject: [PATCH] Update matchmaking and join request classes (#78) --- network/Network.hpp | 53 ++++++++++++++++++++++++++++++---- network/RemoteGamerInfoMsg.hpp | 10 +++++-- 2 files changed, 54 insertions(+), 9 deletions(-) diff --git a/network/Network.hpp b/network/Network.hpp index 1276359..3f86e10 100644 --- a/network/Network.hpp +++ b/network/Network.hpp @@ -3,6 +3,7 @@ #include "../security/Obf32.hpp" #include "CNetComplaintMgr.hpp" #include "snSession.hpp" +#include #pragma pack(push, 1) @@ -24,15 +25,55 @@ public: }; //Size: 0x0148 static_assert(sizeof(NetworkGameConfig) == 0x148); +class NetworkGameFilterMatchmakingComponent +{ +public: + // do not use for actual network filters, this will break things + inline void SetParameter(const char* name, int index, int value) + { + std::strcpy(m_param_names[index], name); + m_param_mappings[index] = index; + m_param_values[index] = value; + m_enabled_params_bitset |= (1 << index); + + if (m_num_parameters <= index) + m_num_parameters++; + } + + uint32_t m_filter_type; //0x0000 + char m_filter_name[24]; //0x0004 + uint32_t m_num_parameters; //0x001C + uint16_t m_game_mode; //0x0020 + uint16_t m_session_type; //0x0022 + uint32_t m_param_unk[8]; //0x0024 + char m_param_names[8][24]; //0x0044 + char pad_0104[4]; //0x0104 + uint32_t m_param_mappings[8]; //0x0108 + char pad_0128[352]; //0x0128 + uint32_t m_param_values[8]; //0x0288 + char pad_02A8[96]; //0x02A8 + uint32_t m_enabled_params_bitset; //0x0308 + char pad_030C[8]; //0x030C +}; //Size: 0x0314 +static_assert(sizeof(NetworkGameFilterMatchmakingComponent) == 0x314); + class NetworkGameFilter { public: - char pad_0000[16]; //0x0000 - char m_game_mode[24]; //0x0010 - char pad_0028[8]; //0x0028 - uint32_t m_attribute_values[8]; //0x0030 - char m_attribute_names[8][24]; //0x0050 - char pad_0110[564]; //0x0110 + virtual ~NetworkGameFilter() = default; + virtual void Reset() {}; + + uint32_t m_build_type; //0x0008 + uint32_t m_discriminator; //0x000C + uint32_t m_discriminator_mapping; //0x0010 + uint32_t m_region_mapping; //0x0014 + uint32_t m_language_mapping; //0x0018 + uint32_t m_mm_group_1_mapping; //0x001C + uint32_t m_mm_group_2_mapping; //0x0020 + uint32_t m_activity_type_mapping; //0x0024 + uint32_t m_activity_id_mapping; //0x0028 + uint32_t m_activity_players_mapping; //0x002C + class NetworkGameFilterMatchmakingComponent m_matchmaking_component; //0x0030 }; //Size: 0x0344 static_assert(sizeof(NetworkGameFilter) == 0x344); diff --git a/network/RemoteGamerInfoMsg.hpp b/network/RemoteGamerInfoMsg.hpp index e680a0d..e8e462d 100644 --- a/network/RemoteGamerInfoMsg.hpp +++ b/network/RemoteGamerInfoMsg.hpp @@ -8,7 +8,11 @@ class RemoteGamerInfoMsg public: uint64_t m_session_id; //0x0000 class rage::rlGamerInfo m_gamer_info; //0x0008 - char pad_00A0[256]; //0x00A0 (tons of more fields down here, like IP addresses...) -}; //Size: 0x01A0 -static_assert(sizeof(RemoteGamerInfoMsg) == 0x1A0); + char pad_00A0[32]; //0x00A0 + uint32_t m_unk; //0x00C0 + char pad_00C4[516]; //0x00C4 + uint32_t m_required_player_count; //0x02C8 + char pad_02CC[20]; //0x02CC +}; //Size: 0x02E0 +static_assert(sizeof(RemoteGamerInfoMsg) == 0x2E0); #pragma pack(pop)