diff --git a/classes.cpp b/classes.cpp index 4a50ce6..b7b2a3c 100644 --- a/classes.cpp +++ b/classes.cpp @@ -50,6 +50,8 @@ #include "netsync/nodes/entity/CEntityOrientationDataNode.hpp" #include "netsync/nodes/entity/CEntityScriptGameStateDataNode.hpp" #include "netsync/nodes/entity/CEntityScriptInfoDataNode.hpp" +#include "netsync/nodes/heli/CHeliHealthDataNode.hpp" +#include "netsync/nodes/heli/CHeliControlDataNode.hpp" #include "netsync/nodes/object/CObjectCreationDataNode.hpp" #include "netsync/nodes/ped/CPedAIDataNode.hpp" #include "netsync/nodes/ped/CPedAppearanceDataNode.hpp" @@ -60,23 +62,31 @@ #include "netsync/nodes/ped/CPedHealthDataNode.hpp" #include "netsync/nodes/ped/CPedInventoryDataNode.hpp" #include "netsync/nodes/ped/CPedMovementDataNode.hpp" +#include "netsync/nodes/ped/CPedMovementGroupDataNode.hpp" #include "netsync/nodes/ped/CPedOrientationDataNode.hpp" #include "netsync/nodes/ped/CPedScriptCreationDataNode.hpp" +#include "netsync/nodes/ped/CPedTaskSequenceDataNode.hpp" #include "netsync/nodes/ped/CPedTaskSpecificDataNode.hpp" +#include "netsync/nodes/ped/CPedTaskTreeDataNode.hpp" #include "netsync/nodes/physical/CPhysicalAngVelocityDataNode.hpp" #include "netsync/nodes/physical/CPhysicalAttachDataNode.hpp" +#include "netsync/nodes/physical/CPhysicalGameStateDataNode.hpp" #include "netsync/nodes/physical/CPhysicalHealthDataNode.hpp" #include "netsync/nodes/physical/CPhysicalMigrationDataNode.hpp" +#include "netsync/nodes/physical/CPhysicalScriptGameStateDataNode.hpp" #include "netsync/nodes/physical/CPhysicalScriptMigrationDataNode.hpp" #include "netsync/nodes/physical/CPhysicalVelocityDataNode.hpp" #include "netsync/nodes/pickup/CPickupCreationDataNode.hpp" #include "netsync/nodes/pickup_placement/CPickupPlacementCreationDataNode.hpp" +#include "netsync/nodes/player/CPlayerAmbientModelStreamingNode.hpp" #include "netsync/nodes/player/CPlayerAppearanceDataNode.hpp" #include "netsync/nodes/player/CPlayerCameraDataNode.hpp" #include "netsync/nodes/player/CPlayerCreationDataNode.hpp" #include "netsync/nodes/player/CPlayerGamerDataNode.hpp" #include "netsync/nodes/player/CPlayerGameStateDataNode.hpp" +#include "netsync/nodes/player/CPlayerPedGroupDataNode.hpp" #include "netsync/nodes/player/CPlayerSectorPosNode.hpp" +#include "netsync/nodes/player/CPlayerWantedAndLOSDataNode.hpp" #include "netsync/nodes/proximity_migrateable/CGlobalFlagsDataNode.hpp" #include "netsync/nodes/proximity_migrateable/CMigrationDataNode.hpp" #include "netsync/nodes/proximity_migrateable/CSectorDataNode.hpp" @@ -84,8 +94,15 @@ #include "netsync/nodes/task/ClonedTakeOffPedVariationInfo.hpp" #include "netsync/nodes/train/CTrainGameStateDataNode.hpp" #include "netsync/nodes/vehicle/CVehicleCreationDataNode.hpp" +#include "netsync/nodes/vehicle/CVehicleControlDataNode.hpp" +#include "netsync/nodes/vehicle/CVehicleTaskDataNode.hpp" #include "netsync/nodes/vehicle/CVehicleGadgetDataNode.hpp" #include "netsync/nodes/vehicle/CVehicleProximityMigrationDataNode.hpp" +#include "netsync/nodes/vehicle/CVehicleComponentReservationDataNode.hpp" +#include "netsync/nodes/vehicle/CVehicleDamageStatusDataNode.hpp" +#include "netsync/nodes/vehicle/CVehicleSteeringDataNode.hpp" +#include "netsync/nodes/vehicle/CVehicleHealthDataNode.hpp" +#include "netsync/nodes/vehicle/CVehicleGameStateDataNode.hpp" #include "netsync/trees/CDynamicEntitySyncTreeBase.hpp" #include "netsync/trees/CEntitySyncTreeBase.hpp" #include "netsync/trees/CPhysicalSyncTreeBase.hpp" @@ -108,6 +125,7 @@ #include "network/RemoteGamerInfoMsg.hpp" #include "network/snConnectToPeerTask.hpp" #include "network/snSession.hpp" +#include "network/netConnection.hpp" #include "ped/CPed.hpp" #include "ped/CPedBoneInfo.hpp" #include "ped/CPedFactory.hpp" diff --git a/gtav.rcnet b/gtav.rcnet index 6ed4e9f..4861669 100644 Binary files a/gtav.rcnet and b/gtav.rcnet differ diff --git a/netsync/nodes/entity/CEntityScriptGameStateDataNode.hpp b/netsync/nodes/entity/CEntityScriptGameStateDataNode.hpp index 7616b61..ac12b91 100644 --- a/netsync/nodes/entity/CEntityScriptGameStateDataNode.hpp +++ b/netsync/nodes/entity/CEntityScriptGameStateDataNode.hpp @@ -4,9 +4,9 @@ #pragma pack(push, 4) struct CEntityScriptGameStateDataNode : CSyncDataNodeInfrequent { - bool m_visible; //0x00C0 + bool m_fixed; //0x00C0 bool m_uses_collision; //0x00C1 - bool m_fixed; //0x00C2 + bool m_completely_disabled_collision; //0x00C2 }; //Size: 0x00C3 static_assert(sizeof(CEntityScriptGameStateDataNode) == 0xC4); #pragma pack(pop) \ No newline at end of file diff --git a/netsync/nodes/heli/CHeliControlDataNode.hpp b/netsync/nodes/heli/CHeliControlDataNode.hpp new file mode 100644 index 0000000..aaaaa1e --- /dev/null +++ b/netsync/nodes/heli/CHeliControlDataNode.hpp @@ -0,0 +1,25 @@ +#pragma once +#include +#include "netsync/CProjectBaseSyncDataNode.hpp" +#include "netsync/nodes/vehicle/CVehicleControlDataNode.hpp" + +#pragma pack(push, 8) +class CHeliControlDataNode : CVehicleControlDataNode +{ +public: + char m_pad[0x10]; // 0x130 + float m_yaw_control; // 0x140 + float m_pitch_control; // 0x144 + float m_roll_control; // 0x148 + float m_throttle_control; // 0x14C + bool m_engine_off; // 0x150 + int m_landing_gear_state; // 0x154 + bool m_has_landing_gear; // 0x158 + bool m_has_vehicle_task; // 0x159 + bool m_is_thruster_model; // 0x15A + float m_thruster_side_rcs_throttle; // 0x15C + float m_thruster_throttle; // 0x160 + bool m_unk8; // 0x164 +}; +static_assert(sizeof(CHeliControlDataNode) == 0x168); +#pragma pack(pop) \ No newline at end of file diff --git a/netsync/nodes/object/CObjectCreationDataNode.hpp b/netsync/nodes/object/CObjectCreationDataNode.hpp index 91a3d5d..0058d9f 100644 --- a/netsync/nodes/object/CObjectCreationDataNode.hpp +++ b/netsync/nodes/object/CObjectCreationDataNode.hpp @@ -7,34 +7,39 @@ class CObjectCreationDataNode : CProjectBaseSyncDataNode { public: - uint16_t unk_00C0; //0x00C0 - char pad_0xC2[14]; //0x00C2 - rage::fvector4 m_object_orientation; //0x00D0 - char pad_00E0[30]; //0x00E0 - rage::fvector3 m_object_position; //0x0100 - char pad_010C[4]; //0x010C - rage::fvector3 m_dummy_position; //0x010E - char pad_011A[20]; //0x011C - rage::fvector3 m_script_grab_position; //0x0130 - char pad_013C[12]; //0x013C - float m_script_grab_radius; //0x0148 - uint32_t m_created_by; //0x014C - uint32_t m_model; //0x0150 - uint32_t m_frag_group_index; //0x0154 - uint32_t m_ownership_token; //0x0158 - uint32_t unk_015C; //0x015C - bool m_no_reassign; //0x0160 - bool unk_0161; //0x0161 - bool m_player_wants_control; //0x0162 - bool m_has_init_physics; //0x0163 - bool m_script_grabbed_from_world; //0x0164 - bool m_has_frag_group; //0x0165 - bool m_is_broken; //0x0166 - bool m_has_exploded; //0x0167 - bool m_keep_registered; //0x0168 - bool unk_0169; //0x0169 - bool unk_016A; //0x016A - bool unk_016B; //0x016B + uint32_t unk_00C0; //0x00C0 + uint32_t unk_00C4; //0x00C4 + uint32_t unk_00C8; //0x00C8 + bool unk_00CC; + bool unk_00CD; + uint16_t unk_00D0; //0x00D0 + char pad_0xC2[14]; //0x00D2 + rage::fvector4 m_object_orientation; //0x00E0 + char pad_00E0[30]; //0x00F0 + rage::fvector3 m_object_position; //0x0110 + char pad_010C[4]; //0x011C + rage::fvector3 m_dummy_position; //0x011E + char pad_011A[20]; //0x012C + rage::fvector3 m_script_grab_position; //0x0140 + char pad_013C[12]; //0x013C + float m_script_grab_radius; //0x0148 + uint32_t m_created_by; //0x014C + uint32_t m_model; //0x0150 + uint32_t m_frag_group_index; //0x0154 + uint32_t m_ownership_token; //0x0158 + uint32_t unk_015C; //0x015C + bool m_no_reassign; //0x0160 + bool unk_0161; //0x0161 + bool m_player_wants_control; //0x0162 + bool m_has_init_physics; //0x0163 + bool m_script_grabbed_from_world; //0x0164 + bool m_has_frag_group; //0x0165 + bool m_is_broken; //0x0166 + bool m_has_exploded; //0x0167 + bool m_keep_registered; //0x0168 + bool unk_0169; //0x0169 + bool unk_016A; //0x016A + bool unk_016B; //0x016B }; //Size: 0x016C -static_assert(sizeof(CObjectCreationDataNode) == 0x16C); +static_assert(sizeof(CObjectCreationDataNode) == 0x17C); #pragma pack(pop) diff --git a/netsync/nodes/ped/CPedGameStateDataNode.hpp b/netsync/nodes/ped/CPedGameStateDataNode.hpp index 61f9cd3..bd470da 100644 --- a/netsync/nodes/ped/CPedGameStateDataNode.hpp +++ b/netsync/nodes/ped/CPedGameStateDataNode.hpp @@ -6,72 +6,72 @@ class CPedGameStateDataNode : CSyncDataNodeInfrequent { public: - bool m_weapon_component_something[11]; //0x0C0 - uint32_t m_weapon_component_hash[11]; //0x0CC - uint32_t m_gadget_hash[3]; //0x0F8 - uint32_t unk_0104; // 0x0104 - uint32_t unk_0108; // 0x0108 - uint32_t unk_010C; // 0x010C - float unk_0110; // 0x0110 - float unk_0114; // 0x0114 - float unk_0118; // 0x0118 - bool unk_011C; // 0x011C - char pad_011D[3]; //0x011D - uint32_t m_arrest_state; //0x0120 - uint32_t m_death_state; //0x0124 - uint32_t m_weapon_hash; //0x0128 - uint32_t m_num_weapon_components; //0x012C - uint32_t m_num_equiped_gadgets; //0x0130 - uint32_t m_seat; //0x0134 - uint32_t m_action_mode_override; //0x0138 - uint32_t unk_013C; // 0x013C - uint16_t m_vehicle; //0x0140 - uint16_t m_mount_id; //0x0142 - uint16_t m_custodian_id; //0x0144 - uint16_t unk_0146; // 0x0146 - bool m_tint_index; //0x0148 - char pad_0149; //0x0149 - uint8_t unk_014A; // 0x014A - bool m_is_handcuffed; //0x014B - bool m_can_preform_arrest; //0x014C - bool m_can_preform_uncuff; //0x014D - bool m_can_be_arrested; //0x014E - bool m_is_in_custody; //0x014F - char pad_0150; //0x0150 - bool m_weapon_exists; //0x0151 - bool m_weapon_visible; //0x0152 - bool m_weapon_has_ammo; //0x0153 - bool m_weapon_attach_left; //0x0154 - char pad_0155; //0x0155 - bool m_in_seat; //0x0156 - bool m_in_vehicle; //0x0157 - bool m_on_mount; //0x0158 - bool m_has_custodian_or_arrest_flags; //0x0159 - char pad_015A; //0x015A - bool m_action_mode_enabled; //0x015B - bool m_stealth_mode_enabled; //0x015C - bool unk_015D; // 0x015D - bool unk_015E; // 0x015E - bool unk_015F; // 0x015F - bool unk_0160; // 0x0160 - bool unk_0161; // 0x0161 - bool unk_0162; // 0x0162 - bool unk_0163; // 0x0163 - bool unk_0164; // 0x0164 - bool unk_0165; // 0x0165 - bool unk_0166; // 0x0166 - bool unk_0167; // 0x0167 - bool unk_0168; // 0x0168 - bool unk_0169; // 0x0169 - bool unk_016A; // 0x016A - bool unk_016B; // 0x016B - bool unk_016C; // 0x016C - bool unk_016D; // 0x016D - bool unk_016E; // 0x016E - bool unk_016F; // 0x016F - bool unk_0170; // 0x0170 - bool unk_0171; // 0x0171 - bool unk_0172; // 0x0172 + bool m_weapon_component_something[12]; //0x0C0 + uint32_t m_weapon_component_hash[12]; //0x0CC + uint32_t m_gadget_hash[3]; //0x0F8 + uint32_t unk_0104; // 0x0104 + uint32_t unk_0108; // 0x0108 + uint32_t unk_010C; // 0x010C + float unk_0110; // 0x0110 + float unk_0114; // 0x0114 + float unk_0118; // 0x0118 + bool unk_011C; // 0x011C + char pad_011D[3]; //0x011D + uint32_t m_arrest_state; //0x0120 + uint32_t m_death_state; //0x0124 + uint32_t m_weapon_hash; //0x0128 + uint32_t m_num_weapon_components; //0x012C + uint32_t m_num_equiped_gadgets; //0x0130 + uint32_t m_seat; //0x0134 + uint32_t m_action_mode_override; //0x0138 + uint32_t unk_013C; // 0x013C + uint16_t m_vehicle; //0x0140 + uint16_t m_mount_id; //0x0142 + uint16_t m_custodian_id; //0x0144 + uint16_t unk_0146; // 0x0146 + bool m_tint_index; //0x0148 + char pad_0149; //0x0149 + uint8_t unk_014A; // 0x014A + bool m_is_handcuffed; //0x014B + bool m_can_preform_arrest; //0x014C + bool m_can_preform_uncuff; //0x014D + bool m_can_be_arrested; //0x014E + bool m_is_in_custody; //0x014F + char pad_0150; //0x0150 + bool m_weapon_exists; //0x0151 + bool m_weapon_visible; //0x0152 + bool m_weapon_has_ammo; //0x0153 + bool m_weapon_attach_left; //0x0154 + char pad_0155; //0x0155 + bool m_in_seat; //0x0156 + bool m_in_vehicle; //0x0157 + bool m_on_mount; //0x0158 + bool m_has_custodian_or_arrest_flags; //0x0159 + char pad_015A; //0x015A + bool m_action_mode_enabled; //0x015B + bool m_stealth_mode_enabled; //0x015C + bool unk_015D; // 0x015D + bool unk_015E; // 0x015E + bool unk_015F; // 0x015F + bool unk_0160; // 0x0160 + bool unk_0161; // 0x0161 + bool unk_0162; // 0x0162 + bool unk_0163; // 0x0163 + bool unk_0164; // 0x0164 + bool unk_0165; // 0x0165 + bool unk_0166; // 0x0166 + bool unk_0167; // 0x0167 + bool unk_0168; // 0x0168 + bool unk_0169; // 0x0169 + bool unk_016A; // 0x016A + bool unk_016B; // 0x016B + bool unk_016C; // 0x016C + bool unk_016D; // 0x016D + bool unk_016E; // 0x016E + bool unk_016F; // 0x016F + bool unk_0170; // 0x0170 + bool unk_0171; // 0x0171 + bool unk_0172; // 0x0172 }; //Size: 0x0174 -static_assert(sizeof(CPedGameStateDataNode) == 0x174); +static_assert(sizeof(CPedGameStateDataNode) == 0x178); #pragma pack(pop) \ No newline at end of file diff --git a/netsync/nodes/ped/CPedMovementGroupDataNode.hpp b/netsync/nodes/ped/CPedMovementGroupDataNode.hpp new file mode 100644 index 0000000..bf4c90c --- /dev/null +++ b/netsync/nodes/ped/CPedMovementGroupDataNode.hpp @@ -0,0 +1,24 @@ +#pragma once +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +class CPedMovementGroupDataNode : CSyncDataNodeFrequent +{ +public: + float m_unk; // 0xC0 (CTaskMotionInAutomobile+0x1EC) + uint32_t m_movement_task_index; // 0xC4 + uint32_t m_movement_task_stage; // 0xC8 + uint32_t m_movement_group; // 0xCC + uint32_t m_overridden_weapon_group; // 0xD0 + uint32_t m_overridden_unk_group; // 0xD4 (SET_PED_ALTERNATE_MOVEMENT_ANIM?) + bool m_is_crouching; // 0xD8 + bool m_is_stealthy; // 0xD9 + bool m_is_strafing; // 0xDA + bool m_is_ragdolling; // 0xDB + bool m_is_ragdoll_constraint_ankle_active;// 0xDC + bool m_is_ragdoll_constraint_wrist_active;// 0xDD + char m_pad1[2]; // 0xDE + char m_tennis_data[0x20]; // 0xE0 TODO +}; +static_assert(sizeof(CPedMovementGroupDataNode) == 0x100); +#pragma pack(pop) diff --git a/netsync/nodes/ped/CPedTaskSequenceDataNode.hpp b/netsync/nodes/ped/CPedTaskSequenceDataNode.hpp new file mode 100644 index 0000000..e7353d8 --- /dev/null +++ b/netsync/nodes/ped/CPedTaskSequenceDataNode.hpp @@ -0,0 +1,25 @@ +#pragma once +#include +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push,4) +class CPedTaskSequenceData +{ +public: + int m_task_type; // 0x00 + int m_task_data_size; // 0x04 + char m_task_data[602]; // 0x08 +}; +static_assert(sizeof(CPedTaskSequenceData) == 0x264); + +class CPedTaskSequenceDataNode : CSyncDataNodeFrequent +{ +public: + bool m_has_sequence; // 0xC0 + int m_sequence_resource_id; // 0xC4 + int m_num_tasks_in_sequence; // 0xC8 + CPedTaskSequenceData m_task_data[10]; // 0xCC + int m_unk; // 0x18B4 +}; +static_assert(sizeof(CPedTaskSequenceDataNode) == 0x18B8); +#pragma pack(pop) \ No newline at end of file diff --git a/netsync/nodes/ped/CPedTaskTreeDataNode.hpp b/netsync/nodes/ped/CPedTaskTreeDataNode.hpp new file mode 100644 index 0000000..f1bf38f --- /dev/null +++ b/netsync/nodes/ped/CPedTaskTreeDataNode.hpp @@ -0,0 +1,26 @@ +#pragma once +#include +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push,4) +class CPedTaskData +{ +public: + int m_task_type; // 0x00 + int m_priority; // 0x04 + int m_tree_depth; // 0x08 + int m_sequence_id; // 0x0C + bool m_active; // 0x10 +}; +static_assert(sizeof(CPedTaskData) == 0x14); + +class CPedTaskTreeDataNode : CSyncDataNodeFrequent +{ +public: + CPedTaskData m_tasks[8]; // 0xC0 + int m_task_bitset; // 0x160 + int m_script_command; // 0x164 + int m_script_command_stage; // 0x168 +}; +static_assert(sizeof(CPedTaskTreeDataNode) == 0x16C); // tree offset != size for this one +#pragma pack(pop) \ No newline at end of file diff --git a/netsync/nodes/physical/CPhysicalScriptGameStateDataNode.hpp b/netsync/nodes/physical/CPhysicalScriptGameStateDataNode.hpp new file mode 100644 index 0000000..43ca261 --- /dev/null +++ b/netsync/nodes/physical/CPhysicalScriptGameStateDataNode.hpp @@ -0,0 +1,36 @@ +#pragma once +#include +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +class CPhysicalScriptGameStateDataNode : CSyncDataNodeInfrequent +{ +public: + bool m_godmode; + bool m_dont_load_collision; + bool m_freeze_on_collision_load; + bool m_only_damaged_by_player; + bool m_bullet_proof; + bool m_fire_proof; + bool m_explosion_proof; + bool m_collision_proof; + bool m_melee_proof; + bool m_cannot_be_damaged_by_relationship_group; + bool m_can_only_be_damaged_by_relationship_group; + bool m_smoke_proof; + bool m_steam_proof; + bool m_can_only_be_damaged_by_participants; + bool m_dont_reset_proofs_on_cleanup_mission; + bool m_no_reassign; + bool m_pass_control_in_tutorial; + bool m_visible_in_cutscene; + bool m_visible_in_cutscene_remain_hack; + bool m_pickup_by_cargobob_disabled; + uint32_t m_relationship_group; + uint32_t m_always_cloned_for_players; + bool m_modified_max_speed; + bool m_trigger_damage_event_for_zero_damage; + float m_max_speed; +}; +static_assert(sizeof(CPhysicalScriptGameStateDataNode) == 0xE4); // don't know the actual size of this one +#pragma pack(pop) diff --git a/netsync/nodes/player/CPlayerAmbientModelStreamingNode.hpp b/netsync/nodes/player/CPlayerAmbientModelStreamingNode.hpp new file mode 100644 index 0000000..51ae06a --- /dev/null +++ b/netsync/nodes/player/CPlayerAmbientModelStreamingNode.hpp @@ -0,0 +1,16 @@ +#pragma once +#include +#include "rage/vector.hpp" +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push,4) +class CPlayerAmbientModelStreamingNode : CSyncDataNodeInfrequent +{ +public: + int m_allowed_ped_model_start_offset; // 0xC0 + int m_allowed_vehicle_model_start_offset; // 0xC4 + int m_vehicle_anim_streaming_target_entrypoint; // 0xC8 + int16_t m_vehicle_anim_streaming_target; // 0xCC +}; +static_assert(sizeof(CPlayerAmbientModelStreamingNode) == 0xD0); +#pragma pack(pop) diff --git a/netsync/nodes/player/CPlayerGamerDataNode.hpp b/netsync/nodes/player/CPlayerGamerDataNode.hpp index f0a353d..c1f210a 100644 --- a/netsync/nodes/player/CPlayerGamerDataNode.hpp +++ b/netsync/nodes/player/CPlayerGamerDataNode.hpp @@ -3,31 +3,24 @@ #include "network/ClanData.hpp" #include "netsync/CProjectBaseSyncDataNode.hpp" -#pragma pack(push, 1) +#pragma pack(push, 8) class CPlayerGamerDataNode : CSyncDataNodeInfrequent { public: - ClanData m_clan_data; //0x00C0 - bool m_need_crew_rank_sysflags; //0x0178 - bool m_need_crew_rank_title; //0x0179 - char m_crew_rank_title[25]; //0x017A - bool m_has_started_transition; //0x0193 - bool m_has_transition_info; //0x0194 - char m_transition_info_buffer[125]; //0x0195 - bool m_is_rockstar_dev; //0x0212 - bool m_is_rockstar_qa; //0x0213 - bool m_is_cheater; //0x0214 - char pad_0215[3]; //0x0215 - uint32_t m_matchmaking_group; //0x0218 - bool m_need_mute_data; //0x021C - char pad_021D[3]; //0x021D - int32_t m_mute_count; //0x0220 - int32_t m_mute_talkers_count; //0x0224 - uint32_t unk_0228; //0x0228 - bool m_has_communication_privilege; //0x022C - char pad_022D[3]; //0x022D - int32_t unk_0230; //0x0230 - char pad_0234[620]; //0x0234 -}; //Size: 0x04A0 -static_assert(sizeof(CPlayerGamerDataNode) == 0x4A0); + ClanData m_clan_data; //0x00C0 + bool m_need_crew_rank_sysflags; //0x0178 + bool m_need_crew_rank_title; //0x0179 + char m_crew_rank_title[25]; //0x017A + bool m_has_started_transition; //0x0193 + bool m_has_transition_info; //0x0194 + char m_transition_info_buffer[169]; //0x0195 + int m_player_privilege_flags; //0x0240 + uint32_t m_matchmaking_group; //0x0244 + bool m_need_mute_data; //0x0248 + int32_t m_mute_count; //0x024C + int32_t m_mute_talkers_count; //0x0250 + uint32_t m_unk; //0x0254 + int32_t m_account_id; //0x0258 +}; +static_assert(sizeof(CPlayerGamerDataNode) == 0x260); #pragma pack(pop) \ No newline at end of file diff --git a/netsync/nodes/player/CPlayerPedGroupDataNode.hpp b/netsync/nodes/player/CPlayerPedGroupDataNode.hpp new file mode 100644 index 0000000..2f765ba --- /dev/null +++ b/netsync/nodes/player/CPlayerPedGroupDataNode.hpp @@ -0,0 +1,35 @@ +#pragma once +#include +#include "rage/vector.hpp" +#include "netsync/CProjectBaseSyncDataNode.hpp" +#include "ped/CPed.hpp" + +#pragma pack(push, 8) +class CGroup; +class CGroupMember +{ +public: + int16_t m_net_id; + CPed* m_ped; // this isn't serialized +}; +static_assert(sizeof(CGroupMember) == 0x10); + +class CPlayerPedGroupDataNode : CSyncDataNodeInfrequent +{ +public: + char m_unused[0x10]; // 0xC0 + CGroup* m_group; // 0xD0 (not serialized) + CGroupMember m_members[7]; // 0xD8 + CGroupMember m_leader; // 0x148 + char m_unused2[8]; // 0x158 + float m_max_separation; // 0x160 + char m_unused3[0xC]; // 0x164 + int m_pop_type; // 0x170 + bool m_needs_group_event_scan; // 0x175 + char m_unused4[6]; // 0x176 + int m_formation_type; // 0x17C + float m_formation_distance; // 0x180 + char m_unused5[0xC]; // 0x184 +}; +static_assert(sizeof(CPlayerPedGroupDataNode) == 0x190); +#pragma pack(pop) diff --git a/netsync/nodes/player/CPlayerWantedAndLOSDataNode.hpp b/netsync/nodes/player/CPlayerWantedAndLOSDataNode.hpp new file mode 100644 index 0000000..d956e34 --- /dev/null +++ b/netsync/nodes/player/CPlayerWantedAndLOSDataNode.hpp @@ -0,0 +1,27 @@ +#pragma once +#include +#include "rage/vector.hpp" +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push,4) +class CPlayerWantedAndLOSDataNode : CSyncDataNodeInfrequent +{ +public: + rage::fvector3 m_wanted_position; // 0xC0 + int m_time_in_prev_pursuit; // 0xCC + rage::fvector3 m_unk_position; // 0xD0 + int m_time_in_pursuit; // 0xDC + int m_wanted_level; // 0xE0 + int m_unk_wanted_level; // 0xE4 + int m_current_time; // 0xE8 + int m_unk_player_bitset; // 0xEC + int m_pursuit_start_time; // 0xF0 + uint8_t m_fake_wanted_level; // 0xF4 + bool m_cops_cant_see_player; // 0xF5 + bool m_is_evading; // 0xF6 + bool m_pending_wanted_level; // 0xF7 + bool m_unk3; // 0xF8 + uint8_t m_unk_player_index; // 0xF9 +}; +static_assert(sizeof(CPlayerWantedAndLOSDataNode) == 0xFC); +#pragma pack(pop) diff --git a/netsync/nodes/vehicle/CVehicleComponentReservationDataNode.hpp b/netsync/nodes/vehicle/CVehicleComponentReservationDataNode.hpp new file mode 100644 index 0000000..70ba08e --- /dev/null +++ b/netsync/nodes/vehicle/CVehicleComponentReservationDataNode.hpp @@ -0,0 +1,15 @@ +#pragma once +#include +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +class CVehicleComponentReservationDataNode : CSyncDataNodeInfrequent +{ +public: + bool m_has_component_reservations; //0x00C0 + uint32_t m_num_peds_using_component; //0x00C4 + uint16_t m_peds_using_component[32]; //0x00C8 +}; //Size: 0x00C8 +#pragma pack(pop) + +static_assert(sizeof(CVehicleComponentReservationDataNode) == 0x108); diff --git a/netsync/nodes/vehicle/CVehicleControlDataNode.hpp b/netsync/nodes/vehicle/CVehicleControlDataNode.hpp new file mode 100644 index 0000000..ea297ea --- /dev/null +++ b/netsync/nodes/vehicle/CVehicleControlDataNode.hpp @@ -0,0 +1,41 @@ +#pragma once +#include +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +class CVehicleControlDataNode : CSyncDataNodeFrequent +{ +public: + uint32_t m_num_wheels; + uint32_t dwordC4; + uint32_t m_brake_control; + uint32_t dwordCC; + uint32_t m_road_node_address; + bool m_kers_active; + bool m_bringing_vehicle_to_halt; + float m_halt_distance; + bool m_control_vertical_velocity; + bool m_has_suspension_data; + bool byteDE; + float m_suspension_heights[10]; + bool byte108; + bool byte109; + bool byte10A; + bool byte10B; + bool byte10C; + bool byte10D; + bool byte10E; + float float110; + uint32_t dword114; + char byte118; + bool m_is_submarine_car; + char gap11A[2]; + float m_rudder_rotation_x; + float m_rudder_rotation_y; + float m_rudder_rotation_z; + char byte128; + char byte129; + char pad[5]; +}; +static_assert(sizeof(CVehicleControlDataNode) == 0x130); +#pragma pack(pop) diff --git a/netsync/nodes/vehicle/CVehicleDamageStatusDataNode.hpp b/netsync/nodes/vehicle/CVehicleDamageStatusDataNode.hpp new file mode 100644 index 0000000..20740b9 --- /dev/null +++ b/netsync/nodes/vehicle/CVehicleDamageStatusDataNode.hpp @@ -0,0 +1,32 @@ +#pragma once +#include +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +class CVehicleDamageStatusDataNode : CSyncDataNodeInfrequent +{ +public: + uint8_t m_bullet_counts[6]; // 0xC0 + uint8_t m_front_damage_level; // 0xC6 + uint8_t m_rear_damage_level; // 0xC7 + uint8_t m_left_damage_level; // 0xC8 + uint8_t m_right_damage_level; // 0xC9 + uint8_t m_rear_left_damage_level; // 0xCA + uint8_t m_rear_right_damage_level; // 0xCB + uint8_t m_windows_state[8]; // 0xCC + float m_unk2[8]; // 0xD4 + bool m_sirens_broken[20]; // 0xF4 + bool m_lights_broken[20]; // 0x108 + uint8_t m_front_bumper_state; // 0x11E + uint8_t m_rear_bumper_state; // 0x11F + uint8_t m_unk3[8]; // 0x120 + bool m_has_damage_levels; // 0x128 + bool m_has_broken_lights; // 0x129 + bool m_has_broken_sirens; // 0x12A + bool m_has_broken_windows; // 0x12B + bool m_has_broken_bumpers; // 0x12C + bool m_has_bullets; // 0x12D + bool m_has_unk; // 0x12E +}; //Size: 0x00C8 +#pragma pack(pop) +static_assert(sizeof(CVehicleDamageStatusDataNode) == 0x130); diff --git a/netsync/nodes/vehicle/CVehicleGameStateDataNode.hpp b/netsync/nodes/vehicle/CVehicleGameStateDataNode.hpp new file mode 100644 index 0000000..a24d51b --- /dev/null +++ b/netsync/nodes/vehicle/CVehicleGameStateDataNode.hpp @@ -0,0 +1,80 @@ +#pragma once +#include +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 2) +class CVehicleGameStateDataNode : CSyncDataNodeInfrequent +{ +public: + float m_unk66; + float m_unk32; + float m_unk200; + float m_unk204; + int m_radio_station; + uint32_t m_lock_status; + uint32_t m_unk17; + uint32_t m_unbreakable_doors; + uint32_t m_open_windows; + uint32_t m_unk34; + uint8_t m_unk49[4]; + unsigned int m_unk62_1; + uint32_t m_unk240; + uint16_t m_unk35; + uint16_t m_unk37[2]; + uint16_t m_unk39; + uint8_t m_unk252; + char m_light_state; + uint8_t m_unk21; + char m_unk27[8]; + uint8_t m_doors_open; + char m_door_positions[8]; + uint32_t m_locked_players; + uint8_t m_is_engine_on; + bool m_is_engine_starting; + bool unk4; + bool m_handbrake; + bool m_unk6; + uint8_t m_siren_on; + bool m_unk1; + uint8_t m_unk13; + uint8_t m_unk12; + uint8_t m_unk14; + uint8_t m_unk25; + uint8_t m_unk26; + bool m_no_longer_needed; + uint8_t m_unk28; + uint8_t m_unk33; + uint8_t m_unk30; + bool m_lights_on; + bool m_highbeams_on; + char m_unk43; + char m_unk44; + bool m_unk7; + char m_unk29; + char m_unk45; + char m_unk46; + char m_unk47; + char m_unk48; + uint8_t m_unk38; + char m_unk51; + bool m_has_been_owned_by_player; + char m_unk53; + char m_unk54; + char m_unk55; + char m_unk56; + char m_unk57; + char m_unk58; + char m_unk61; + uint8_t m_unk62; + char m_unk63; + char m_unk64; + char m_unk67; + char m_unk68; + char m_unk138; + char m_unk139; + char m_unk59; + char m_unk60; + char pad[6]; +}; +#pragma pack(pop) +static_assert(sizeof(CVehicleGameStateDataNode) == 0x148); \ No newline at end of file diff --git a/netsync/nodes/vehicle/CVehicleHealthDataNode.hpp b/netsync/nodes/vehicle/CVehicleHealthDataNode.hpp new file mode 100644 index 0000000..228de38 --- /dev/null +++ b/netsync/nodes/vehicle/CVehicleHealthDataNode.hpp @@ -0,0 +1,35 @@ +#pragma once +#include +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +class CVehicleHealthDataNode : CSyncDataNodeInfrequent +{ +public: + float m_tires_unk14[10]; //0x00C0 + float m_tires_open_wheel_heat[10]; //0x00E8 + bool m_tires_bursted[10]; //0x0110 + bool m_tires_bursted_on_rim[10]; //0x011A + bool m_tires_unk11[10]; //0x0124 + bool m_tires_unk12[10]; //0x012E + uint64_t m_unk24; //0x0138 + int32_t m_engine_health; //0x0140 + uint32_t m_petrol_tank_health; //0x0144 + uint32_t m_num_tires; //0x0148 + bool m_tires_fine; //0x014C + bool m_unk7; //0x014D + char pad_014E[1]; //0x014E + bool m_health_changed; //0x014F + uint32_t m_health; //0x0150 + uint32_t m_body_health; //0x0154 + uint32_t m_damage_weapon; //0x0158 + int16_t m_damager_net_id; //0x015C + uint8_t m_total_repairs; //0x015E + uint8_t m_unk21; //0x015F + bool m_unk1; //0x0160 + bool m_unk2; //0x0161 + bool m_body_health_changed; //0x0162 + uint32_t m_pad2; // 0x0164 +}; //Size: 0x0380 +#pragma pack(pop) +static_assert(sizeof(CVehicleHealthDataNode) == 0x168); \ No newline at end of file diff --git a/netsync/nodes/vehicle/CVehicleSteeringDataNode.hpp b/netsync/nodes/vehicle/CVehicleSteeringDataNode.hpp new file mode 100644 index 0000000..525ae88 --- /dev/null +++ b/netsync/nodes/vehicle/CVehicleSteeringDataNode.hpp @@ -0,0 +1,13 @@ +#pragma once +#include +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +class CVehicleSteeringNodeData : CSyncDataNodeFrequent +{ +public: + float m_steering_handle; // 0xC0 + char pad[4]; // 0xC4 +}; //Size: 0x00C8 +#pragma pack(pop) +static_assert(sizeof(CVehicleSteeringNodeData) == 0xC8); diff --git a/netsync/nodes/vehicle/CVehicleTaskDataNode.hpp b/netsync/nodes/vehicle/CVehicleTaskDataNode.hpp new file mode 100644 index 0000000..90d52d9 --- /dev/null +++ b/netsync/nodes/vehicle/CVehicleTaskDataNode.hpp @@ -0,0 +1,14 @@ +#pragma once +#include +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push,4) +class CVehicleTaskDataNode : CSyncDataNodeInfrequent +{ +public: + uint32_t m_task_type; // 0xC0 + uint32_t m_task_data_size; // 0xC4 + char m_task_data[255]; // 0xC8 +}; //Size: 0x0180 +static_assert(sizeof(CVehicleTaskDataNode) == 0x1C8); +#pragma pack(pop) \ No newline at end of file diff --git a/network/RemoteGamerInfoMsg.hpp b/network/RemoteGamerInfoMsg.hpp index b2b050c..7061dfc 100644 --- a/network/RemoteGamerInfoMsg.hpp +++ b/network/RemoteGamerInfoMsg.hpp @@ -1,22 +1,7 @@ #pragma once #include #include "../rage/rlGamerInfo.hpp" - -#pragma pack(push, 4) -class netConnectionPeer -{ -public: - uint32_t m_internal_ip; //0x0000 - uint16_t m_internal_port; //0x0004 - uint32_t m_external_ip; //0x0008 - uint16_t m_external_port; //0x000C - uint64_t m_peer_id; //0x0010 - uint32_t unk_0018; //0x0018 - uint16_t unk_001C; //0x001C - uint8_t m_platform; //0x001E -}; -static_assert(sizeof(netConnectionPeer) == 0x20); -#pragma pack(pop) +#include "netConnection.hpp" #pragma pack(push, 8) class RemoteGamerInfoMsg @@ -24,7 +9,7 @@ class RemoteGamerInfoMsg public: uint64_t m_session_id; //0x0000 class rage::rlGamerInfo m_gamer_info; //0x0008 - class netConnectionPeer m_gamer_peer_data; //0x00A0 + class rage::netPeerAddress m_peer_address; //0x00A0 uint32_t unk_0xC0; //0x00C0 uint32_t m_unk_struct_size; //0x00C4 char m_unk_struct[512]; //0x00C8 Might be bitbuffer data diff --git a/network/netConnection.hpp b/network/netConnection.hpp new file mode 100644 index 0000000..5274741 --- /dev/null +++ b/network/netConnection.hpp @@ -0,0 +1,202 @@ +#pragma once +#include +#include "rage/rlGamerInfoBase.hpp" + +#pragma pack(push, 1) +namespace rage +{ + class netConnectionManager; + class netConnectionPeer; + +#pragma pack(push, 4) + class netPeerAddress + { + public: + uint32_t m_internal_ip; //0x0000 + uint16_t m_internal_port; //0x0004 + uint32_t m_external_ip; //0x0008 + uint16_t m_external_port; //0x000C + uint64_t m_peer_id; //0x0010 + uint32_t unk_0018; //0x0018 + uint16_t unk_001C; //0x001C + uint8_t m_platform; //0x001E + }; + static_assert(sizeof(netPeerAddress) == 0x20); +#pragma pack(pop) + + class netQueuedMessage + { + public: + void* m_data_buffer; + void* qword8; + void* qword10; + void* qword18; + rage::netQueuedMessage* m_next; + void* qword28; + char gap30[8]; + int m_creation_time; + int m_last_send_time; + int m_resend_count; + char gap44[4]; + int dword48; + uint16_t word4C; + char byte4E; + }; + static_assert(sizeof(netQueuedMessage) == 0x4F); + + class netMessageQueue + { + public: + rage::netQueuedMessage* m_first; + rage::netQueuedMessage* m_last; + uint64_t m_count; + }; + + class netPackedMessage + { + public: + void* m_data_buffer; + void* m_allocator; + void* qword10; + void* qword18; + }; + + class netPackedMessageQueue + { + public: + rage::netPackedMessage* m_first; + rage::netPackedMessage* m_last; + uint64_t m_count; + }; + + class netConnection + { + public: + class InFrame + { + public: + enum class EventType + { + ConnectionClosed = 3, + FrameReceived = 4, + BandwidthExceeded = 6, + OutOfMemory = 7 + }; + + virtual ~InFrame() = default; + + virtual void destroy() = 0; + virtual EventType get_event_type() = 0; + virtual uint32_t _0x18() = 0; + + uint32_t m_timestamp; //0x0008 + char pad_0008[52]; //0x000C + uint32_t m_msg_id; //0x0040 + uint32_t m_connection_identifier; //0x0044 + InFrame* m_this; //0x0048 + uint32_t m_peer_id; //0x0050 + char pad_0050[44]; //0x0058 + uint32_t m_length; //0x0080 + char pad_007C[4]; //0x0084 + void* m_data; //0x0088 + }; + static_assert(sizeof(rage::netConnection::InFrame) == 0x90); + + char gap0[8]; + rage::netConnectionPeer* m_connection_peer; + int m_msg_id; + uint32_t m_connection_id; + void* m_allocator; + uint32_t m_connection_state; + uint32_t m_last_send_time; + uint32_t m_last_receive_time; + uint32_t m_num_failed_messages; + char gap30[8]; + uint32_t m_timeout_reason; + uint32_t dword3C; + uint32_t m_timeout; + uint32_t dword44; + uint32_t m_resend_threshold; + char gap4C[4]; + rage::netMessageQueue m_reliables_resend_queue; + rage::netMessageQueue m_normal_message_queue; + rage::netQueuedMessage* m_unacked_reliable_message_list; + int m_unacked_reliable_message_count; + char gap8C[36]; + netConnectionManager* m_net_connection_mgr; + char gapB8[8]; + uint32_t dwordC0; + int16_t m_msg_counter; + int16_t wordC6; + char gapC8[2]; + int16_t m_last_reliable_msg_counter; + char m_flags; + char gapCD[3]; + int m_failed_allocation_size; + int32_t m_failed_allocations; + rage::netConnection* m_next; + char gapE0[208]; + int m_flags2; + char gap1B4[69]; + }; + static_assert(sizeof(netConnection) == 0x1F9); + + class netConnectionQueue + { + public: + rage::netConnection* m_first; + rage::netConnection* m_last; + uint64_t m_count; + }; + + class netConnectionPeer + { + public: + rage::netConnection* m_connections_by_id[16]; + rage::netConnectionQueue m_net_connection_queue; + rage::netPackedMessageQueue m_packed_message_queue; + void* qwordB0; + char byteB8; + char gapB9[3]; + int intBC; + uint32_t dwordC0; + char gapC4[4]; + void* qwordC8; + rage::netPeerAddress m_relay_address; + rage::rlGamerInfoBase m_gamer_info; + char gap1B0[24]; + uint32_t dword1C8; + char gap1CC[28]; + uint32_t m_security_id; + char gap1EC[28]; + void* qword208; + char gap210[24]; + rage::netPeerAddress m_peer_address; + rage::netConnectionPeer* m_next; + char gap250[8]; + int m_time_until_next_batch; + int m_empty_batch_interval; + uint32_t m_time_until_timeout; + int m_last_msg_process_time; + int gap268; + void* qword26C; + char gap274[4]; + void* qword278; + char gap280[24]; + void* qword298; + char gap2A0[64]; + uint32_t m_peer_id; + char byte2E4; + char more[51]; + int gap318; + char gap31C[24]; + int m_num_encryption_attempts; + char gap338[60]; + int m_num_messages_batched; + int m_num_reliable_messages_batched; + int m_num_resent_reliable_messages_batched; + char gap380[145]; + }; + static_assert(sizeof(netConnectionPeer) == 0x411); +} +#pragma pack(pop) \ No newline at end of file