diff --git a/base/CObject.hpp b/base/CObject.hpp index f2c8372..f825a50 100644 --- a/base/CObject.hpp +++ b/base/CObject.hpp @@ -1,6 +1,8 @@ #pragma once #include "../entities/CPhysical.hpp" +class CWeapon; + #pragma pack(push, 2) class CObject : public rage::CPhysical { diff --git a/base/atRTTI.hpp b/base/atRTTI.hpp new file mode 100644 index 0000000..f3e8667 --- /dev/null +++ b/base/atRTTI.hpp @@ -0,0 +1,11 @@ +#pragma once + +#define DEFINE_RAGE_RTTI(className) private:\ + virtual void* _0x00() = 0;\ + virtual void* _0x08() = 0;\ + virtual uint32_t _0x10() = 0;\ + virtual className* _0x18(void*) = 0;\ + virtual bool _0x20(void*) = 0;\ + virtual bool _0x28(void**) = 0;\ + virtual void destructor() = 0;\ + public: \ No newline at end of file diff --git a/base/fwExtensibleBase.hpp b/base/fwExtensibleBase.hpp index 2c212a5..5ace695 100644 --- a/base/fwExtensibleBase.hpp +++ b/base/fwExtensibleBase.hpp @@ -11,8 +11,8 @@ namespace rage class fwExtensibleBase : public fwRefAwareBase { public: - virtual bool is_of_type(std::uint32_t hash) = 0; - virtual uint32_t const &get_type() = 0; + // virtual bool is_of_type(std::uint32_t hash) = 0; + // virtual uint32_t const &get_type() = 0; fwExtensionContainer* m_extension_container; // 0x0010 void *m_extensible_unk; // 0x0018 diff --git a/entities/CEntity.hpp b/entities/CEntity.hpp index 642ad5c..14c7bb1 100644 --- a/entities/CEntity.hpp +++ b/entities/CEntity.hpp @@ -4,14 +4,47 @@ #include +class CEntityDrawHandler; + namespace rage { class CEntity : public rage::fwEntity { public: - char gapB9[7]; - uint32_t dwordC0; - uint32_t dwordC4; + virtual void* _0x120() = 0; // implemented only by CPed + virtual void UpdatePositionImpl() = 0; // 0x128 + virtual void _0x130() = 0; + virtual void _0x138(void*) = 0; + virtual void _0x140() = 0; + virtual void _0x148(int) = 0; + virtual bool _0x150() = 0; + virtual CEntityDrawHandler* CreateDrawHandler() = 0; // 0x158 + virtual int GetTypeFlags() = 0; // 0x160 + virtual int GetTypeFlags2() = 0; // 0x168 + virtual bool _0x170() = 0; // implemented only by CPickup + virtual bool _0x178() = 0; + virtual void _0x180(bool) = 0; + virtual bool _0x188() = 0; + virtual bool _0x190() = 0; + virtual void ClearDecals() = 0; // 0x198 + virtual void GetModelBounds(rage::fvector3* bounds) = 0; // 0x1A0 + virtual void GetModelBounds2(rage::fvector3* bounds) = 0; // 0x1A8 + virtual float GetBoundingBoxSize() = 0; // 0x1B0 + virtual float _0x1B8(void*) = 0; + virtual float _0x1C0(void*) = 0; + virtual rage::fvector3* _0x1C8() = 0; + virtual rage::fvector3* GetCameraOffset() = 0; // 0x1D0 + virtual void GetCameraBasePosition(rage::fvector3* pos) = 0; // 0x1D8 + virtual bool _0x1E0() = 0; + virtual bool Update() = 0; // 0x1E8 always returns true + virtual bool _0x1F0() = 0; + virtual void Warp(rage::fvector3* pos, float heading, bool) = 0; // 0x1F8 + + + uint8_t gapB9; //0x00B9 + char gapBA[6]; //0x00BA + uint32_t m_flags_3; //0x00C0 + uint32_t m_flags_4; //0x00C4 uint32_t dwordC8; uint32_t dwordCC; }; diff --git a/entities/fwEntity.hpp b/entities/fwEntity.hpp index 631393a..fa03cfd 100644 --- a/entities/fwEntity.hpp +++ b/entities/fwEntity.hpp @@ -3,32 +3,81 @@ #include "../base/CBaseModelInfo.hpp" #include "../base/CNavigation.hpp" #include "../base/fwExtensibleBase.hpp" +#include "../base/atRTTI.hpp" #include "../draw_handlers/fwDrawData.hpp" #include +class CMoveObjectPooledObject; + namespace rage { + class fwDynamicEntityComponent; + class crmtRequestPose; + class crmtRequestIk; + class crFrameFilter; + class fwAudEntity; + #pragma pack(push, 1) class fwEntity : public fwExtensibleBase { public: - class CBaseModelInfo *m_model_info; //0x0020 - char gap28; //0x0028 - uint8_t m_entity_type; //0x0029 - char gap2A[2]; //0x002A - uint8_t m_invisible; //0x002C - char gap2D[3]; //0x002D + DEFINE_RAGE_RTTI(rage::fwEntity); + + virtual void* _0x38(void*, void*) = 0; + virtual void AddExtension(void* extension) = 0; // 0x40 + virtual void _0x48() = 0; // not implemented + virtual void _0x50() = 0; // only implemented by CEntityBatch + virtual void _0x58() = 0; + virtual void SetModelInfo(std::uint16_t* model_index) = 0; // 0x60 + virtual void _0x68(int, fvector4*) = 0; + virtual void* _0x70(int) = 0; + virtual CNavigation* GetNavigation() = 0; // 0x78 + virtual CMoveObjectPooledObject* CreateMoveObject() = 0; // 0x80 + virtual std::uint32_t* GetType() = 0; // 0x88 + virtual void _0x90() = 0; + virtual float _0x98() = 0; + virtual bool TryRequestInverseKinematics(rage::crmtRequestPose* pose, rage::crmtRequestIk* ik) = 0; // 0xA0 implemented only by CPed + virtual bool TryRequestFacialAnims(void*) = 0; // 0xA8 implemented only by CPed + virtual void* _0xB0() = 0; + virtual std::uint8_t _0xB8() = 0; // implemented only by CPed + virtual rage::crFrameFilter* GetFrameFilter() = 0; // 0xC0 + virtual rage::fwAudEntity* GetEntityAudio() = 0; // 0xC8 + virtual void _0xD0() = 0; + virtual void SetTransform(fmatrix44* matrix, bool update_pos) = 0; // 0xD8 + virtual void SetTransform2(fmatrix44* matrix, bool update_pos) = 0; // 0xE0 + virtual void SetPosition(fvector4* pos, bool update_pos) = 0; // 0xE8 + virtual void SetHeading(float heading, bool update_pos) = 0; // 0xF0 + virtual void SetEntityTypeFlags() = 0; // 0xF8 + virtual void _0x100() = 0; // not implemented + virtual void UpdatePhysics(CNavigation* navigation) = 0; // 0x108 + virtual void UpdatePhysics2(CNavigation* navigation) = 0; // 0x110 + virtual void UpdatePosition() = 0; // 0x118 + + enum class EntityFlags + { + IS_VISIBLE = (1 << 0) + }; + + class CBaseModelInfo* m_model_info; //0x0020 + uint8_t m_entity_type; //0x0028 + char gap29; //0x0029 + uint16_t gap2A; //0x002A + uint32_t m_flags; //0x002D class CNavigation *m_navigation; //0x0030 - char gap38[16]; //0x0038 - class rage::fwDrawData *m_draw_data; //0x0048 - char gap50[16]; //0x0050 + uint16_t gap38; //0x0038 + uint16_t gap3A; //0x003A + uint32_t gap3C; //0x003C + class rage::fwDynamicEntityComponent* m_dynamic_entity_component; //0x0040 (stores attachments and stuff) + class rage::fwDrawData* m_draw_data; //0x0048 + class rage::fwDynamicEntityComponent* gap50; //0x0050 + uint64_t gap58; //0x0058 fmatrix44 m_transformation_matrix; //0x0060 - uint64_t qwordA0; //0x00A0 - uint32_t dwordA8; //0x00A8 - uint32_t dwordAC; //0x00AC - uint32_t dwordB0; //0x00B0 + rage::fwEntity* m_render_focus_entity; //0x00A0 + uint32_t m_render_focus_distance; //0x00A8 + uint32_t m_flags_2; //0x00AC + uint32_t m_shadow_flags; //0x00B0 char gapB4[4]; //0x00B4 std::uint8_t byteB8; //0x00B8 diff --git a/network/CCommunications.hpp b/network/CCommunications.hpp index f43220c..c16b3a9 100644 --- a/network/CCommunications.hpp +++ b/network/CCommunications.hpp @@ -9,7 +9,7 @@ public: class rage::rlGamerInfo m_gamer_info; //0x0000 char pad_0098[40]; //0x0098 }; //Size: 0x00C0 -static_assert(sizeof(CVoiceConnection) == 0xC0); +static_assert(sizeof(CVoiceConnection) == 0x120); class CVoice { @@ -20,7 +20,7 @@ public: uint32_t m_connection_count; //0x1908 char pad_190C[3508]; //0x190C }; //Size: 0x1978 -static_assert(sizeof(CVoice) == 0x26C0); +static_assert(sizeof(CVoice) == 0x32C0); class CCommunications { @@ -29,5 +29,5 @@ public: class CVoice m_voice; //0x0030 char pad_26F0[280300]; //0x26F0 }; //Size: 0x46DE4 -static_assert(sizeof(CCommunications) == 0x46DDC); +static_assert(sizeof(CCommunications) == 0x479DC); #pragma pack(pop) \ No newline at end of file diff --git a/network/CNetGamePlayer.hpp b/network/CNetGamePlayer.hpp index d043ac5..7647114 100644 --- a/network/CNetGamePlayer.hpp +++ b/network/CNetGamePlayer.hpp @@ -59,5 +59,5 @@ public: uint32_t m_account_id; //0x02B4 uint32_t m_unk_02BC; //0x02BC }; //Size: 0x02C0 -static_assert(sizeof(CNetGamePlayer) == 0x2C0); +static_assert(sizeof(CNetGamePlayer) == 0x320); #pragma pack(pop) diff --git a/network/CNetworkPlayerMgr.hpp b/network/CNetworkPlayerMgr.hpp index fe77ac2..b53dcf0 100644 --- a/network/CNetworkPlayerMgr.hpp +++ b/network/CNetworkPlayerMgr.hpp @@ -30,5 +30,5 @@ public: uint32_t unk_B944; //0xB944 uint16_t unk_B948; //0xB948 }; //Size: 0xB94A -static_assert(sizeof(CNetworkPlayerMgr) == 0xB94A); +static_assert(sizeof(CNetworkPlayerMgr) == 0xD14A); #pragma pack(pop) diff --git a/network/Network.hpp b/network/Network.hpp index 3413fdc..4da18a5 100644 --- a/network/Network.hpp +++ b/network/Network.hpp @@ -97,7 +97,7 @@ public: char pad_0074[4]; //0x0074 uint32_t m_flags; //0x0078 }; //Size: 0x007C -static_assert(sizeof(SessionInfoBackup) == 0x7C); +static_assert(sizeof(SessionInfoBackup) == 0xDC); class MatchmakingSessionResult { @@ -105,7 +105,7 @@ public: class rage::rlSessionDetail m_detail; char pad_03B8[24]; //0x03B8 }; //Size: 0x03D0 -static_assert(sizeof(MatchmakingSessionResult) == 0x3D0); +static_assert(sizeof(MatchmakingSessionResult) == 0x490); class PlayerNameMapNode { @@ -191,95 +191,95 @@ public: class rage::snSession m_game_session; //0x00B8 class rage::snSession m_transition_session; //0x3F28 char pad_7D98[16]; //0x7D98 - class NetworkGameConfig m_network_game_config; //0x7DA8 - class NetworkGameConfig m_network_transition_config; //0x7EF0 - bool m_session_attributes_dirty; //0x8038 - char pad_8039[19]; //0x8039 - uint32_t m_session_visibility_flags; //0x804C - uint32_t m_transition_visibility_flags; //0x8050 - char pad_8054[60]; //0x8054 - class MetricSessionMigrated m_metric_session_migrated; //0x8090 - bool m_migrated_metric_enabled; //0x83D8 - char pad_83D9[3]; //0x83D9 - uint32_t m_game_session_state; //0x83DC - class NetworkGameFilter m_network_game_filter; //0x83E0 - char pad_8724[33]; //0x8724 - bool m_was_invited; //0x8745 - char pad_8746[10]; //0x8746 - class rage::rlSessionInfo m_unk_session_info; //0x8750 - char pad_87C0[635]; //0x87C0 - bool m_need_host_change; //0x8A3B - char pad_8A3C[2612]; //0x8A3C - class rage::rlSessionDetail m_joining_session_detail; //0x9470 - class SessionInfoBackup m_last_joined_session; //0x9828 - char pad_98A4[40]; //0x98A4 - uint32_t m_current_matchmaking_group; //0x98CC - uint32_t m_matchmaking_group_max_players[5]; //0x98D0 - uint32_t m_num_active_matchmaking_groups; //0x98E4 - char pad_98E8[8]; //0x98E8 - uint8_t m_matchmaking_property_id; //0x98F0 - uint8_t m_matchmaking_mental_state; //0x98F1 - char pad_98F2[366]; //0x98F2 - class rage::rlMatchmakingFindResult m_game_session_matchmaking[3]; //0x9A60 - char pad_143B0[40]; //0x143B0 - class MatchmakingSessionResult m_game_matchmaking_session_results[10]; //0x143D8 - char pad_169F8[308]; //0x169F8 - uint32_t m_num_bosses; //0x16B2C - bool m_num_bosses_set; //0x16B30 - char pad_16B31[7]; //0x16B31 - class rage::rlGamerHandle m_transition_creator_handle; //0x16B38 - char pad_16B48[12]; //0x16B48 - bool m_is_waiting_async; //0x16B54 - bool m_is_preferred_activity; //0x16B55 - char pad_16B56[2]; //0x16B56 - uint32_t m_in_progress_finish_time; //0x16B58 - char pad_16B5C[4]; //0x16B5C - bool m_local_player_info_dirty; //0x16B60 - char pad_16B61[495]; //0x16B61 - class rage::rlGamerHandle m_inviter_handle; //0x16D50 - class CNetComplaintMgr m_game_complaint_mgr; //0x16D60 - class CNetComplaintMgr m_transition_complaint_mgr; //0x179F8 - char pad_18690[32]; //0x18690 - class JoiningPlayerNameMap m_unused_joining_player_name_map; //0x186B0 - char pad_19FD8[8]; //0x19FD8 - class CNetBlacklist m_blacklist; //0x19FE0 - char pad_1A298[8]; //0x1A298 - class InvitedGamers m_game_invited_gamers; //0x1A2A0 - char pad_1AF28[56]; //0x1AF28 - class SessionInfoBackup m_last_joined_transition; //0x1AF60 - uint32_t m_activity_max_players; //0x1AFDC - uint32_t m_activity_max_spectators; //0x1AFE0 - char pad_1AFE4[48]; //0x1AFE4 - bool m_do_not_launch_from_join_as_migrated_host; //0x1B014 - char pad_1B015[7]; //0x1B015 - bool m_is_activity_session; //0x1B01C - char pad_1B01D[35]; //0x1B01D - class RemotePlayerData m_remote_player_data; //0x1B040 - char pad_1B648[8]; //0x1B648 - class rage::netGamePlayerData m_local_net_game_player_data; //0x1B650 - char pad_1B680[600]; //0x1B680 - class rage::rlMatchmakingFindResult m_transition_matchmaking[4]; //0x1B8D8 - class NetworkGameFilter m_transition_filters[4]; //0x29A98 - char pad_2A7A8[20]; //0x2A7A8 - uint32_t m_transition_quickmatch_group_handle_count; //0x2A7BC - class rage::rlGamerHandle m_transition_quickmatch_group_handles[32]; //0x2A7C0 - bool m_retain_activity_group; //0x2A9C0 - char pad_2A9C1[7]; //0x2A9C1 - class rage::rlSessionInfo m_transition_to_activity_session_info; //0x2A9C8 - char pad_2AA38[48]; //0x2AA38 - class MatchmakingSessionResult m_transition_matchmaking_session_results[10]; //0x2AA68 - char pad_2D088[8]; //0x2D088 - class InvitedGamers m_transition_invited_gamers; //0x2D090 - char pad_2DD18[16]; //0x2DD18 - class rage::rlGamerHandle m_transition_to_game_handle; //0x2DD28 - class rage::rlSessionInfo m_transition_to_game_session_info; //0x2DD38 - char pad_2DDA8[4]; //0x2DDA8 - uint32_t m_transition_to_game_session_participant_count; //0x2DDAC - class rage::rlGamerHandle m_transition_to_game_session_participants[32]; //0x2DDB0 - char pad_2DFB0[72]; //0x2DFB0 - class rage::rlGamerHandle m_follower_handles[32]; //0x2DFF8 - uint32_t m_follower_count; //0x2E1F8 - char pad_2E1FC[628]; //0x2E1FC -}; //Size: 0x2E470 -static_assert(sizeof(Network) == 0x2E470); + class NetworkGameConfig m_network_game_config; //0xAC48 + class NetworkGameConfig m_network_transition_config; //0xAD90 + bool m_session_attributes_dirty; //0xAED8 + char pad_AED9[19]; //0xAED9 + uint32_t m_session_visibility_flags; //0xAEEC + uint32_t m_transition_visibility_flags; //0xAEF0 + char pad_AEF4[60]; //0xAEF4 + class MetricSessionMigrated m_metric_session_migrated; //0xAF30 + bool m_migrated_metric_enabled; //0xB278 + char pad_B279[3]; //0xB279 + uint32_t m_game_session_state; //0xB27C + class NetworkGameFilter m_network_game_filter; //0xB280 + char pad_B5C4[33]; //0xB5C4 + bool m_was_invited; //0xB5E5 + char pad_B5E6[10]; //0xB5E6 + class rage::rlSessionInfo m_unk_session_info; //0xB5F0 + char pad_B6C0[635]; //0xB6C0 + bool m_need_host_change; //0xB93B + char pad_B93C[2628]; //0xB93C + class rage::rlSessionDetail m_joining_session_detail; //0xC380 + class SessionInfoBackup m_last_joined_session; //0xC7F8 + char pad_C8D4[40]; //0xC8D4 + uint32_t m_current_matchmaking_group; //0xC8FC + uint32_t m_matchmaking_group_max_players[5]; //0xC900 + uint32_t m_num_active_matchmaking_groups; //0xC914 + char pad_C918[8]; //0xC918 + uint8_t m_matchmaking_property_id; //0xC920 + uint8_t m_matchmaking_mental_state; //0xC921 + char pad_C922[366]; //0xC922 + class rage::rlMatchmakingFindResult m_game_session_matchmaking[3]; //0xCA90 + char pad_195A0[40]; //0x195A0 + class MatchmakingSessionResult m_game_matchmaking_session_results[10]; //0x195C8 + char pad_1C368[308]; //0x1C368 + uint32_t m_num_bosses; //0x1C49C + bool m_num_bosses_set; //0x1C4A0 + char pad_1C4A1[7]; //0x1C4A1 + class rage::rlGamerHandle m_transition_creator_handle; //0x1C4A8 + char pad_1C4B8[12]; //0x1C4B8 + bool m_is_waiting_async; //0x1C4C4 + bool m_is_preferred_activity; //0x1C4C5 + char pad_1C4C6[2]; //0x1C4C6 + uint32_t m_in_progress_finish_time; //0x1C4C8 + char pad_1C4CC[4]; //0x1C4CC + bool m_local_player_info_dirty; //0x1C4D0 + char pad_1C4D1[495]; //0x1C4D1 + class rage::rlGamerHandle m_inviter_handle; //0x1C6C0 + class CNetComplaintMgr m_game_complaint_mgr; //0x1C6D0 + class CNetComplaintMgr m_transition_complaint_mgr; //0x1D368 + char pad_1E000[32]; //0x1E000 + class JoiningPlayerNameMap m_unused_joining_player_name_map; //0x1E020 + char pad_1F948[8]; //0x1F948 + class CNetBlacklist m_blacklist; //0x1F950 + char pad_1FC08[8]; //0x1FC08 + class InvitedGamers m_game_invited_gamers; //0x1FC10 + char pad_20898[4864]; //0x20898 + class SessionInfoBackup m_last_joined_transition; //0x21B98 + uint32_t m_activity_max_players; //0x21C74 + uint32_t m_activity_max_spectators; //0x21C78 + char pad_21C7C[48]; //0x21C7C + bool m_do_not_launch_from_join_as_migrated_host; //0x21CAC + char pad_21CAD[7]; //0x21CAD + bool m_is_activity_session; //0x21CB4 + char pad_21CB5[35]; //0x21CB5 + class RemotePlayerData m_remote_player_data; //0x21CD8 + char pad_222E0[8]; //0x222E0 + class rage::netGamePlayerData m_local_net_game_player_data; //0x222E8 + char pad_22318[608]; //0x22318 + class rage::rlMatchmakingFindResult m_transition_matchmaking[4]; //0x22578 + class NetworkGameFilter m_transition_filters[4]; //0x33438 + char pad_34148[20]; //0x34148 + uint32_t m_transition_quickmatch_group_handle_count; //0x3415C + class rage::rlGamerHandle m_transition_quickmatch_group_handles[32]; //0x34160 + bool m_retain_activity_group; //0x34360 + char pad_34361[7]; //0x34361 + class rage::rlSessionInfo m_transition_to_activity_session_info; //0x34368 + char pad_34438[48]; //0x34438 + class MatchmakingSessionResult m_transition_matchmaking_session_results[10]; //0x34468 + char pad_37208[8]; //0x37208 + class InvitedGamers m_transition_invited_gamers; //0x37210 + char pad_37E98[16]; //0x37E98 + class rage::rlGamerHandle m_transition_to_game_handle; //0x37EA8 + class rage::rlSessionInfo m_transition_to_game_session_info; //0x37EB8 + char pad_37F88[4]; //0x37F88 + uint32_t m_transition_to_game_session_participant_count; //0x37F8C + class rage::rlGamerHandle m_transition_to_game_session_participants[32]; //0x37F90 + char pad_38190[72]; //0x38190 + class rage::rlGamerHandle m_follower_handles[32]; //0x381D8 + uint32_t m_follower_count; //0x383D8 + char pad_383DC[628]; //0x383DC +}; //Size: 0x38650 +static_assert(sizeof(Network) == 0x38650); #pragma pack(pop) \ No newline at end of file diff --git a/network/RemoteGamerInfoMsg.hpp b/network/RemoteGamerInfoMsg.hpp index e4222a5..1ab0e43 100644 --- a/network/RemoteGamerInfoMsg.hpp +++ b/network/RemoteGamerInfoMsg.hpp @@ -31,5 +31,5 @@ public: uint32_t m_num_handles; //0x02C8 class rage::rlGamerHandle m_handles[32]; //0x02D0 }; //Size: 0x04D0 -static_assert(sizeof(RemoteGamerInfoMsg) == 0x4D0); +static_assert(sizeof(RemoteGamerInfoMsg) == 0x530); #pragma pack(pop) diff --git a/network/netObject.hpp b/network/netObject.hpp index 3736d86..e568b5b 100644 --- a/network/netObject.hpp +++ b/network/netObject.hpp @@ -2,6 +2,7 @@ #include #include "../rage/netSyncTree.hpp" +#include "../base/atRTTI.hpp" class CObject; namespace rage @@ -20,17 +21,19 @@ namespace rage char pad_004E[1]; //0x004E bool m_should_not_be_delete; //0x004F - virtual ~netObject() = 0; - virtual void mov1() = 0; - virtual void mov2() = 0; - virtual void m_8() = 0; - virtual void m_10() = 0; - virtual void m_18() = 0; - virtual void* m_20() = 0; - virtual void m_28() = 0; - virtual netSyncTree* GetSyncTree() = 0; - virtual void m_38() = 0; - virtual void m_40() = 0; + DEFINE_RAGE_RTTI(rage::netObject) + + virtual void mov1() = 0; // 0x38 + virtual void mov2() = 0; // 0x40 + + virtual void m_8() = 0; // 0x48 + virtual void m_10() = 0; // 0x50 + virtual void m_18() = 0; // 0x58 + virtual void* m_20() = 0; // 0x60 + virtual void m_28() = 0; // 0x68 + virtual netSyncTree* GetSyncTree() = 0; // 0x70 + virtual void m_38() = 0; // 0x78 + virtual void m_40() = 0; // 0x80 virtual void m_48() = 0; virtual void m_50() = 0; virtual void m_58() = 0; diff --git a/network/snSession.hpp b/network/snSession.hpp index 20fd7d6..6136925 100644 --- a/network/snSession.hpp +++ b/network/snSession.hpp @@ -15,7 +15,7 @@ namespace rage uint64_t m_msg_id; //0x0000 class rage::rlGamerInfo m_player_data; //0x0008 }; //Size: 0x00A0 - static_assert(sizeof(rage::snPlayer) == 0xA0); + static_assert(sizeof(rage::snPlayer) == 0x100); class snPeer { @@ -23,7 +23,7 @@ namespace rage class rage::rlGamerInfo m_peer_data; //0x0000 char pad_0098[40]; //0x0098 }; //Size: 0x00C0 - static_assert(sizeof(rage::snPeer) == 0xC0); + static_assert(sizeof(rage::snPeer) == 0x120); class rlRemoteGamer { @@ -40,15 +40,15 @@ namespace rage class rlSession { public: - char pad_0008[168]; //0x0008 - class rage::rlSessionInfo m_session_info; //0x00B0 - char pad_0120[288]; //0x0120 - uint64_t m_session_id; //0x0240 - char pad_0248[1648]; //0x0248 + char pad_0008[256]; //0x0008 + class rage::rlSessionInfo m_session_info; //0x0108 + char pad_01D8[296]; //0x01D8 + uint64_t m_session_id; //0x0300 + char pad_0308[1136]; //0x0308 virtual ~rlSession() = default; - }; //Size: 0x08B8 - static_assert(sizeof(rage::rlSession) == 0x8B8); + }; //Size: 0x0778 + static_assert(sizeof(rage::rlSession) == 0x778); class rlSessionDetail { @@ -74,7 +74,7 @@ namespace rage uint8_t m_population_density; //0x0277 char pad_0278[320]; //0x0278 }; //Size: 0x03CA - static_assert(sizeof(rlSessionDetail) == 0x3B8); + static_assert(sizeof(rlSessionDetail) == 0x478); class rlMatchmakingFindResult @@ -83,7 +83,7 @@ namespace rage class rage::rlSessionDetail m_result_session_details[15]; //0x0000 char pad_37C8[168]; //0x37C8 }; //Size: 0x3870 - static_assert(sizeof(rage::rlMatchmakingFindResult) == 0x3870); + static_assert(sizeof(rage::rlMatchmakingFindResult) == 0x43B0); class netGamePlayerData { @@ -168,7 +168,7 @@ namespace rage } }; //Size: 0x3E70 - static_assert(sizeof(rage::snSession) == 0x3E70); + static_assert(sizeof(rage::snSession) == 0x5590); class snMsgRemoveGamersFromSessionCmd { diff --git a/ped/CPed.hpp b/ped/CPed.hpp index c1b1fcb..2615b30 100644 --- a/ped/CPed.hpp +++ b/ped/CPed.hpp @@ -7,7 +7,7 @@ #include "CPedInventory.hpp" #include "../entities/fwEntity.hpp" #include "../rage/vector.hpp" -#include "CPedOxygenInfo.hpp" +#include "CPedIntelligence.hpp" #include "CPedBoneInfo.hpp" #include @@ -26,7 +26,7 @@ public: char pad_0D18[896]; //0x0D18 uint32_t m_ped_type; //0x1098 char pad_109C[4]; //0x109C - class CPedOxygenInfo* m_oxygen_info; //0x10A0 + class CPedIntelligence* m_ped_intelligence; //0x10A0 class CPlayerInfo *m_player_info; //0x10A8 class CPedInventory* m_inventory; //0x10B0 class CPedWeaponManager *m_weapon_manager; //0x10B8 diff --git a/ped/CPedFactory.hpp b/ped/CPedFactory.hpp index 44f984b..90856f5 100644 --- a/ped/CPedFactory.hpp +++ b/ped/CPedFactory.hpp @@ -1,11 +1,23 @@ #pragma once - #include "CPed.hpp" class CPedFactory { public: - char pad_0000[8]; //0x0000 + enum class PedCreateFlags + { + IS_NETWORKED = (1 << 0), + IS_PLAYER = (1 << 1) + }; + + virtual ~CPedFactory() = default; + virtual CPed* CreatePed(std::uint8_t* flags, std::uint16_t* model_index, rage::fmatrix44* matrix, bool default_component_variation, bool register_network_object, bool give_default_loadout, bool, bool) = 0; // 0x08 + virtual CPed* CreateClone(std::uint8_t* flags, std::uint16_t* model_index, rage::fmatrix44* matrix, bool default_component_variation, bool, bool register_network_object, bool) = 0; // 0x10 + virtual CPed* ClonePed(CPed* ped, bool register_network_object, bool link_blends, bool clone_compressed_damage) = 0; // 0x18 + virtual CPed* ClonePedToTarget(CPed* source, CPed* target, bool clone_compressed_damage) = 0; // 0x20 + virtual CPed* CreatePlayer(std::uint8_t* flags, std::uint16_t model_index, rage::fmatrix44* matrix, CPlayerInfo* player_info) = 0; // 0x28 + virtual void DestroyPed(CPed* ped) = 0; // 0x30 + class CPed* m_local_ped; //0x0008 }; //Size: 0x0010 static_assert(sizeof(CPedFactory) == 0x10); diff --git a/ped/CPedOxygenInfo.hpp b/ped/CPedIntelligence.hpp similarity index 100% rename from ped/CPedOxygenInfo.hpp rename to ped/CPedIntelligence.hpp diff --git a/ped/CPedInventory.hpp b/ped/CPedInventory.hpp index 96464e8..0f546f3 100644 --- a/ped/CPedInventory.hpp +++ b/ped/CPedInventory.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include "../base/atRTTI.hpp" class CPed; @@ -8,13 +9,10 @@ class CPed; class CPedInventory { public: - virtual ~CPedInventory(); - virtual void _0x0008(); - virtual void _0x0010(); - virtual void _0x0018(); + DEFINE_RAGE_RTTI(CPedInventory); uint64_t unk_0008; - CPed* m_ped; + CPed* m_ped; //0x0010 uint64_t unk_0018; uint32_t unk_0020; uint64_t unk_0028; @@ -31,7 +29,8 @@ public: char pad_006C[4]; char unk_0070; char pad_0071[7]; - char unk_0078; + bool m_infinite_ammo : 1; + bool m_infinite_clip : 1; char pad_0079[7]; uint64_t unk_0080; }; diff --git a/ped/CPedWeaponManager.hpp b/ped/CPedWeaponManager.hpp index 62a2d27..3e484a1 100644 --- a/ped/CPedWeaponManager.hpp +++ b/ped/CPedWeaponManager.hpp @@ -14,5 +14,6 @@ public: class CWeaponInfo* m_weapon_info; //0x0020 char pad_0028[72]; //0x0028 class CWeaponInfo* m_vehicle_weapon_info; //0x0070 -}; //Size: 0x0078 -static_assert(sizeof(CPedWeaponManager) == 0x78); + class CObject* m_weapon_object; //0x0078 +}; //Size: 0x0080 +static_assert(sizeof(CPedWeaponManager) == 0x80); diff --git a/player/CPlayerInfo.hpp b/player/CPlayerInfo.hpp index a5a3279..517957e 100644 --- a/player/CPlayerInfo.hpp +++ b/player/CPlayerInfo.hpp @@ -61,5 +61,5 @@ public: char pad_0D24[8]; //0x0D24 float m_melee_weapon_defence_mult; //0x0D2C }; //Size: 0x0D30 -static_assert(sizeof(CPlayerInfo) == 0xD30); +static_assert(sizeof(CPlayerInfo) == 0xD90); #pragma pack(pop) diff --git a/rage/rlGamerInfo.hpp b/rage/rlGamerInfo.hpp index 09aeb47..c2854c5 100644 --- a/rage/rlGamerInfo.hpp +++ b/rage/rlGamerInfo.hpp @@ -15,6 +15,6 @@ namespace rage uint32_t m_ros_privilege; char m_name[17]; }; //Size: 0x0098 - static_assert(sizeof(rlGamerInfo) == 0x98); + static_assert(sizeof(rlGamerInfo) == 0xF8); #pragma pack(pop) } diff --git a/rage/rlGamerInfoBase.hpp b/rage/rlGamerInfoBase.hpp index 0dc3397..e12ab8d 100644 --- a/rage/rlGamerInfoBase.hpp +++ b/rage/rlGamerInfoBase.hpp @@ -21,6 +21,7 @@ namespace rage class rlGamerInfoBase { public: + char pad_0000[0x60]; uint64_t m_peer_id; //0x0000 rlGamerHandle m_gamer_handle; //0x008 char m_aes_key[32]; //0x0018 @@ -35,6 +36,6 @@ namespace rage uint16_t m_internal_port; //0x0058 uint32_t unk_005C; //0x005C }; - static_assert(sizeof(rlGamerInfoBase) == 0x60); + static_assert(sizeof(rlGamerInfoBase) == 0xC0); #pragma pack(pop) } \ No newline at end of file diff --git a/rage/rlSessionInfo.hpp b/rage/rlSessionInfo.hpp index 7903f6a..0e81a06 100644 --- a/rage/rlSessionInfo.hpp +++ b/rage/rlSessionInfo.hpp @@ -12,5 +12,5 @@ namespace rage uint64_t m_session_token; //0x0008 rlGamerInfoBase m_net_player_data; //0x0010 }; - static_assert(sizeof(rlSessionInfo) == 0x70); + static_assert(sizeof(rlSessionInfo) == 0xD0); } \ No newline at end of file diff --git a/script/globals/GSBD.hpp b/script/globals/GSBD.hpp index e2ae391..01e8e7d 100644 --- a/script/globals/GSBD.hpp +++ b/script/globals/GSBD.hpp @@ -70,7 +70,7 @@ struct GSBD SCR_ARRAY SpawnPositionCreationTimes; SCR_ARRAY SpawnPositionsValid; SCR_ARRAY PAD_0294; - SCR_ARRAY SpawnPositionTokens; + SCR_ARRAY SpawnPositionTokens; SCR_INT SpawnPositionCounter; SCR_ARRAY RespawnVehicles; SCR_ARRAY RespawnVehicleSeats; diff --git a/script/globals/GlobalPlayerBD.hpp b/script/globals/GlobalPlayerBD.hpp index f4982f2..811de58 100644 --- a/script/globals/GlobalPlayerBD.hpp +++ b/script/globals/GlobalPlayerBD.hpp @@ -419,23 +419,23 @@ struct GlobalPlayerBDEntry SCR_BITSET AnimationBitset; SCR_INT NumSuccessfulHoldups; // resets every 12 minutes SCR_INT PAD_0037; - SCR_INT PersonalVehicleNetId; - SCR_INT UnkVehicleNetId; - SCR_INT UnkVehicleNetId2; + NETWORK_INDEX PersonalVehicleNetId; + NETWORK_INDEX UnkVehicleNetId; + NETWORK_INDEX UnkVehicleNetId2; SCR_ARRAY UnkVehicleNetIds; - SCR_INT DeliveryMechanicNetId; - SCR_INT DeliveryMechanicNetId2; + NETWORK_INDEX DeliveryMechanicNetId; + NETWORK_INDEX DeliveryMechanicNetId2; SCR_INT SpawningVehicleLiveryIndex; SCR_INT SpawningVehiclePrimaryColor; SCR_INT SpawningVehicleSecondaryColor; - SCR_INT AvengerNetId; - SCR_INT DeliveryMechanicNetId3; // wtf is this? - SCR_INT TerrorbyteNetId; // or is it the MOC? - SCR_INT SubmarineNetId; - SCR_INT DinghyNetId; - SCR_INT DeliveryMechanicNetId4; // another one... - SCR_INT AcidLabNetId; - SCR_INT DeliveryBikeNetId; // this is a guess, verify + NETWORK_INDEX AvengerNetId; + NETWORK_INDEX DeliveryMechanicNetId3; // wtf is this? + NETWORK_INDEX TerrorbyteNetId; // or is it the MOC? + NETWORK_INDEX SubmarineNetId; + NETWORK_INDEX DinghyNetId; + NETWORK_INDEX DeliveryMechanicNetId4; // another one... + NETWORK_INDEX AcidLabNetId; + NETWORK_INDEX DeliveryBikeNetId; // this is a guess, verify SCR_BOOL PAD_0057; uint64_t PAD_0058[15]; // confirmed these are not used by PC scripts PLAYER_BLIP PlayerBlip;