Matchmaking classes (#175)

This commit is contained in:
maybegreat48 2024-05-21 21:15:11 +00:00 committed by GitHub
parent 5757929581
commit 70e0a129a0
5 changed files with 103 additions and 63 deletions

View File

@ -119,6 +119,8 @@
#include "network/CNetGamePlayer.hpp"
#include "network/CNetGamePlayerDataMsg.hpp"
#include "network/CNetworkPlayerMgr.hpp"
#include "network/MatchmakingAttributes.hpp"
#include "network/MatchmakingId.hpp"
#include "network/netObject.hpp"
#include "network/netPeerAddress.hpp"
#include "network/netPlayer.hpp"

View File

@ -0,0 +1,14 @@
#pragma once
#include <cstdint>
class MatchmakingAttributes
{
public:
uint32_t m_game_mode; //0x0000
uint32_t m_num_params; //0x0004
uint32_t m_param_unk[8]; //0x0008
char m_param_names[8][24]; //0x0028
uint32_t m_param_values[8]; //0x00E8
uint32_t m_params_bitset; //0x0108
}; //Size: 0x010C
static_assert(sizeof(MatchmakingAttributes) == 0x10C);

14
network/MatchmakingId.hpp Normal file
View File

@ -0,0 +1,14 @@
#pragma once
#include <cstdint>
#include <cstddef>
#pragma pack(push, 1)
class MatchmakingId
{
public:
char m_data1[0x26];
std::uint64_t m_data2;
std::uint64_t m_data3;
};
static_assert(offsetof(MatchmakingId, MatchmakingId::m_data3) == 0x2E);
#pragma pack(pop)

View File

@ -3,6 +3,7 @@
#include "../security/ObfVar.hpp"
#include "CNetComplaintMgr.hpp"
#include "snSession.hpp"
#include "MatchmakingAttributes.hpp"
#include <cstring>
#pragma pack(push, 1)
@ -15,16 +16,36 @@ public:
}; //Size: 0x0348
static_assert(sizeof(MetricSessionMigrated) == 0x348);
class NetworkGameConfig
class NetworkBaseConfig
{
public:
virtual ~NetworkBaseConfig() = 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
};
static_assert(sizeof(NetworkBaseConfig) == 0x30);
class NetworkGameConfig : public NetworkBaseConfig
{
public:
char pad_0000[48]; //0x0000
uint32_t m_public_slots; //0x0030
uint32_t m_private_slots; //0x0034
char pad_0038[272]; //0x0038
MatchmakingAttributes m_matchmaking_attributes; //0x0038
char m_pad[0x4];
}; //Size: 0x0148
static_assert(sizeof(NetworkGameConfig) == 0x148);
// this is not MatchmakingAttributes
class NetworkGameFilterMatchmakingComponent
{
public:
@ -57,34 +78,9 @@ public:
}; //Size: 0x0314
static_assert(sizeof(NetworkGameFilterMatchmakingComponent) == 0x314);
class MatchmakingAttributes
class NetworkGameFilter : public NetworkBaseConfig
{
public:
uint32_t m_game_mode; //0x0000
uint32_t m_num_params; //0x0004
uint32_t m_param_unk[8]; //0x0008
char m_param_names[8][24]; //0x0028
uint32_t m_param_values[8]; //0x00E8
uint32_t m_params_bitset; //0x0108
}; //Size: 0x010C
static_assert(sizeof(MatchmakingAttributes) == 0x10C);
class NetworkGameFilter
{
public:
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);

View File

@ -2,6 +2,7 @@
#include "../rage/rlGamerInfo.hpp"
#include "../rage/rlSessionInfo.hpp"
#include "MatchmakingAttributes.hpp"
#pragma pack(push, 1)
namespace rage
@ -51,32 +52,45 @@ namespace rage
}; //Size: 0x0770
static_assert(sizeof(rage::rlSession) == 0x770);
class rlSessionConfig
{
public:
char m_pad[0x4]; // 0x00
int m_public_slots; // 0x04
int m_private_slots; // 0x08
MatchmakingAttributes m_matchmaking_attributes; // 0x0C
char m_pad2[0x18]; // 0x10C
};
static_assert(sizeof(rage::rlSessionConfig) == 0x130);
class rlSessionDetail
{
public:
class rage::rlGamerInfoBase m_base_gamer_info;
char pad_0060[8]; //0x0060
class rage::rlSessionInfo m_session_info; //0x0068
char pad_00D8[14]; //0x00D8
uint16_t m_session_type; //0x00E6
char pad_00E8[324]; //0x00E8
uint32_t m_player_count; //0x022C
uint32_t m_unk_player_count; //0x0230
char pad_0234[2]; //0x0234
int16_t m_unk_pos_x; //0x0236
int16_t m_unk_pos_y; //0x0238
int16_t m_unk_pos_z; //0x023A
uint8_t m_matchmaking_property_ids[32]; //0x023C
char pad_025C[2]; //0x025C
uint16_t m_rank; //0x025E
char pad_0260[1]; //0x0260
uint8_t m_mental_state; //0x0261
char pad_0262[21]; //0x0262
uint8_t m_population_density; //0x0277
char pad_0278[320]; //0x0278
class rage::rlGamerInfoBase m_base_gamer_info; // 0x00
std::uint64_t m_host_token; // 0xC0
class rage::rlSessionInfo m_session_info; // 0xC8
class rage::rlSessionConfig m_session_config; // 0x198
rage::rlGamerHandle m_handle; // 0x2C8
char m_name[0x14]; // 0x2D8
uint32_t m_player_count; // 0x2EC
uint32_t m_spectator_count; // 0x2F0
uint16_t m_session_data_struct_size; // 0x2F4
char m_session_data_struct[0x100]; // 0x2F6 likely a union of two structs, sizes 0x44 and 0x28
uint16_t m_matchmaking_data_struct_size; // 0x3F6
char m_matchmaking_data_struct[0x80]; // 0x3F8 stores matchmaking tunable data?
}; //Size: 0x03CA
static_assert(sizeof(rlSessionDetail) == 0x478);
class rlSessionDetailMsg
{
public:
int m_status;
int m_required_version;
int m_request_token;
int m_unk;
rlSessionDetail m_detail;
};
static_assert(sizeof(rlSessionDetailMsg) == 0x488);
class rlMatchmakingFindResult
{