From 11c1ebdec912c920b368be402641292127ba8c3f Mon Sep 17 00:00:00 2001 From: maybegreat48 <96936658+maybegreat48@users.noreply.github.com> Date: Thu, 23 Feb 2023 23:11:35 +0000 Subject: [PATCH] Improve sync classes (#108) --- .github/workflows/build.yml | 5 +- CMakeLists.txt | 21 +- classes.cpp | 190 ++++++++++++++++++ .../automobile/CAutomobileCreationNode.hpp | 10 - .../CDynamicEntityGameStateDataNode.hpp | 24 --- .../entity/CEntityOrientationDataNode.hpp | 11 - .../entity/CEntityScriptGameStateDataNode.hpp | 10 - datanodes/ped/CPedInventoryDataNode.hpp | 22 -- datanodes/ped/CPedOrientationDataNode.hpp | 14 -- datanodes/ped/CPedScriptCreationDataNode.hpp | 9 - .../physical/CPhysicalHealthDataNode.hpp | 18 -- netsync/CProjectBaseSyncDataNode.hpp | 46 +++++ netsync/CProjectSyncTree.hpp | 10 + netsync/NodeCommonDataOperations.hpp | 23 +++ .../netSyncDataNode.hpp | 10 +- netsync/netSyncNodeBase.hpp | 39 ++++ netsync/netSyncParentNode.hpp | 14 ++ netsync/netSyncTree.hpp | 27 +++ .../nodes}/CPedComponents.hpp | 0 .../automobile/CAutomobileCreationNode.hpp | 10 + .../nodes}/door/CDoorCreationDataNode.hpp | 7 +- netsync/nodes/door/CDoorMovementDataNode.hpp | 17 ++ .../door/CDoorScriptGameStateDataNode.hpp | 18 ++ .../nodes/door/CDoorScriptInfoDataNode.hpp | 16 ++ .../entity/CEntityOrientationDataNode.hpp | 11 + .../entity/CEntityScriptGameStateDataNode.hpp | 12 ++ .../entity/CEntityScriptInfoDataNode.hpp | 14 ++ .../nodes}/object/CObjectCreationDataNode.hpp | 9 +- .../nodes}/ped/CPedAIDataNode.hpp | 5 +- .../nodes}/ped/CPedAppearanceDataNode.hpp | 5 +- .../nodes}/ped/CPedAttachDataNode.hpp | 7 +- .../ped/CPedComponentReservationDataNode.hpp | 14 ++ .../nodes}/ped/CPedCreationDataNode.hpp | 5 +- .../nodes}/ped/CPedGameStateDataNode.hpp | 5 +- .../nodes}/ped/CPedHealthDataNode.hpp | 5 +- .../nodes}/ped/CPedMovementDataNode.hpp | 5 +- netsync/nodes/ped/CPedOrientationDataNode.hpp | 14 ++ .../nodes/ped/CPedScriptCreationDataNode.hpp | 11 + .../nodes}/ped/CPedTaskSpecificDataNode.hpp | 7 +- .../physical/CPhysicalAngVelocityDataNode.hpp | 7 +- .../physical/CPhysicalAttachDataNode.hpp | 7 +- .../physical/CPhysicalMigrationDataNode.hpp | 12 ++ .../CPhysicalScriptMigrationDataNode.hpp | 14 ++ .../physical/CPhysicalVelocityDataNode.hpp | 5 +- .../nodes}/pickup/CPickupCreationDataNode.hpp | 11 +- .../CPickupPlacementCreationDataNode.hpp | 7 +- .../player/CPlayerAppearanceDataNode.hpp | 5 +- .../nodes}/player/CPlayerCameraDataNode.hpp | 4 +- .../nodes}/player/CPlayerCreationDataNode.hpp | 5 +- .../player/CPlayerGameStateDataNode.hpp | 5 +- .../nodes}/player/CPlayerGamerDataNode.hpp | 7 +- .../nodes}/player/CPlayerSectorPosNode.hpp | 9 +- .../CGlobalFlagsDataNode.hpp | 5 +- .../CMigrationDataNode.hpp | 5 +- .../proximity_migrateable/CSectorDataNode.hpp | 5 +- .../CSectorPositionDataNode.hpp | 4 +- .../nodes}/task/CClonedGeneralSweepInfo.hpp | 0 .../task/ClonedTakeOffPedVariationInfo.hpp | 2 +- .../nodes}/train/CTrainGameStateDataNode.hpp | 5 +- .../vehicle/CVehicleCreationDataNode.hpp | 5 +- .../nodes}/vehicle/CVehicleGadgetDataNode.hpp | 5 +- netsync/trees/CDynamicEntitySyncTreeBase.hpp | 12 ++ netsync/trees/CEntitySyncTreeBase.hpp | 15 ++ netsync/trees/CPhysicalSyncTreeBase.hpp | 29 +++ .../CProximityMigrateableSyncTreeBase.hpp | 22 ++ network/Network.hpp | 2 +- network/netObject.hpp | 2 +- rage/netSyncNodeBase.hpp | 30 --- rage/netSyncTree.hpp | 26 --- script/CGameScriptObjInfo.hpp | 16 ++ script/MPScriptData.hpp | 11 + script/globals/GPBD_FM.hpp | 22 +- script/globals/GPBD_FM_3.hpp | 10 +- script/globals/GlobalPlayerBD.hpp | 121 ++++++++++- script/scriptId.hpp | 12 ++ script/scriptIdBase.hpp | 60 +++--- stats/CPlayerCardStats.hpp | 23 +++ stats/CStatsSerializationContext.hpp | 27 +++ 78 files changed, 917 insertions(+), 357 deletions(-) create mode 100644 classes.cpp delete mode 100644 datanodes/automobile/CAutomobileCreationNode.hpp delete mode 100644 datanodes/dynamic_entity/CDynamicEntityGameStateDataNode.hpp delete mode 100644 datanodes/entity/CEntityOrientationDataNode.hpp delete mode 100644 datanodes/entity/CEntityScriptGameStateDataNode.hpp delete mode 100644 datanodes/ped/CPedInventoryDataNode.hpp delete mode 100644 datanodes/ped/CPedOrientationDataNode.hpp delete mode 100644 datanodes/ped/CPedScriptCreationDataNode.hpp delete mode 100644 datanodes/physical/CPhysicalHealthDataNode.hpp create mode 100644 netsync/CProjectBaseSyncDataNode.hpp create mode 100644 netsync/CProjectSyncTree.hpp create mode 100644 netsync/NodeCommonDataOperations.hpp rename rage/netSyncDataNodeBase.hpp => netsync/netSyncDataNode.hpp (55%) create mode 100644 netsync/netSyncNodeBase.hpp create mode 100644 netsync/netSyncParentNode.hpp create mode 100644 netsync/netSyncTree.hpp rename {datanodes => netsync/nodes}/CPedComponents.hpp (100%) create mode 100644 netsync/nodes/automobile/CAutomobileCreationNode.hpp rename {datanodes => netsync/nodes}/door/CDoorCreationDataNode.hpp (72%) create mode 100644 netsync/nodes/door/CDoorMovementDataNode.hpp create mode 100644 netsync/nodes/door/CDoorScriptGameStateDataNode.hpp create mode 100644 netsync/nodes/door/CDoorScriptInfoDataNode.hpp create mode 100644 netsync/nodes/entity/CEntityOrientationDataNode.hpp create mode 100644 netsync/nodes/entity/CEntityScriptGameStateDataNode.hpp create mode 100644 netsync/nodes/entity/CEntityScriptInfoDataNode.hpp rename {datanodes => netsync/nodes}/object/CObjectCreationDataNode.hpp (88%) rename {datanodes => netsync/nodes}/ped/CPedAIDataNode.hpp (67%) rename {datanodes => netsync/nodes}/ped/CPedAppearanceDataNode.hpp (89%) rename {datanodes => netsync/nodes}/ped/CPedAttachDataNode.hpp (79%) create mode 100644 netsync/nodes/ped/CPedComponentReservationDataNode.hpp rename {datanodes => netsync/nodes}/ped/CPedCreationDataNode.hpp (86%) rename {datanodes => netsync/nodes}/ped/CPedGameStateDataNode.hpp (95%) rename {datanodes => netsync/nodes}/ped/CPedHealthDataNode.hpp (86%) rename {datanodes => netsync/nodes}/ped/CPedMovementDataNode.hpp (81%) create mode 100644 netsync/nodes/ped/CPedOrientationDataNode.hpp create mode 100644 netsync/nodes/ped/CPedScriptCreationDataNode.hpp rename {datanodes => netsync/nodes}/ped/CPedTaskSpecificDataNode.hpp (69%) rename {datanodes => netsync/nodes}/physical/CPhysicalAngVelocityDataNode.hpp (70%) rename {datanodes => netsync/nodes}/physical/CPhysicalAttachDataNode.hpp (86%) create mode 100644 netsync/nodes/physical/CPhysicalMigrationDataNode.hpp create mode 100644 netsync/nodes/physical/CPhysicalScriptMigrationDataNode.hpp rename {datanodes => netsync/nodes}/physical/CPhysicalVelocityDataNode.hpp (70%) rename {datanodes => netsync/nodes}/pickup/CPickupCreationDataNode.hpp (76%) rename {datanodes => netsync/nodes}/pickup_placement/CPickupPlacementCreationDataNode.hpp (81%) rename {datanodes => netsync/nodes}/player/CPlayerAppearanceDataNode.hpp (96%) rename {datanodes => netsync/nodes}/player/CPlayerCameraDataNode.hpp (85%) rename {datanodes => netsync/nodes}/player/CPlayerCreationDataNode.hpp (76%) rename {datanodes => netsync/nodes}/player/CPlayerGameStateDataNode.hpp (97%) rename {datanodes => netsync/nodes}/player/CPlayerGamerDataNode.hpp (86%) rename {datanodes => netsync/nodes}/player/CPlayerSectorPosNode.hpp (74%) rename {datanodes => netsync/nodes}/proximity_migrateable/CGlobalFlagsDataNode.hpp (64%) rename {datanodes => netsync/nodes}/proximity_migrateable/CMigrationDataNode.hpp (69%) rename {datanodes => netsync/nodes}/proximity_migrateable/CSectorDataNode.hpp (64%) rename {datanodes => netsync/nodes}/proximity_migrateable/CSectorPositionDataNode.hpp (65%) rename {datanodes => netsync/nodes}/task/CClonedGeneralSweepInfo.hpp (100%) rename {datanodes => netsync/nodes}/task/ClonedTakeOffPedVariationInfo.hpp (96%) rename {datanodes => netsync/nodes}/train/CTrainGameStateDataNode.hpp (87%) rename {datanodes => netsync/nodes}/vehicle/CVehicleCreationDataNode.hpp (80%) rename {datanodes => netsync/nodes}/vehicle/CVehicleGadgetDataNode.hpp (87%) create mode 100644 netsync/trees/CDynamicEntitySyncTreeBase.hpp create mode 100644 netsync/trees/CEntitySyncTreeBase.hpp create mode 100644 netsync/trees/CPhysicalSyncTreeBase.hpp create mode 100644 netsync/trees/CProximityMigrateableSyncTreeBase.hpp delete mode 100644 rage/netSyncNodeBase.hpp delete mode 100644 rage/netSyncTree.hpp create mode 100644 script/CGameScriptObjInfo.hpp create mode 100644 script/MPScriptData.hpp create mode 100644 stats/CPlayerCardStats.hpp create mode 100644 stats/CStatsSerializationContext.hpp diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index edc35e6..e0a7b21 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,4 +14,7 @@ jobs: - uses: actions/checkout@v3 - name: Configure - run: cmake -B ${{github.workspace}}/build + run: cmake -S ${{github.workspace}} -B ${{github.workspace}}/build + + - name: Build 64bit release DLL + run: cmake --build ${{github.workspace}}/build --config Release --target GTAV-Classes -- diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f450e2..a18b0ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,22 +13,17 @@ set(CMAKE_REQUIRED_QUIET ON) set(OK TRUE) file(GLOB_RECURSE HEADERS "**.hpp") +file(GLOB_RECURSE SRC_MAIN "classes.cpp") +source_group(FILES ${SRC_MAIN}) +add_library(GTAV-Classes MODULE "${SRC_MAIN}") + +add_compile_definitions(_CRT_SECURE_NO_WARNINGS) message(STATUS "") -foreach(HEADER ${HEADERS}) - get_filename_component(FILENAME ${HEADER} NAME) - check_include_file_cxx("${HEADER}" ${FILENAME}_OK) - - if(${FILENAME}_OK) - message(STATUS "${FILENAME} OK!") - else() - set(OK FALSE) - message(SEND_ERROR "${FILENAME} failed to compile!") - endif() -endforeach() - -message(STATUS "") +target_include_directories(GTAV-Classes PRIVATE + "${SRC_DIR}" +) if(NOT OK) file(READ "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeError.log" LOG) diff --git a/classes.cpp b/classes.cpp new file mode 100644 index 0000000..507a802 --- /dev/null +++ b/classes.cpp @@ -0,0 +1,190 @@ +#include "base/atRTTI.hpp" +#include "base/CBaseModelInfo.hpp" +#include "base/CNavigation.hpp" +#include "base/CObject.hpp" +#include "base/datBase.hpp" +#include "base/fwArchetype.hpp" +#include "base/fwArchetypeDef.hpp" +#include "base/fwExtensibleBase.hpp" +#include "base/fwExtension.hpp" +#include "base/fwExtensionContainer.hpp" +#include "base/fwRefAwareBase.hpp" +#include "base/fwRefAwareBaseImpl.hpp" +#include "base/HashTable.hpp" +#include "base/pgBase.hpp" +#include "base/phArchetype.hpp" +#include "base/phBound.hpp" +#include "base/phBoundCapsule.hpp" +#include "base/phBoundComposite.hpp" +#include "camera/CCameraAngles.hpp" +#include "camera/CCameraManagerAngles.hpp" +#include "camera/CGameCameraAngles.hpp" +#include "draw_handlers/CEntityDrawHandler.hpp" +#include "draw_handlers/CObjectDrawHandler.hpp" +#include "draw_handlers/CPedDrawHandler.hpp" +#include "draw_handlers/CVehicleDrawHandler.hpp" +#include "draw_handlers/fwDrawData.hpp" +#include "entities/CAttackers.hpp" +#include "entities/CDynamicEntity.hpp" +#include "entities/CEntity.hpp" +#include "entities/CPhysical.hpp" +#include "entities/fwEntity.hpp" +#include "enums/eExplosionTag.hpp" +#include "enums/eHandlingType.hpp" +#include "misc/CTunables.hpp" +#include "netsync/CProjectBaseSyncDataNode.hpp" +#include "netsync/CProjectSyncTree.hpp" +#include "netsync/netSyncDataNode.hpp" +#include "netsync/netSyncNodeBase.hpp" +#include "netsync/netSyncParentNode.hpp" +#include "netsync/netSyncTree.hpp" +#include "netsync/NodeCommonDataOperations.hpp" +#include "netsync/nodes/automobile/CAutomobileCreationNode.hpp" +#include "netsync/nodes/CPedComponents.hpp" +#include "netsync/nodes/door/CDoorCreationDataNode.hpp" +#include "netsync/nodes/door/CDoorMovementDataNode.hpp" +#include "netsync/nodes/door/CDoorScriptGameStateDataNode.hpp" +#include "netsync/nodes/door/CDoorScriptInfoDataNode.hpp" +#include "netsync/nodes/dynamic_entity/CDynamicEntityGameStateDataNode.hpp" +#include "netsync/nodes/entity/CEntityOrientationDataNode.hpp" +#include "netsync/nodes/entity/CEntityScriptGameStateDataNode.hpp" +#include "netsync/nodes/entity/CEntityScriptInfoDataNode.hpp" +#include "netsync/nodes/object/CObjectCreationDataNode.hpp" +#include "netsync/nodes/ped/CPedAIDataNode.hpp" +#include "netsync/nodes/ped/CPedAppearanceDataNode.hpp" +#include "netsync/nodes/ped/CPedAttachDataNode.hpp" +#include "netsync/nodes/ped/CPedComponentReservationDataNode.hpp" +#include "netsync/nodes/ped/CPedCreationDataNode.hpp" +#include "netsync/nodes/ped/CPedGameStateDataNode.hpp" +#include "netsync/nodes/ped/CPedHealthDataNode.hpp" +#include "netsync/nodes/ped/CPedInventoryDataNode.hpp" +#include "netsync/nodes/ped/CPedMovementDataNode.hpp" +#include "netsync/nodes/ped/CPedOrientationDataNode.hpp" +#include "netsync/nodes/ped/CPedScriptCreationDataNode.hpp" +#include "netsync/nodes/ped/CPedTaskSpecificDataNode.hpp" +#include "netsync/nodes/physical/CPhysicalAngVelocityDataNode.hpp" +#include "netsync/nodes/physical/CPhysicalAttachDataNode.hpp" +#include "netsync/nodes/physical/CPhysicalHealthDataNode.hpp" +#include "netsync/nodes/physical/CPhysicalMigrationDataNode.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/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/CPlayerSectorPosNode.hpp" +#include "netsync/nodes/proximity_migrateable/CGlobalFlagsDataNode.hpp" +#include "netsync/nodes/proximity_migrateable/CMigrationDataNode.hpp" +#include "netsync/nodes/proximity_migrateable/CSectorDataNode.hpp" +#include "netsync/nodes/proximity_migrateable/CSectorPositionDataNode.hpp" +#include "netsync/nodes/task/ClonedTakeOffPedVariationInfo.hpp" +#include "netsync/nodes/train/CTrainGameStateDataNode.hpp" +#include "netsync/nodes/vehicle/CVehicleCreationDataNode.hpp" +#include "netsync/nodes/vehicle/CVehicleGadgetDataNode.hpp" +#include "netsync/trees/CDynamicEntitySyncTreeBase.hpp" +#include "netsync/trees/CEntitySyncTreeBase.hpp" +#include "netsync/trees/CPhysicalSyncTreeBase.hpp" +#include "netsync/trees/CProximityMigrateableSyncTreeBase.hpp" +#include "network/CCommunications.hpp" +#include "network/ChatData.hpp" +#include "network/CJoinRequestContext.hpp" +#include "network/ClanData.hpp" +#include "network/CMsgJoinResponse.hpp" +#include "network/CMsgTextMessage.hpp" +#include "network/CNetComplaintMgr.hpp" +#include "network/CNetGamePlayer.hpp" +#include "network/CNetGamePlayerDataMsg.hpp" +#include "network/CNetworkPlayerMgr.hpp" +#include "network/netObject.hpp" +#include "network/netPlayer.hpp" +#include "network/netPlayerMgrBase.hpp" +#include "network/netTime.hpp" +#include "network/Network.hpp" +#include "network/RemoteGamerInfoMsg.hpp" +#include "network/snConnectToPeerTask.hpp" +#include "network/snSession.hpp" +#include "ped/CPed.hpp" +#include "ped/CPedBoneInfo.hpp" +#include "ped/CPedFactory.hpp" +#include "ped/CPedIntelligence.hpp" +#include "ped/CPedInventory.hpp" +#include "ped/CPedModelInfo.hpp" +#include "ped/CPedWeaponManager.hpp" +#include "player/CNonPhysicalPlayerData.hpp" +#include "player/CPlayerAngles.hpp" +#include "player/CPlayerInfo.hpp" +#include "rage/atArray.hpp" +#include "rage/atSingleton.hpp" +#include "rage/joaat.hpp" +#include "rage/rlGamerHandle.hpp" +#include "rage/rlGamerInfo.hpp" +#include "rage/rlGamerInfoBase.hpp" +#include "rage/rlMetric.hpp" +#include "rage/rlQueryPresenceAttributesContext.hpp" +#include "rage/rlScHandle.hpp" +#include "rage/rlSessionByGamerTaskResult.hpp" +#include "rage/rlSessionInfo.hpp" +#include "rage/rlTaskStatus.hpp" +#include "rage/sysMemAllocator.hpp" +#include "rage/vector.hpp" +#include "script/dataList.hpp" +#include "script/globals/GlobalPlayerBD.hpp" +#include "script/globals/GPBD_FM.hpp" +#include "script/globals/GPBD_FM_3.hpp" +#include "script/globals/GPBD_Kicking.hpp" +#include "script/globals/GPBD_MissionName.hpp" +#include "script/globals/GSBD.hpp" +#include "script/globals/GSBD_BlockB.hpp" +#include "script/globals/GSBD_FM.hpp" +#include "script/globals/GSBD_Kicking.hpp" +#include "script/globals/GSBD_PropertyInstances.hpp" +#include "script/globals/g_AMC_playerBD.hpp" +#include "script/CGameScriptObjInfo.hpp" +#include "script/GtaThread.hpp" +#include "script/HudColor.hpp" +#include "script/MPScriptData.hpp" +#include "script/scriptHandler.hpp" +#include "script/scriptHandlerMgr.hpp" +#include "script/scriptHandlerNetComponent.hpp" +#include "script/scriptId.hpp" +#include "script/scriptIdBase.hpp" +#include "script/scriptResource.hpp" +#include "script/scrNativeHandler.hpp" +#include "script/scrNativeRegistration.hpp" +#include "script/scrNativeRegistrationTable.hpp" +#include "script/scrProgram.hpp" +#include "script/scrProgramTable.hpp" +#include "script/scrProgramTableEntry.hpp" +#include "script/scrThread.hpp" +#include "script/scrThreadContext.hpp" +#include "script/scrVector.hpp" +#include "script/Timer.hpp" +#include "script/tlsContext.hpp" +#include "script/types.hpp" +#include "security/ObfVar.hpp" +#include "security/RageSecurity.hpp" +#include "socialclub/FriendInfo.hpp" +#include "socialclub/FriendRegistry.hpp" +#include "socialclub/ScInfo.hpp" +#include "stats/CPlayerCardStats.hpp" +#include "stats/CStatsSerializationContext.hpp" +#include "vehicle/CAdvancedData.hpp" +#include "vehicle/CBaseSubHandlingData.hpp" +#include "vehicle/CCarHandlingData.hpp" +#include "vehicle/CHandlingData.hpp" +#include "vehicle/CHandlingObject.hpp" +#include "vehicle/CVehicle.hpp" +#include "vehicle/CVehicleModelInfo.hpp" +#include "weapon/CAmmoInfo.hpp" +#include "weapon/CAmmoProjectileInfo.hpp" +#include "weapon/CAmmoRocketInfo.hpp" +#include "weapon/CAmmoThrownInfo.hpp" +#include "weapon/CHomingRocketParams.hpp" +#include "weapon/CItemInfo.hpp" +#include "weapon/CWeaponBoneId.hpp" +#include "weapon/CWeaponInfo.hpp" + +// add your classes here \ No newline at end of file diff --git a/datanodes/automobile/CAutomobileCreationNode.hpp b/datanodes/automobile/CAutomobileCreationNode.hpp deleted file mode 100644 index aeb8c1d..0000000 --- a/datanodes/automobile/CAutomobileCreationNode.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -class CAutomobileCreationDataNode -{ -public: - char pad_0000[192]; //0x0000 - bool m_all_doors_closed; //0x00C0 - bool m_door_closed[10]; //0x00C1 -}; //Size: 0x00CB -static_assert(sizeof(CAutomobileCreationDataNode) == 0xCB); \ No newline at end of file diff --git a/datanodes/dynamic_entity/CDynamicEntityGameStateDataNode.hpp b/datanodes/dynamic_entity/CDynamicEntityGameStateDataNode.hpp deleted file mode 100644 index db6e5c1..0000000 --- a/datanodes/dynamic_entity/CDynamicEntityGameStateDataNode.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include - -#pragma pack(push, 4) -struct CDecorator -{ - uint32_t m_type; - uint32_t m_name_hash; - uint32_t m_value; -}; - -class CDynamicEntityGameStateDataNode -{ -public: - char pad_0000[192]; // 0x0000 - uint32_t m_interior_index; // 0x00C0 - bool unk_00C4; // 0x00C4 - bool unk_00C5; // 0x00C5 - uint32_t m_decor_count; // 0x00C8 - CDecorator m_decors[12]; // 0x00CC -}; //Size: 0x15C -static_assert(sizeof(CDynamicEntityGameStateDataNode) == 0x15C); -#pragma pack(pop) diff --git a/datanodes/entity/CEntityOrientationDataNode.hpp b/datanodes/entity/CEntityOrientationDataNode.hpp deleted file mode 100644 index ffffe3d..0000000 --- a/datanodes/entity/CEntityOrientationDataNode.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#pragma pack(push, 4) -class CEntityOrientationDataNode -{ -public: - char pad_0x0[192]; //0x0000 - float m_eulers[11]; //0x00C0 -}; //Size: 0x00EC -static_assert(sizeof(CEntityOrientationDataNode) == 0xEC); -#pragma pack(pop) diff --git a/datanodes/entity/CEntityScriptGameStateDataNode.hpp b/datanodes/entity/CEntityScriptGameStateDataNode.hpp deleted file mode 100644 index 1567880..0000000 --- a/datanodes/entity/CEntityScriptGameStateDataNode.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -struct CEntityScriptGameStateDataNode -{ - char pad_0x0[192]; //0x0000 - bool m_visible; //0x00C0 - bool m_uses_collision; //0x00C1 - bool m_fixed; //0x00C2 -}; //Size: 0x00C3 -static_assert(sizeof(CEntityScriptGameStateDataNode) == 0xC3); \ No newline at end of file diff --git a/datanodes/ped/CPedInventoryDataNode.hpp b/datanodes/ped/CPedInventoryDataNode.hpp deleted file mode 100644 index 9ea8a8c..0000000 --- a/datanodes/ped/CPedInventoryDataNode.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include - -#pragma pack(push, 4) -class CPedInventoryDataNode -{ -public: - char pad_0000[5232]; - uint32_t m_items[105]; - uint32_t m_num_items; - uint32_t m_ammos[65]; - uint32_t m_ammo_quantities[65]; - uint32_t m_num_ammos; - uint8_t unk_1680[105]; - uint8_t unk_16E9[105]; - char pad_1680[1260]; - bool m_infinite_ammos[65]; - bool m_ammo_all_infinite; -}; -static_assert(sizeof(CPedInventoryDataNode) == 0x1E24); -#pragma pack(pop) \ No newline at end of file diff --git a/datanodes/ped/CPedOrientationDataNode.hpp b/datanodes/ped/CPedOrientationDataNode.hpp deleted file mode 100644 index e8c521e..0000000 --- a/datanodes/ped/CPedOrientationDataNode.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#pragma pack(push, 4) -class CPedOrientationDataNode -{ -public: - char gap0[192];//0x0000 - bool m_has_desired_heading_x;//0x00C1 - bool m_has_desired_heading_y;//0x00C2 - float m_desired_heading_x;//0x000C4 - float m_desired_heading_y;//0x000C8 -}; -static_assert(sizeof(CPedOrientationDataNode) == 0xCC); -#pragma pack(pop) diff --git a/datanodes/ped/CPedScriptCreationDataNode.hpp b/datanodes/ped/CPedScriptCreationDataNode.hpp deleted file mode 100644 index 3245205..0000000 --- a/datanodes/ped/CPedScriptCreationDataNode.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -class CPedScriptCreationDataNode -{ -public: - char pad_0x0[192]; //0x0000 - bool m_stay_in_car_when_jacked; //0x00C0 -}; //Size: 0x00C1 -static_assert(sizeof(CPedScriptCreationDataNode) == 0xC1); \ No newline at end of file diff --git a/datanodes/physical/CPhysicalHealthDataNode.hpp b/datanodes/physical/CPhysicalHealthDataNode.hpp deleted file mode 100644 index c1ce596..0000000 --- a/datanodes/physical/CPhysicalHealthDataNode.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include - -#pragma pack(push, 8) -struct CPhysicalHealthDataNode -{ - char pad_0000[192]; //0x0000 - bool unk_00C0; //0x00C0 - bool m_has_max_health_changed; //0x00C1 - uint32_t m_max_health; //0x00C4 - uint32_t m_current_health; //0x00C8 - uint16_t m_weapon_damage_entity; //0x00CC - uint32_t m_weapon_damage_hash; //0x00D0 - uint64_t unk_00D8; //0x00D8 -}; -static_assert(sizeof(CPhysicalHealthDataNode) == 0xE0); -#pragma pack(pop) \ No newline at end of file diff --git a/netsync/CProjectBaseSyncDataNode.hpp b/netsync/CProjectBaseSyncDataNode.hpp new file mode 100644 index 0000000..920c11a --- /dev/null +++ b/netsync/CProjectBaseSyncDataNode.hpp @@ -0,0 +1,46 @@ +#pragma once +#include "netSyncDataNode.hpp" +#include "NodeCommonDataOperations.hpp" + +namespace rage +{ + class netSyncData; + class netObject; +} + +class CProjectBaseSyncDataNode : public rage::netSyncDataNode +{ +public: + virtual bool IsSyncNode() { return false; } // 0x50 + virtual bool _0x58() { return false; } // 0x58 + virtual bool IsGlobalFlags() { return false; } // 0x60 + virtual void DoPreCache(rage::netSyncData* data) {} // 0x68 + virtual std::uint8_t GetSyncFrequency(int index) { return 0; } // 0x70 + virtual int GetSyncInterval(int index) { return 0; } // 0x78 + virtual int GetBandwidthForPlayer(int player) { return 200; } // 0x80 (should always return 200) + virtual void _0x88(void*) {} // 0x88 + virtual bool _0x90(void*, void*, int, int, int) { return false; } // 0x90 + virtual int CalculateSize() { return 0; } // 0x98 need to verify later + virtual bool IsPreCacheDisabled() { return false; } // 0xA0 + virtual bool CanApply(rage::netObject* object) { return false; } // 0xA8 + virtual int GetPlayersInScope() { return -1; } // 0xB0 + virtual void DeserializeImpl() {} // 0xB8 need to verify later + virtual void SerializeImpl() {} // 0xC0 need to verify later + virtual int CalculateSize2() { return 0; } // 0xC8 + virtual int _0xD0() { return 0; } // 0xD0 calls NodeCommonDataOperations::Unk() + virtual void Log() {} // 0xD8 + virtual bool CanPreCache(int) { return false; } // 0xE0 arg is always zero afaik + virtual bool CanBeEmpty() { return false; } // 0xE8 + virtual bool IsEmpty() { return false; } // 0xF0 returns true if all data is default + virtual void SetEmpty() {} // 0xF8 sets all data to their default values + virtual void Log2() {} // 0x100 + virtual void ResetScriptData() {} // 0x108 + virtual bool _0x110() { return false; } // 0x110 + +private: + NodeCommonDataOperations m_common_data_operations; // 0xB0 this is generally invalidated by MoveCommonDataOpsVFT() +}; +static_assert(sizeof(CProjectBaseSyncDataNode) == 0xC0); + +class CSyncDataNodeFrequent : public CProjectBaseSyncDataNode {}; +class CSyncDataNodeInfrequent : public CProjectBaseSyncDataNode {}; \ No newline at end of file diff --git a/netsync/CProjectSyncTree.hpp b/netsync/CProjectSyncTree.hpp new file mode 100644 index 0000000..4751bbd --- /dev/null +++ b/netsync/CProjectSyncTree.hpp @@ -0,0 +1,10 @@ +#pragma once +#include "netSyncTree.hpp" + +class CProjectSyncTree : public rage::netSyncTree +{ + void* m_unk_data; + int m_unk_data_size; + char pad_04C4[4]; +}; +static_assert(sizeof(CProjectSyncTree) == 0x4C8); \ No newline at end of file diff --git a/netsync/NodeCommonDataOperations.hpp b/netsync/NodeCommonDataOperations.hpp new file mode 100644 index 0000000..ee5b642 --- /dev/null +++ b/netsync/NodeCommonDataOperations.hpp @@ -0,0 +1,23 @@ +#pragma once + +namespace rage +{ + class datBitBuffer; + class netSyncDataNode; +} + +class NodeCommonDataOperations +{ +public: + virtual ~NodeCommonDataOperations() = default; + virtual void ReadFromBuffer(rage::netSyncDataNode* node) {}; // 0x08 + virtual void WriteToBuffer(rage::netSyncDataNode* node) {}; // 0x10 + virtual void Unk() {}; // 0x18 + virtual int CalculateSize(rage::netSyncDataNode* node) { return 0; }; // 0x20 + virtual int CalculateSize2(rage::netSyncDataNode* node) { return 0; }; // 0x28 + virtual void LogSyncData(rage::netSyncDataNode* node) {}; // 0x30 + virtual void LogSyncData2(rage::netSyncDataNode* node) {}; // 0x38 + + rage::datBitBuffer* m_buffer; // 0x8 +}; +static_assert(sizeof(NodeCommonDataOperations) == 0x10); \ No newline at end of file diff --git a/rage/netSyncDataNodeBase.hpp b/netsync/netSyncDataNode.hpp similarity index 55% rename from rage/netSyncDataNodeBase.hpp rename to netsync/netSyncDataNode.hpp index f0cb2cf..485dc91 100644 --- a/rage/netSyncDataNodeBase.hpp +++ b/netsync/netSyncDataNode.hpp @@ -5,19 +5,19 @@ namespace rage { #pragma pack(push, 8) - class netSyncDataNodeBase : public netSyncNodeBase + class netSyncDataNode : public netSyncNodeBase { public: uint32_t flags; //0x40 uint32_t pad3; //0x44 uint64_t pad4; //0x48 - netSyncDataNodeBase* parentData; //0x50 + netSyncDataNode* parentData; //0x50 uint32_t childCount; //0x58 - netSyncDataNodeBase* children[8]; //0x5C + netSyncDataNode* children[8]; //0x5C uint8_t syncFrequencies[8]; //0x9C - void* nodeBuffer; //0xA4 + void* commonDataOpsVFT; //0xA8 wtf }; - static_assert(sizeof(netSyncDataNodeBase) == 0xB0); + static_assert(sizeof(netSyncDataNode) == 0xB0); #pragma pack(pop) } \ No newline at end of file diff --git a/netsync/netSyncNodeBase.hpp b/netsync/netSyncNodeBase.hpp new file mode 100644 index 0000000..a4b55a1 --- /dev/null +++ b/netsync/netSyncNodeBase.hpp @@ -0,0 +1,39 @@ +#pragma once + +#include + +namespace rage +{ + class datBitBuffer; + +#pragma pack(push, 8) + class netSyncNodeBase + { + public: + virtual ~netSyncNodeBase() = default; // 0x00 + virtual bool IsDataNode() { return false; }; // 0x08 + virtual bool IsParentNode() { return false; }; // 0x10 + virtual void MoveCommonDataOpsVFT() {}; // 0x18 + virtual void ClearChildren() {}; // 0x20 + virtual void _0x28(void*, void*, void*, int* out_count) {}; // 0x28 + virtual bool Serialize(int flags, int flags2, void*, rage::datBitBuffer* buffer, int, void*, bool, int*, int* num_serialized) { return false; } // 0x30 + virtual bool Deserialize(int flags, int flags2, rage::datBitBuffer* buffer, void*) { return false; } // 0x38 + virtual int CalculateSize(int flags, int flags2, void*) { return 0; } // 0x40 + virtual int CalculateSize2(int flags, int flags2, bool) { return 0; } // 0x48 + + netSyncNodeBase* m_next_sibling; //0x0008 + netSyncNodeBase* m_prev_sibling; //0x0010 + netSyncNodeBase* m_root; //0x0018 + netSyncNodeBase* m_parent; //0x0020 + + uint32_t m_flags1; //0x0028 + uint32_t m_flags2; //0x002C + uint32_t m_flags3; //0x0030 + + uint32_t m_pad2; //0x0034 + + netSyncNodeBase* m_first_child; //0x0038 + }; //Size: 0x0040 + static_assert(sizeof(netSyncNodeBase) == 0x40); +#pragma pack(pop) +} \ No newline at end of file diff --git a/netsync/netSyncParentNode.hpp b/netsync/netSyncParentNode.hpp new file mode 100644 index 0000000..ec0935a --- /dev/null +++ b/netsync/netSyncParentNode.hpp @@ -0,0 +1,14 @@ +#pragma once +#include "netSyncNodeBase.hpp" + +namespace rage +{ + class netSyncParentNode : public netSyncNodeBase + { + public: + char pad_0040[32]; + }; + static_assert(sizeof(netSyncParentNode) == 0x60); +} + +class CProjectBaseSyncParentNode : public rage::netSyncParentNode {}; \ No newline at end of file diff --git a/netsync/netSyncTree.hpp b/netsync/netSyncTree.hpp new file mode 100644 index 0000000..e7dc492 --- /dev/null +++ b/netsync/netSyncTree.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include "netSyncNodeBase.hpp" + +namespace rage +{ +#pragma pack(push, 1) + class netSyncTree + { + public: + virtual ~netSyncTree() = default; + + char pad_0008[8]; //0x0008 + netSyncNodeBase* m_next_sync_node; //0x0010 + netSyncNodeBase* m_last_sync_node; //0x0018 + uint32_t m_child_node_count; //0x0020 + uint32_t m_unk_array_count; //0x0024 + char pad_0028[8]; //0x0028 + netSyncNodeBase* m_child_nodes[42]; //0x0030 + uint32_t m_child_node_max_count; //0x0180 + netSyncNodeBase* m_unk_array[32]; //0x0188 + uint32_t m_unk_array_max_count; //0x0288 + char pad_0290[560]; //0x0290 + }; //Size: 0x0030 + static_assert(sizeof(netSyncTree) == 0x4B8); +#pragma pack(pop) +} \ No newline at end of file diff --git a/datanodes/CPedComponents.hpp b/netsync/nodes/CPedComponents.hpp similarity index 100% rename from datanodes/CPedComponents.hpp rename to netsync/nodes/CPedComponents.hpp diff --git a/netsync/nodes/automobile/CAutomobileCreationNode.hpp b/netsync/nodes/automobile/CAutomobileCreationNode.hpp new file mode 100644 index 0000000..e486882 --- /dev/null +++ b/netsync/nodes/automobile/CAutomobileCreationNode.hpp @@ -0,0 +1,10 @@ +#pragma once +#include "netsync/CProjectBaseSyncDataNode.hpp" + +class CAutomobileCreationDataNode : CProjectBaseSyncDataNode +{ +public: + bool m_all_doors_closed; //0x00C0 + bool m_door_closed[10]; //0x00C1 +}; +static_assert(sizeof(CAutomobileCreationDataNode) == 0xD0); \ No newline at end of file diff --git a/datanodes/door/CDoorCreationDataNode.hpp b/netsync/nodes/door/CDoorCreationDataNode.hpp similarity index 72% rename from datanodes/door/CDoorCreationDataNode.hpp rename to netsync/nodes/door/CDoorCreationDataNode.hpp index 585a09b..8600a9a 100644 --- a/datanodes/door/CDoorCreationDataNode.hpp +++ b/netsync/nodes/door/CDoorCreationDataNode.hpp @@ -1,13 +1,12 @@ #pragma once - #include -#include "../../rage/vector.hpp" +#include "rage/vector.hpp" +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push, 4) -class CDoorCreationDataNode +class CDoorCreationDataNode : CProjectBaseSyncDataNode { public: - char pad_0000[192]; //0x0000 uint32_t m_model; //0x00C0 char pad_00C4[12]; //0x00C4 rage::fvector3 m_pos; //0x00D0 diff --git a/netsync/nodes/door/CDoorMovementDataNode.hpp b/netsync/nodes/door/CDoorMovementDataNode.hpp new file mode 100644 index 0000000..739a0ec --- /dev/null +++ b/netsync/nodes/door/CDoorMovementDataNode.hpp @@ -0,0 +1,17 @@ +#pragma once +#include +#include "rage/vector.hpp" +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +class CDoorMovementDataNode : CSyncDataNodeFrequent +{ +public: + bool m_is_manual_door; // 0xC0 + float m_open_ratio; // 0xC4 + bool m_opening; // 0xC8 + bool m_fully_open; // 0xC9 + bool m_closed; // 0xCA +}; +static_assert(sizeof(CDoorMovementDataNode) == 0xCC); +#pragma pack(pop) diff --git a/netsync/nodes/door/CDoorScriptGameStateDataNode.hpp b/netsync/nodes/door/CDoorScriptGameStateDataNode.hpp new file mode 100644 index 0000000..d1b4a60 --- /dev/null +++ b/netsync/nodes/door/CDoorScriptGameStateDataNode.hpp @@ -0,0 +1,18 @@ +#pragma once +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +struct CDoorScriptGameStateDataNode : CSyncDataNodeInfrequent +{ +public: + uint32_t m_door_system_state; // 0xC0 + float m_automatic_distance; // 0xC4 + float m_slide_rate; // 0xC8 + bool m_has_broken_flags; // 0xCC + uint32_t m_broken_flags; // 0xD0 + bool m_has_damaged_flags; // 0xD4 + uint32_t m_damaged_flags; // 0xD8 + bool m_hold_open; // 0xDC +}; +static_assert(sizeof(CDoorScriptGameStateDataNode) == 0xE0); +#pragma pack(pop) \ No newline at end of file diff --git a/netsync/nodes/door/CDoorScriptInfoDataNode.hpp b/netsync/nodes/door/CDoorScriptInfoDataNode.hpp new file mode 100644 index 0000000..44cf2f8 --- /dev/null +++ b/netsync/nodes/door/CDoorScriptInfoDataNode.hpp @@ -0,0 +1,16 @@ +#pragma once +#include "netsync/CProjectBaseSyncDataNode.hpp" +#include "script/CGameScriptObjInfo.hpp" + +#pragma pack(push, 4) +struct CDoorScriptInfoDataNode : CSyncDataNodeInfrequent +{ +public: + bool m_has_script_info; + int m_pad; + CGameScriptObjInfo m_script_info; + uint32_t m_door_system_hash; + bool m_existing_door_system_entry; +}; +static_assert(sizeof(CDoorScriptInfoDataNode) == 0x120); +#pragma pack(pop) \ No newline at end of file diff --git a/netsync/nodes/entity/CEntityOrientationDataNode.hpp b/netsync/nodes/entity/CEntityOrientationDataNode.hpp new file mode 100644 index 0000000..9f1c4f0 --- /dev/null +++ b/netsync/nodes/entity/CEntityOrientationDataNode.hpp @@ -0,0 +1,11 @@ +#pragma once +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +class CEntityOrientationDataNode : CSyncDataNodeFrequent +{ +public: + rage::fmatrix44 m_eulers; +}; //Size: 0x00EC +static_assert(sizeof(CEntityOrientationDataNode) == 0x100); +#pragma pack(pop) diff --git a/netsync/nodes/entity/CEntityScriptGameStateDataNode.hpp b/netsync/nodes/entity/CEntityScriptGameStateDataNode.hpp new file mode 100644 index 0000000..7616b61 --- /dev/null +++ b/netsync/nodes/entity/CEntityScriptGameStateDataNode.hpp @@ -0,0 +1,12 @@ +#pragma once +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +struct CEntityScriptGameStateDataNode : CSyncDataNodeInfrequent +{ + bool m_visible; //0x00C0 + bool m_uses_collision; //0x00C1 + bool m_fixed; //0x00C2 +}; //Size: 0x00C3 +static_assert(sizeof(CEntityScriptGameStateDataNode) == 0xC4); +#pragma pack(pop) \ No newline at end of file diff --git a/netsync/nodes/entity/CEntityScriptInfoDataNode.hpp b/netsync/nodes/entity/CEntityScriptInfoDataNode.hpp new file mode 100644 index 0000000..0e39858 --- /dev/null +++ b/netsync/nodes/entity/CEntityScriptInfoDataNode.hpp @@ -0,0 +1,14 @@ +#pragma once +#include "netsync/CProjectBaseSyncDataNode.hpp" +#include "script/CGameScriptObjInfo.hpp" + +#pragma pack(push, 4) +struct CEntityScriptInfoDataNode : CSyncDataNodeInfrequent +{ +public: + bool m_has_script_info; + int m_pad; + CGameScriptObjInfo m_script_info; +}; +static_assert(sizeof(CEntityScriptInfoDataNode) == 0x118); +#pragma pack(pop) \ No newline at end of file diff --git a/datanodes/object/CObjectCreationDataNode.hpp b/netsync/nodes/object/CObjectCreationDataNode.hpp similarity index 88% rename from datanodes/object/CObjectCreationDataNode.hpp rename to netsync/nodes/object/CObjectCreationDataNode.hpp index 84fbc7f..91a3d5d 100644 --- a/datanodes/object/CObjectCreationDataNode.hpp +++ b/netsync/nodes/object/CObjectCreationDataNode.hpp @@ -1,13 +1,12 @@ #pragma once - #include -#include "../../rage/vector.hpp" +#include "rage/vector.hpp" +#include "netsync/CProjectBaseSyncDataNode.hpp" -#pragma pack(push,8) -class CObjectCreationDataNode +#pragma pack(push, 4) +class CObjectCreationDataNode : CProjectBaseSyncDataNode { public: - char pad_0000[192]; //0x0000 uint16_t unk_00C0; //0x00C0 char pad_0xC2[14]; //0x00C2 rage::fvector4 m_object_orientation; //0x00D0 diff --git a/datanodes/ped/CPedAIDataNode.hpp b/netsync/nodes/ped/CPedAIDataNode.hpp similarity index 67% rename from datanodes/ped/CPedAIDataNode.hpp rename to netsync/nodes/ped/CPedAIDataNode.hpp index 2caa8e0..f008935 100644 --- a/datanodes/ped/CPedAIDataNode.hpp +++ b/netsync/nodes/ped/CPedAIDataNode.hpp @@ -1,11 +1,10 @@ #pragma once - #include +#include "netsync/CProjectBaseSyncDataNode.hpp" -class CPedAIDataNode +class CPedAIDataNode : CSyncDataNodeInfrequent { public: - char pad_0000[192]; //0x0000 uint32_t m_relationship_group; //0x00C0 uint32_t m_decision_maker_type; //0x00C4 }; //Size: 0x00C8 diff --git a/datanodes/ped/CPedAppearanceDataNode.hpp b/netsync/nodes/ped/CPedAppearanceDataNode.hpp similarity index 89% rename from datanodes/ped/CPedAppearanceDataNode.hpp rename to netsync/nodes/ped/CPedAppearanceDataNode.hpp index 94754ad..80338cc 100644 --- a/datanodes/ped/CPedAppearanceDataNode.hpp +++ b/netsync/nodes/ped/CPedAppearanceDataNode.hpp @@ -1,12 +1,11 @@ #pragma once - #include "../CPedComponents.hpp" +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push, 4) -class CPedAppearanceDataNode +class CPedAppearanceDataNode : CSyncDataNodeInfrequent { public: - char pad_0xB0[192]; //0xB0 uint32_t unk_0xC0[6]; //0xC0 uint32_t unk_0xD8[6]; //0xD8 class CPedComponents components; //0xF0 diff --git a/datanodes/ped/CPedAttachDataNode.hpp b/netsync/nodes/ped/CPedAttachDataNode.hpp similarity index 79% rename from datanodes/ped/CPedAttachDataNode.hpp rename to netsync/nodes/ped/CPedAttachDataNode.hpp index 694b632..4c8c087 100644 --- a/datanodes/ped/CPedAttachDataNode.hpp +++ b/netsync/nodes/ped/CPedAttachDataNode.hpp @@ -1,13 +1,12 @@ #pragma once - #include -#include "../../rage/vector.hpp" +#include "rage/vector.hpp" +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push,4) -class CPedAttachDataNode +class CPedAttachDataNode : CSyncDataNodeInfrequent { public: - char pad_0000[192]; //0x0000 rage::fvector3 m_offset; //0x00C0 char pad_00CC[4]; //0x00CC rage::fvector4 m_orientation; //0x00D0 diff --git a/netsync/nodes/ped/CPedComponentReservationDataNode.hpp b/netsync/nodes/ped/CPedComponentReservationDataNode.hpp new file mode 100644 index 0000000..ac12d1c --- /dev/null +++ b/netsync/nodes/ped/CPedComponentReservationDataNode.hpp @@ -0,0 +1,14 @@ +#pragma once +#include +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +class CPedComponentReservationDataNode : CSyncDataNodeInfrequent +{ +public: + uint32_t m_num_peds_using_component; //0x00C0 + uint16_t m_peds_using_component[32]; //0x00C4 +}; //Size: 0x00C8 +#pragma pack(pop) + +static_assert(sizeof(CPedComponentReservationDataNode) == 0x104); diff --git a/datanodes/ped/CPedCreationDataNode.hpp b/netsync/nodes/ped/CPedCreationDataNode.hpp similarity index 86% rename from datanodes/ped/CPedCreationDataNode.hpp rename to netsync/nodes/ped/CPedCreationDataNode.hpp index efc2a2e..dc8c9f3 100644 --- a/datanodes/ped/CPedCreationDataNode.hpp +++ b/netsync/nodes/ped/CPedCreationDataNode.hpp @@ -1,12 +1,11 @@ #pragma once - #include +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push,4) -class CPedCreationDataNode +class CPedCreationDataNode : CProjectBaseSyncDataNode { public: - char pad_0000[192]; //0x0000 uint32_t m_pop_type; //0x00C0 uint32_t m_model; //0x00C4 uint32_t m_random_seed; //0x00C8 diff --git a/datanodes/ped/CPedGameStateDataNode.hpp b/netsync/nodes/ped/CPedGameStateDataNode.hpp similarity index 95% rename from datanodes/ped/CPedGameStateDataNode.hpp rename to netsync/nodes/ped/CPedGameStateDataNode.hpp index 6d2015e..61f9cd3 100644 --- a/datanodes/ped/CPedGameStateDataNode.hpp +++ b/netsync/nodes/ped/CPedGameStateDataNode.hpp @@ -1,12 +1,11 @@ #pragma once - #include +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push,2) -class CPedGameStateDataNode +class CPedGameStateDataNode : CSyncDataNodeInfrequent { public: - char pad_0000[192]; //0x0000 bool m_weapon_component_something[11]; //0x0C0 uint32_t m_weapon_component_hash[11]; //0x0CC uint32_t m_gadget_hash[3]; //0x0F8 diff --git a/datanodes/ped/CPedHealthDataNode.hpp b/netsync/nodes/ped/CPedHealthDataNode.hpp similarity index 86% rename from datanodes/ped/CPedHealthDataNode.hpp rename to netsync/nodes/ped/CPedHealthDataNode.hpp index 41d16a0..2fe33ed 100644 --- a/datanodes/ped/CPedHealthDataNode.hpp +++ b/netsync/nodes/ped/CPedHealthDataNode.hpp @@ -1,12 +1,11 @@ #pragma once - +#include "netsync/CProjectBaseSyncDataNode.hpp" #include #pragma pack(push,2) -class CPedHealthDataNode +class CPedHealthDataNode : CSyncDataNodeInfrequent { public: - char pad_0000[192]; //0x0000 uint32_t unk_00C0; //0x00C0 uint32_t m_health; //0x00C4 uint32_t m_armor; //0x00C8 diff --git a/datanodes/ped/CPedMovementDataNode.hpp b/netsync/nodes/ped/CPedMovementDataNode.hpp similarity index 81% rename from datanodes/ped/CPedMovementDataNode.hpp rename to netsync/nodes/ped/CPedMovementDataNode.hpp index 99b56b4..ae545df 100644 --- a/datanodes/ped/CPedMovementDataNode.hpp +++ b/netsync/nodes/ped/CPedMovementDataNode.hpp @@ -1,9 +1,10 @@ #pragma once +#include "netsync/CProjectBaseSyncDataNode.hpp" + #pragma pack(push,4) -class CPedMovementDataNode +class CPedMovementDataNode : CSyncDataNodeFrequent { public: - char pad_0000[192]; //0x0000 bool m_has_desired_move_blend_ratio_x; //0x00C0 bool m_has_desired_move_blend_ratio_y; //0x00C1 bool unk_00C2; //0x00C2 diff --git a/netsync/nodes/ped/CPedOrientationDataNode.hpp b/netsync/nodes/ped/CPedOrientationDataNode.hpp new file mode 100644 index 0000000..c2e5cd0 --- /dev/null +++ b/netsync/nodes/ped/CPedOrientationDataNode.hpp @@ -0,0 +1,14 @@ +#pragma once +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +class CPedOrientationDataNode : CSyncDataNodeFrequent +{ +public: + bool m_has_desired_heading_x; //000C1 + bool m_has_desired_heading_y; //000C2 + float m_desired_heading_x; //0x00C4 + float m_desired_heading_y; //0x00C8 +}; +static_assert(sizeof(CPedOrientationDataNode) == 0xCC); +#pragma pack(pop) diff --git a/netsync/nodes/ped/CPedScriptCreationDataNode.hpp b/netsync/nodes/ped/CPedScriptCreationDataNode.hpp new file mode 100644 index 0000000..8d7e63e --- /dev/null +++ b/netsync/nodes/ped/CPedScriptCreationDataNode.hpp @@ -0,0 +1,11 @@ +#pragma once +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +class CPedScriptCreationDataNode : CProjectBaseSyncDataNode +{ +public: + bool m_stay_in_car_when_jacked; //0x00C0 +}; //Size: 0x00C1 +static_assert(sizeof(CPedScriptCreationDataNode) == 0xC4); +#pragma pack(pop) \ No newline at end of file diff --git a/datanodes/ped/CPedTaskSpecificDataNode.hpp b/netsync/nodes/ped/CPedTaskSpecificDataNode.hpp similarity index 69% rename from datanodes/ped/CPedTaskSpecificDataNode.hpp rename to netsync/nodes/ped/CPedTaskSpecificDataNode.hpp index 42db31a..4f4bb7f 100644 --- a/datanodes/ped/CPedTaskSpecificDataNode.hpp +++ b/netsync/nodes/ped/CPedTaskSpecificDataNode.hpp @@ -1,12 +1,11 @@ #pragma once - #include +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push,4) -class CPedTaskSpecificDataNode +class CPedTaskSpecificDataNode : CSyncDataNodeFrequent { -private: - char pad_0000[192]; //0x0000 +public: uint32_t m_task_index; //0x00C0 uint32_t m_task_type; //0x00C4 uint32_t m_buffer_size; //0x00C8 diff --git a/datanodes/physical/CPhysicalAngVelocityDataNode.hpp b/netsync/nodes/physical/CPhysicalAngVelocityDataNode.hpp similarity index 70% rename from datanodes/physical/CPhysicalAngVelocityDataNode.hpp rename to netsync/nodes/physical/CPhysicalAngVelocityDataNode.hpp index 0244ad2..74a115a 100644 --- a/datanodes/physical/CPhysicalAngVelocityDataNode.hpp +++ b/netsync/nodes/physical/CPhysicalAngVelocityDataNode.hpp @@ -1,15 +1,14 @@ #pragma once - #include +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push, 4) -class CPhysicalAngVelocityDataNode +class CPhysicalAngVelocityDataNode : CSyncDataNodeFrequent { public: - char pad_0000[192]; //0x0000 int32_t m_ang_velocity_x; //0x00C0 Divide by 16. int32_t m_ang_velocity_y; //0x00C4 Divide by 16. int32_t m_ang_velocity_z; //0x00C8 Divide by 16. }; // 0x00CC static_assert(sizeof(CPhysicalAngVelocityDataNode) == 0xCC); -#pragma pack(pop); \ No newline at end of file +#pragma pack(pop) diff --git a/datanodes/physical/CPhysicalAttachDataNode.hpp b/netsync/nodes/physical/CPhysicalAttachDataNode.hpp similarity index 86% rename from datanodes/physical/CPhysicalAttachDataNode.hpp rename to netsync/nodes/physical/CPhysicalAttachDataNode.hpp index c931a01..99a3180 100644 --- a/datanodes/physical/CPhysicalAttachDataNode.hpp +++ b/netsync/nodes/physical/CPhysicalAttachDataNode.hpp @@ -1,13 +1,12 @@ #pragma once - #include -#include "../../rage/vector.hpp" +#include "rage/vector.hpp" +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push,4) -class CPhysicalAttachDataNode +class CPhysicalAttachDataNode : CSyncDataNodeInfrequent { public: - char pad_0000[192]; //0x0000 bool m_attached; //0x00C0 bool unk_00C1; //0x00C1 uint16_t m_attached_to; //0x00C2 diff --git a/netsync/nodes/physical/CPhysicalMigrationDataNode.hpp b/netsync/nodes/physical/CPhysicalMigrationDataNode.hpp new file mode 100644 index 0000000..65a9259 --- /dev/null +++ b/netsync/nodes/physical/CPhysicalMigrationDataNode.hpp @@ -0,0 +1,12 @@ +#pragma once +#include +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +class CPhysicalMigrationDataNode : CProjectBaseSyncDataNode +{ +public: + bool m_unk; +}; +static_assert(sizeof(CPhysicalMigrationDataNode) == 0xC4); +#pragma pack(pop) \ No newline at end of file diff --git a/netsync/nodes/physical/CPhysicalScriptMigrationDataNode.hpp b/netsync/nodes/physical/CPhysicalScriptMigrationDataNode.hpp new file mode 100644 index 0000000..79aaa7f --- /dev/null +++ b/netsync/nodes/physical/CPhysicalScriptMigrationDataNode.hpp @@ -0,0 +1,14 @@ +#pragma once +#include +#include "netsync/CProjectBaseSyncDataNode.hpp" + +#pragma pack(push, 4) +class CPhysicalScriptMigrationDataNode : CProjectBaseSyncDataNode +{ +public: + bool m_has_data; // 0xC0 + int m_script_participants; // 0xC4 + uint16_t m_host_token; // 0xC8 +}; +static_assert(sizeof(CPhysicalScriptMigrationDataNode) == 0xCC); +#pragma pack(pop) \ No newline at end of file diff --git a/datanodes/physical/CPhysicalVelocityDataNode.hpp b/netsync/nodes/physical/CPhysicalVelocityDataNode.hpp similarity index 70% rename from datanodes/physical/CPhysicalVelocityDataNode.hpp rename to netsync/nodes/physical/CPhysicalVelocityDataNode.hpp index 4019c13..83ee8cb 100644 --- a/datanodes/physical/CPhysicalVelocityDataNode.hpp +++ b/netsync/nodes/physical/CPhysicalVelocityDataNode.hpp @@ -1,12 +1,11 @@ #pragma once - #include +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push, 4) -class CPhysicalVelocityDataNode +class CPhysicalVelocityDataNode : CSyncDataNodeFrequent { public: - char pad_0000[192]; //0x0000 int32_t m_velocity_x; //0x00C0 Divide by 16. int32_t m_velocity_y; //0x00C4 Divide by 16. int32_t m_velocity_z; //0x00C8 Divide by 16. diff --git a/datanodes/pickup/CPickupCreationDataNode.hpp b/netsync/nodes/pickup/CPickupCreationDataNode.hpp similarity index 76% rename from datanodes/pickup/CPickupCreationDataNode.hpp rename to netsync/nodes/pickup/CPickupCreationDataNode.hpp index 71a14d0..c2a00bc 100644 --- a/datanodes/pickup/CPickupCreationDataNode.hpp +++ b/netsync/nodes/pickup/CPickupCreationDataNode.hpp @@ -1,18 +1,15 @@ #pragma once - #include +#include "netsync/CProjectBaseSyncDataNode.hpp" +#include "script/CGameScriptObjInfo.hpp" #pragma pack(push, 8) -class CPickupCreationDataNode +class CPickupCreationDataNode : CProjectBaseSyncDataNode { public: - char pad_0000[192]; //0x0000 bool m_has_placement; //0x00C0 char pad_00C1[7]; //0x00C1 - uint64_t *unk_struct_00C8; //0x00C8 - uint32_t unk_00D0; //0x00D0 - uint16_t unk_00D4; //0x00D4 - char pad_00D6[66]; //0x00D6 + CGameScriptObjInfo m_script_object_info; //0x00C8 uint32_t m_pickup_hash; //0x0118 uint32_t m_amount; //0x011C uint32_t m_custom_model; //0x0120 diff --git a/datanodes/pickup_placement/CPickupPlacementCreationDataNode.hpp b/netsync/nodes/pickup_placement/CPickupPlacementCreationDataNode.hpp similarity index 81% rename from datanodes/pickup_placement/CPickupPlacementCreationDataNode.hpp rename to netsync/nodes/pickup_placement/CPickupPlacementCreationDataNode.hpp index 4b44534..7dab6ba 100644 --- a/datanodes/pickup_placement/CPickupPlacementCreationDataNode.hpp +++ b/netsync/nodes/pickup_placement/CPickupPlacementCreationDataNode.hpp @@ -1,13 +1,12 @@ #pragma once - #include -#include "../../rage/vector.hpp" +#include "rage/vector.hpp" +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push, 8) -class CPickupPlacementCreationDataNode +class CPickupPlacementCreationDataNode : CProjectBaseSyncDataNode { public: - char pad_0000[192]; //0x0000 bool m_has_pickup_data; //0x00C0 char pad_00C1[15]; //0x00C1 rage::fvector3 m_pickup_pos; //0x00D0 diff --git a/datanodes/player/CPlayerAppearanceDataNode.hpp b/netsync/nodes/player/CPlayerAppearanceDataNode.hpp similarity index 96% rename from datanodes/player/CPlayerAppearanceDataNode.hpp rename to netsync/nodes/player/CPlayerAppearanceDataNode.hpp index 49382ef..14d879b 100644 --- a/datanodes/player/CPlayerAppearanceDataNode.hpp +++ b/netsync/nodes/player/CPlayerAppearanceDataNode.hpp @@ -1,12 +1,11 @@ #pragma once - #include "../CPedComponents.hpp" +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push, 4) -class CPlayerAppearanceDataNode +class CPlayerAppearanceDataNode : CSyncDataNodeInfrequent { public: - char pad_0x0[192]; //0xB0 uint32_t unk_0xC0[56]; //0xC0 class CPedComponents components; //0x1A0 char pad_0x268[8]; //0x268 diff --git a/datanodes/player/CPlayerCameraDataNode.hpp b/netsync/nodes/player/CPlayerCameraDataNode.hpp similarity index 85% rename from datanodes/player/CPlayerCameraDataNode.hpp rename to netsync/nodes/player/CPlayerCameraDataNode.hpp index bdb7dc2..190b669 100644 --- a/datanodes/player/CPlayerCameraDataNode.hpp +++ b/netsync/nodes/player/CPlayerCameraDataNode.hpp @@ -1,11 +1,11 @@ #pragma once #include +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push, 4) -class CPlayerCameraDataNode +class CPlayerCameraDataNode : CSyncDataNodeFrequent { public: - char pad_0000[192]; //0x0000 float m_free_cam_pos_x; //0x00C0 float m_free_cam_pos_y; //0x00C4 float m_free_cam_pos_z; //0x00C8 diff --git a/datanodes/player/CPlayerCreationDataNode.hpp b/netsync/nodes/player/CPlayerCreationDataNode.hpp similarity index 76% rename from datanodes/player/CPlayerCreationDataNode.hpp rename to netsync/nodes/player/CPlayerCreationDataNode.hpp index e659647..cc430c2 100644 --- a/datanodes/player/CPlayerCreationDataNode.hpp +++ b/netsync/nodes/player/CPlayerCreationDataNode.hpp @@ -1,12 +1,11 @@ #pragma once - #include +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push,4) -class CPlayerCreationDataNode +class CPlayerCreationDataNode : CProjectBaseSyncDataNode { public: - char pad_0000[192]; //0x0000 uint32_t m_model; //0x00C0 uint32_t m_num_scars; //0x00C4 char unk_struct_0xC8[192]; //0x00C8 diff --git a/datanodes/player/CPlayerGameStateDataNode.hpp b/netsync/nodes/player/CPlayerGameStateDataNode.hpp similarity index 97% rename from datanodes/player/CPlayerGameStateDataNode.hpp rename to netsync/nodes/player/CPlayerGameStateDataNode.hpp index 0c0a71b..0e537c8 100644 --- a/datanodes/player/CPlayerGameStateDataNode.hpp +++ b/netsync/nodes/player/CPlayerGameStateDataNode.hpp @@ -1,12 +1,11 @@ #pragma once - #include +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push,4) -class CPlayerGameStateDataNode +class CPlayerGameStateDataNode : CSyncDataNodeInfrequent { public: - char pad_0000[192]; //0x0000 uint32_t m_player_state; //0x00C0 bool m_controls_disabled_by_script; //0x00C4 bool m_is_max_armor_and_health_default; //0x00C5 diff --git a/datanodes/player/CPlayerGamerDataNode.hpp b/netsync/nodes/player/CPlayerGamerDataNode.hpp similarity index 86% rename from datanodes/player/CPlayerGamerDataNode.hpp rename to netsync/nodes/player/CPlayerGamerDataNode.hpp index 1013d98..f0a353d 100644 --- a/datanodes/player/CPlayerGamerDataNode.hpp +++ b/netsync/nodes/player/CPlayerGamerDataNode.hpp @@ -1,13 +1,12 @@ #pragma once - #include -#include "../../network/ClanData.hpp" +#include "network/ClanData.hpp" +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push, 1) -class CPlayerGamerDataNode +class CPlayerGamerDataNode : CSyncDataNodeInfrequent { public: - char pad_0000[192]; //0x0000 ClanData m_clan_data; //0x00C0 bool m_need_crew_rank_sysflags; //0x0178 bool m_need_crew_rank_title; //0x0179 diff --git a/datanodes/player/CPlayerSectorPosNode.hpp b/netsync/nodes/player/CPlayerSectorPosNode.hpp similarity index 74% rename from datanodes/player/CPlayerSectorPosNode.hpp rename to netsync/nodes/player/CPlayerSectorPosNode.hpp index bfcaf61..b4608c0 100644 --- a/datanodes/player/CPlayerSectorPosNode.hpp +++ b/netsync/nodes/player/CPlayerSectorPosNode.hpp @@ -1,13 +1,12 @@ #pragma once - #include -#include "../../rage/vector.hpp" +#include "rage/vector.hpp" +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push,4) -class CPlayerSectorPosNode +class CPlayerSectorPosNode : CSyncDataNodeFrequent { public: - char pax_0000[192]; //0x0000 rage::fvector3 m_sector_pos; //0x00C0 bool m_is_standing_on_entity; //0x00CC bool unk_00CD; //0x00CD @@ -17,7 +16,7 @@ public: char pad_00D2[12]; //0x00D2 rage::fvector3 m_standing_on_entity_offset; //0x00E0 char pad_00EC[8]; //0x00EC - uint32_t m_stealth_noise; //0x00F4 + uint32_t m_stealth_noise; //0x00F4 }; //Size: 0x00F8 static_assert(sizeof(CPlayerSectorPosNode) == 0xF8); #pragma pack(pop) diff --git a/datanodes/proximity_migrateable/CGlobalFlagsDataNode.hpp b/netsync/nodes/proximity_migrateable/CGlobalFlagsDataNode.hpp similarity index 64% rename from datanodes/proximity_migrateable/CGlobalFlagsDataNode.hpp rename to netsync/nodes/proximity_migrateable/CGlobalFlagsDataNode.hpp index b69fe72..d72c5dc 100644 --- a/datanodes/proximity_migrateable/CGlobalFlagsDataNode.hpp +++ b/netsync/nodes/proximity_migrateable/CGlobalFlagsDataNode.hpp @@ -1,12 +1,11 @@ #pragma once - #include +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push, 4) -class CGlobalFlagsDataNode +class CGlobalFlagsDataNode : CSyncDataNodeInfrequent { public: - char pad_0000[192]; //0x0000 uint32_t m_global_flags; //0x00C0 uint32_t m_ownership_token; //0x00C4 }; //Size: 0x00C8 diff --git a/datanodes/proximity_migrateable/CMigrationDataNode.hpp b/netsync/nodes/proximity_migrateable/CMigrationDataNode.hpp similarity index 69% rename from datanodes/proximity_migrateable/CMigrationDataNode.hpp rename to netsync/nodes/proximity_migrateable/CMigrationDataNode.hpp index 7726c07..2dd2ef7 100644 --- a/datanodes/proximity_migrateable/CMigrationDataNode.hpp +++ b/netsync/nodes/proximity_migrateable/CMigrationDataNode.hpp @@ -1,12 +1,11 @@ #pragma once - #include +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push, 4) -class CMigrationDataNode +class CMigrationDataNode : CProjectBaseSyncDataNode { public: - char pad_0000[192]; //0x0000 uint32_t m_cloned_state; //0x00C0 uint32_t m_cloned_players_that_left; //0x00C4 uint32_t m_unsynced_nodes; //0x00C8 diff --git a/datanodes/proximity_migrateable/CSectorDataNode.hpp b/netsync/nodes/proximity_migrateable/CSectorDataNode.hpp similarity index 64% rename from datanodes/proximity_migrateable/CSectorDataNode.hpp rename to netsync/nodes/proximity_migrateable/CSectorDataNode.hpp index 4a60762..fd83204 100644 --- a/datanodes/proximity_migrateable/CSectorDataNode.hpp +++ b/netsync/nodes/proximity_migrateable/CSectorDataNode.hpp @@ -1,12 +1,11 @@ #pragma once - #include +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push, 2) -class CSectorDataNode +class CSectorDataNode : CSyncDataNodeFrequent { public: - char pad_0x0[192]; //0x0 uint16_t m_pos_x; //0xC0 uint16_t m_pos_y; //0xC2 uint16_t m_pos_z; //0xC4 diff --git a/datanodes/proximity_migrateable/CSectorPositionDataNode.hpp b/netsync/nodes/proximity_migrateable/CSectorPositionDataNode.hpp similarity index 65% rename from datanodes/proximity_migrateable/CSectorPositionDataNode.hpp rename to netsync/nodes/proximity_migrateable/CSectorPositionDataNode.hpp index 9f2529b..27ba243 100644 --- a/datanodes/proximity_migrateable/CSectorPositionDataNode.hpp +++ b/netsync/nodes/proximity_migrateable/CSectorPositionDataNode.hpp @@ -1,10 +1,10 @@ #pragma once +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push, 4) -class CSectorPositionDataNode +class CSectorPositionDataNode : CSyncDataNodeFrequent { public: - char pad_0000[192]; //0x0000 float m_sector_pos_x; //0x00C0 float m_sector_pos_y; //0x00C4 float m_sector_pos_z; //0x00C8 diff --git a/datanodes/task/CClonedGeneralSweepInfo.hpp b/netsync/nodes/task/CClonedGeneralSweepInfo.hpp similarity index 100% rename from datanodes/task/CClonedGeneralSweepInfo.hpp rename to netsync/nodes/task/CClonedGeneralSweepInfo.hpp diff --git a/datanodes/task/ClonedTakeOffPedVariationInfo.hpp b/netsync/nodes/task/ClonedTakeOffPedVariationInfo.hpp similarity index 96% rename from datanodes/task/ClonedTakeOffPedVariationInfo.hpp rename to netsync/nodes/task/ClonedTakeOffPedVariationInfo.hpp index 74b2ea7..1363566 100644 --- a/datanodes/task/ClonedTakeOffPedVariationInfo.hpp +++ b/netsync/nodes/task/ClonedTakeOffPedVariationInfo.hpp @@ -1,7 +1,7 @@ #pragma once #include -#include "../../rage/vector.hpp" +#include "rage/vector.hpp" #pragma pack(push, 1) class ClonedTakeOffPedVariationInfo diff --git a/datanodes/train/CTrainGameStateDataNode.hpp b/netsync/nodes/train/CTrainGameStateDataNode.hpp similarity index 87% rename from datanodes/train/CTrainGameStateDataNode.hpp rename to netsync/nodes/train/CTrainGameStateDataNode.hpp index d8507b5..6d1fba2 100644 --- a/datanodes/train/CTrainGameStateDataNode.hpp +++ b/netsync/nodes/train/CTrainGameStateDataNode.hpp @@ -1,12 +1,11 @@ #pragma once - #include +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push,4) -class CTrainGameStateDataNode +class CTrainGameStateDataNode : CSyncDataNodeInfrequent { public: - char pad_0000[192]; //0x0000 bool m_is_engine; //0x00C0 bool m_is_caboose; //0x00C1 bool m_is_mission_train; //0x00C2 diff --git a/datanodes/vehicle/CVehicleCreationDataNode.hpp b/netsync/nodes/vehicle/CVehicleCreationDataNode.hpp similarity index 80% rename from datanodes/vehicle/CVehicleCreationDataNode.hpp rename to netsync/nodes/vehicle/CVehicleCreationDataNode.hpp index 8931986..c654271 100644 --- a/datanodes/vehicle/CVehicleCreationDataNode.hpp +++ b/netsync/nodes/vehicle/CVehicleCreationDataNode.hpp @@ -1,12 +1,11 @@ #pragma once - #include +#include "netsync/CProjectBaseSyncDataNode.hpp" #pragma pack(push,4) -class CVehicleCreationDataNode +class CVehicleCreationDataNode : CProjectBaseSyncDataNode { public: - char pad_0000[192]; //0x00B0 uint32_t m_pop_type; //0x00C0 uint32_t m_random_seed; //0x00C4 uint32_t m_model; //0x00C8 diff --git a/datanodes/vehicle/CVehicleGadgetDataNode.hpp b/netsync/nodes/vehicle/CVehicleGadgetDataNode.hpp similarity index 87% rename from datanodes/vehicle/CVehicleGadgetDataNode.hpp rename to netsync/nodes/vehicle/CVehicleGadgetDataNode.hpp index c0ea42b..73b4cd3 100644 --- a/datanodes/vehicle/CVehicleGadgetDataNode.hpp +++ b/netsync/nodes/vehicle/CVehicleGadgetDataNode.hpp @@ -1,6 +1,6 @@ #pragma once - #include +#include "netsync/CProjectBaseSyncDataNode.hpp" enum eVehicleGadgetType : uint32_t { @@ -22,10 +22,9 @@ public: }; //Size: 0x64 static_assert(sizeof(CVehicleGadgetData) == 0x64); -class CVehicleGadgetDataNode +class CVehicleGadgetDataNode : CSyncDataNodeFrequent { public: - char pad_0000[192]; //0x0000 bool m_has_parent_offset; //0x00C0 char pad_00C1[15]; //0x00C1 uint32_t m_parent_offset_x; //0x00D0 diff --git a/netsync/trees/CDynamicEntitySyncTreeBase.hpp b/netsync/trees/CDynamicEntitySyncTreeBase.hpp new file mode 100644 index 0000000..f1d696d --- /dev/null +++ b/netsync/trees/CDynamicEntitySyncTreeBase.hpp @@ -0,0 +1,12 @@ +#pragma once +#include "CEntitySyncTreeBase.hpp" +#include "netsync/netSyncParentNode.hpp" + +#include "netsync/nodes/dynamic_entity/CDynamicEntityGameStateDataNode.hpp" + +class CDynamicEntitySyncTreeBase : public CEntitySyncTreeBase +{ +public: + char m_dynamic_entity_game_state_data_node[0xE28 - 0xCD8]; +}; +static_assert(sizeof(CDynamicEntitySyncTreeBase) == 0xE28); \ No newline at end of file diff --git a/netsync/trees/CEntitySyncTreeBase.hpp b/netsync/trees/CEntitySyncTreeBase.hpp new file mode 100644 index 0000000..45ced73 --- /dev/null +++ b/netsync/trees/CEntitySyncTreeBase.hpp @@ -0,0 +1,15 @@ +#pragma once +#include "CProximityMigrateableSyncTreeBase.hpp" +#include "netsync/netSyncParentNode.hpp" + +#include "netsync/nodes/entity/CEntityScriptInfoDataNode.hpp" +#include "netsync/nodes/entity/CEntityScriptGameStateDataNode.hpp" + +class CEntitySyncTreeBase : public CProximityMigrateableSyncTreeBase +{ +public: + CProjectBaseSyncParentNode m_parent_node_4[5]; + CEntityScriptInfoDataNode m_entity_script_info_data_node; + CEntityScriptGameStateDataNode m_entity_script_game_state_data_node; +}; +static_assert(sizeof(CEntitySyncTreeBase) == 0xCD8); \ No newline at end of file diff --git a/netsync/trees/CPhysicalSyncTreeBase.hpp b/netsync/trees/CPhysicalSyncTreeBase.hpp new file mode 100644 index 0000000..69854f3 --- /dev/null +++ b/netsync/trees/CPhysicalSyncTreeBase.hpp @@ -0,0 +1,29 @@ +#pragma once +#include "CEntitySyncTreeBase.hpp" +#include "netsync/netSyncParentNode.hpp" + +#include "netsync/nodes/physical/CPhysicalMigrationDataNode.hpp" +#include "netsync/nodes/physical/CPhysicalScriptMigrationDataNode.hpp" +#include "netsync/nodes/entity/CEntityOrientationDataNode.hpp" +#include "netsync/nodes/physical/CPhysicalVelocityDataNode.hpp" +#include "netsync/nodes/physical/CPhysicalAngVelocityDataNode.hpp" +#include "netsync/nodes/physical/CPhysicalHealthDataNode.hpp" +#include "netsync/nodes/physical/CPhysicalAttachDataNode.hpp" + +class CPhysicalSyncTreeBase : public CDynamicEntitySyncTreeBase +{ +public: + CPhysicalMigrationDataNode m_physical_migration_data_node; + CPhysicalScriptMigrationDataNode m_physical_script_migration_data_node; + char pad_0FB8[8]; + CEntityOrientationDataNode m_entity_orientation_data_node; + CPhysicalVelocityDataNode m_physical_velocity_data_node; + CPhysicalAngVelocityDataNode m_physical_angular_velocity_data_node; + char pad_1258[8]; + CPhysicalHealthDataNode m_physical_health_data_node; + CPhysicalAttachDataNode m_physical_attach_data_node; + char pad_1458[8]; + char m_physical_game_state_data_node[0x1530 - 0x1460]; // TODO + char m_physical_script_game_state_data_node[0x1620 - 0x1530]; // TODO +}; +static_assert(sizeof(CPhysicalSyncTreeBase) == 0x1620); \ No newline at end of file diff --git a/netsync/trees/CProximityMigrateableSyncTreeBase.hpp b/netsync/trees/CProximityMigrateableSyncTreeBase.hpp new file mode 100644 index 0000000..38b525d --- /dev/null +++ b/netsync/trees/CProximityMigrateableSyncTreeBase.hpp @@ -0,0 +1,22 @@ +#pragma once +#include "netsync/CProjectSyncTree.hpp" +#include "netsync/netSyncParentNode.hpp" + +#include "netsync/nodes/proximity_migrateable/CMigrationDataNode.hpp" +#include "netsync/nodes/proximity_migrateable/CGlobalFlagsDataNode.hpp" +#include "netsync/nodes/proximity_migrateable/CSectorDataNode.hpp" +#include "netsync/nodes/proximity_migrateable/CSectorPositionDataNode.hpp" + +class CProximityMigrateableSyncTreeBase : public CProjectSyncTree +{ +public: + CProjectBaseSyncParentNode m_parent_node_1; + CProjectBaseSyncParentNode m_parent_node_2; + CProjectBaseSyncParentNode m_parent_node_3; + CMigrationDataNode m_migration_data_node; + CGlobalFlagsDataNode m_global_flags_data_node; + CSectorDataNode m_sector_data_node; + CSectorPositionDataNode m_sector_position_data_node; + char pad_0910[8]; +}; +static_assert(sizeof(CProximityMigrateableSyncTreeBase) == 0x918); \ No newline at end of file diff --git a/network/Network.hpp b/network/Network.hpp index 4da18a5..81f1eee 100644 --- a/network/Network.hpp +++ b/network/Network.hpp @@ -36,7 +36,7 @@ public: m_param_values[index] = value; m_enabled_params_bitset |= (1 << index); - if (m_num_parameters <= index) + if (m_num_parameters <= (uint32_t)index) m_num_parameters++; } diff --git a/network/netObject.hpp b/network/netObject.hpp index e568b5b..08f4467 100644 --- a/network/netObject.hpp +++ b/network/netObject.hpp @@ -1,7 +1,7 @@ #pragma once #include -#include "../rage/netSyncTree.hpp" +#include "../netsync/netSyncTree.hpp" #include "../base/atRTTI.hpp" class CObject; diff --git a/rage/netSyncNodeBase.hpp b/rage/netSyncNodeBase.hpp deleted file mode 100644 index e102135..0000000 --- a/rage/netSyncNodeBase.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#include - -namespace rage -{ -#pragma pack(push, 8) - class netSyncNodeBase - { - public: - virtual ~netSyncNodeBase() = 0; - virtual bool IsDataNode() = 0; - virtual bool IsParentNode() = 0; - - netSyncNodeBase* m_next_sibling; //0x0000 - netSyncNodeBase* m_prev_sibling; //0x0008 - netSyncNodeBase* m_root; //0x0010 - netSyncNodeBase* m_parent; //0x0018 - - uint32_t m_flags1; //0x0020 - uint32_t m_flags2; //0x0024 - uint32_t m_flags3; //0x0028 - - uint32_t m_pad2; //0x002C - - netSyncNodeBase* m_first_child; //0x0030 - }; //Size: 0x0040 - static_assert(sizeof(netSyncNodeBase) == 0x40); -#pragma pack(pop) -} \ No newline at end of file diff --git a/rage/netSyncTree.hpp b/rage/netSyncTree.hpp deleted file mode 100644 index 20e0ca2..0000000 --- a/rage/netSyncTree.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "netSyncNodeBase.hpp" - -namespace rage -{ -#pragma pack(push,8) - class netSyncTree - { - public: - virtual ~netSyncTree(); - - char pad_0008[8]; //0x0008 - netSyncNodeBase* m_next_sync_node; //0x0010 - netSyncNodeBase* m_last_sync_node; //0x0018 - uint32_t m_child_node_count; //0x0020 - uint32_t m_unk_array_count; //0x0024 - char pad_0028[8]; //0x0028 - netSyncNodeBase* m_child_nodes[42]; //0x0030 - uint32_t m_child_node_max_count; //0x0180 - netSyncNodeBase* m_unk_array[32]; //0x0188 - uint32_t m_unk_array_max_count; //0x0288 - }; //Size: 0x0290 - static_assert(sizeof(netSyncTree) == 0x290); -#pragma pack(pop) -} \ No newline at end of file diff --git a/script/CGameScriptObjInfo.hpp b/script/CGameScriptObjInfo.hpp new file mode 100644 index 0000000..b2b5074 --- /dev/null +++ b/script/CGameScriptObjInfo.hpp @@ -0,0 +1,16 @@ +#pragma once +#include "scriptId.hpp" +#include "types.hpp" + +#pragma pack(push, 4) +class CGameScriptObjInfo +{ +public: + virtual ~CGameScriptObjInfo() = default; + + ScrHandle m_local_handle; // 0x8 + uint16_t m_network_handle; // 0xC + CGameScriptId m_script_id; // 0x10 +}; +static_assert(sizeof(CGameScriptObjInfo) == 0x50); +#pragma pack(pop) \ No newline at end of file diff --git a/script/MPScriptData.hpp b/script/MPScriptData.hpp new file mode 100644 index 0000000..c9d22fb --- /dev/null +++ b/script/MPScriptData.hpp @@ -0,0 +1,11 @@ +#pragma once +#include "types.hpp" + +struct MP_SCRIPT_DATA +{ + SCR_INT Index; // this is an enum + uint64_t Args[15]; + SCR_INT InstanceId; + uint64_t MoreArgs[4]; +}; +static_assert(sizeof(MP_SCRIPT_DATA) == 21 * 8); \ No newline at end of file diff --git a/script/globals/GPBD_FM.hpp b/script/globals/GPBD_FM.hpp index df9fb13..49e316b 100644 --- a/script/globals/GPBD_FM.hpp +++ b/script/globals/GPBD_FM.hpp @@ -1,6 +1,7 @@ #pragma once #include "../types.hpp" #include "../Timer.hpp" +#include "../MPScriptData.hpp" enum class eMissionDataFlags { @@ -138,20 +139,6 @@ struct PLAYLIST_DATA }; static_assert(sizeof(PLAYLIST_DATA) == 6 * 8); -struct MISSION_DATA -{ - SCR_INT PAD_0000; // unused - SCR_INT ScriptId; // TODO: add enum - SCR_INT InstanceId; - uint64_t PAD_0003[7]; // unused - SCR_VEC3 TriggerPosition; - uint64_t PAD_0013[3]; // unused - SCR_INT InstanceIdForPresence; - SCR_INT PAD_0017; // unused - SCR_BITSET Flags; -}; -static_assert(sizeof(MISSION_DATA) == 19 * 8); - // local copy can be found at Global_2680247 struct JOB_SETTINGS { @@ -493,7 +480,7 @@ struct PROPERTY_DATA SCR_INT TotalBunkerResearch; SCR_INT CurrentBunkerResearchProgress; SCR_INT BunkerDecorVariation; - SCR_INT PAD_0288; + SCR_INT MOCBitset; SCR_INT MOCColor; // bitset for some reason uint64_t PAD_0290[2]; // unused SCR_INT GunShopFlags; @@ -583,8 +570,7 @@ struct GPBD_FM_Entry PLAYLIST_DATA PlaylistData; TEXT_LABEL_63 JobName; SCR_ARRAY ActiveGunRange; // this should have really been an enum lol - MISSION_DATA MissionData; - uint64_t PAD_0055[2]; // unused + MP_SCRIPT_DATA MissionScriptData; JOB_SETTINGS JobSettings; SCR_INT FMMCLauncherState; VEHICLE_SELECTION VehicleSelection; @@ -626,7 +612,7 @@ struct GPBD_FM_Entry SCR_INT UNK_0799; SCR_INT GangAttackTarget; // triggers unique dialog from some phone NPCs SCR_INT ActivePVSlot; - PLAYER_INDEX PAD_0802; + PLAYER_INDEX SpectatingPlayer; SCR_INT PAD_0803; SCR_ARRAY ActiveAmbientWeaponPickups; SCR_ARRAY OfficeMapMarkers; diff --git a/script/globals/GPBD_FM_3.hpp b/script/globals/GPBD_FM_3.hpp index be0ac63..e207326 100644 --- a/script/globals/GPBD_FM_3.hpp +++ b/script/globals/GPBD_FM_3.hpp @@ -2,6 +2,7 @@ #include "../types.hpp" #include "../Timer.hpp" #include "../HudColor.hpp" +#include "../MPScriptData.hpp" enum class eActivityType { @@ -104,15 +105,6 @@ enum class eClubhouseActivity ARM_WRESTLING }; -struct MP_SCRIPT_DATA -{ - SCR_INT Index; // this is an enum - uint64_t Args[15]; - SCR_INT InstanceId; - uint64_t MoreArgs[4]; -}; -static_assert(sizeof(MP_SCRIPT_DATA) == 21 * 8); - struct MC_STYLE { SCR_BOOL Enabled; diff --git a/script/globals/GlobalPlayerBD.hpp b/script/globals/GlobalPlayerBD.hpp index 93764af..0baadda 100644 --- a/script/globals/GlobalPlayerBD.hpp +++ b/script/globals/GlobalPlayerBD.hpp @@ -1,5 +1,6 @@ #pragma once #include "../types.hpp" +#include "../MPScriptData.hpp" enum class eFreemodeState { @@ -33,28 +34,131 @@ enum class eAnimationBitset enum class eBlipFlags { + // 0 is unused kVisibleOnCutscene = 1, kFlashMinimapDisplay = 2, + kFlashBlip = 3, + kMicroLightOTRActive = 4, kSkipTutorialSessionChecks = 5, kHideOnMinimap = 6, // needs testing - kHideOnMinimapWhenInterior = 6, // needs testing + kHideOnMinimapWhenInterior = 7, // needs testing kHideOnMinimapWhenBigMapActive = 9, // needs testing kDontUsePassiveBlip = 21, kUseRampageBlip = 24, kHideWhenFading = 25 }; +enum class eBlipType +{ + ON_FOOT, + TANK, + PLAYER_JET, + PLAYER_PLANE, + PLAYER_HELI, + PLAYER_GUNCAR, + PLAYER_BOAT, + ROCKET_VOLTIC, + TECHNICAL, + RUINER_2000, + DUNE_BUGGY, + PHANTOM_WEDGE, + ARMORED_BOXVILLE, // boxville5 + WASTELANDER, + QUAD, + APC, + OPPRESSOR_MK_1, + HALF_TRACK, + DUNE_FAV, + WEAPONIZED_TAMPA, + AA_TRAILER, + ALPHA_Z1, + BOMBUSHKA, + HAVOK, + HOWARD, + HUNTER, + MICROLIGHT, + MOGUL, + MOLOTOK, + NOKOTA, + PYRO, + ROGUE, + STARLING, + SEABREEZE, + TULA, + STROMBERG, + DELUXO, + THRUSTER, + KHANJALI, + RIOT_VAN, + VOLATOL, + BARRAGE, + AKULA, + CHERNOBOG, + AVENGER, + TURRETED_LIMO, + SEA_SPARROW, + CARACARA, + PARTY_BUS, + TERRORBYTE, + MENACER, + SCRAMJET, + POUNDER_CUSTOM, + MULE_CUSTOM, + SPEEDO_CUSTOM, + OPPRESSOR_MK_2, + STRIKEFORCE, + ARENA_BRUISER, + ARENA_BRUTUS, + ARENA_CERBERUS, + ARENA_DEATHBIKE, + ARENA_DOMINATOR, + ARENA_IMPALER, + ARENA_IMPERATOR, + ARENA_ISSI, + ARENA_SASQUATCH, + ARENA_SCARAB, + ARENA_SLAMVAN, + ARENA_ZR380, + MINI_SUB, + SPARROW, + FOLDING_WING_JET, + GANG_BIKE, + MILITARY_QUAD, + SQUADDIE, // SQUADEE + CAYO_DINGHY, + WINKY, + PATROL_BOAT, + ANNIHILATOR, + KART_RETRO, + KART_MODERN, + MILITARY_TRUCK, + SUBMARINE, + CHAMPION, + BUFFALO_STX, + DEITY, // why does this have a blip? + JUBILEE, + GRANGER_3600LX, + PATRIOT_MILSPEC, + ARMS_DEALING_AIR, // requires some flag to be set + BRICKADE_6X6 +}; + enum class ePlayerStateFlags { kScreenFadingOut = 0, kScreenFadedOut = 1, kCinematicNewsChannelActive = 2, - kPlayerSwitchState1 = 5, - kPlayerSwitchState2 = 6, - kPlayerSwitchState3 = 7, - kPlayerSwitchState4 = 8, + kRepeatingPreviousCheckpoint = 3, + kCarModIntro = 4, + kPlayerSwitchStateAscent = 5, + kPlayerSwitchStateInClouds = 6, + kPlayerSwitchStatePan = 7, + kPlayerSwitchStateDescent = 8, kModshopActive = 9, kModshopExitingVehicle = 10, + kSpectating = 28, + kBeastActive = 29, + kPlayerNotInSCTV = 30, kPlayerInSCTV = 31 }; @@ -316,7 +420,7 @@ struct PLAYER_BLIP SCR_INT PAD_0000; SCR_INT NumPassengersInVehicle; SCR_BITSET BlipFlags; - SCR_INT PlayerVehicleBlipType; // can be used to spoof your blip as a tank, oppressor etc + alignas(8) eBlipType PlayerVehicleBlipType; // can be used to spoof your blip as a tank, oppressor etc SCR_INT IdleDurationUntilBlipIsVisible; SCR_INT BlipVisibleDuration; SCR_INT MissionInteriorIndex; // can be used to spoof blip position @@ -413,7 +517,8 @@ static_assert(sizeof(ARCADE_GAME) == 5 * 8); struct GlobalPlayerBDEntry { alignas(8) eFreemodeState FreemodeState; - uint64_t PAD_0001[32]; // TODO + MP_SCRIPT_DATA CurrentScript; + uint64_t PAD_0022[11]; // unused SCR_INT PlayersVisible; SCR_INT PlayersTracked; SCR_BITSET AnimationBitset; @@ -435,7 +540,7 @@ struct GlobalPlayerBDEntry NETWORK_INDEX DinghyNetId; NETWORK_INDEX DeliveryMechanicNetId4; // another one... NETWORK_INDEX AcidLabNetId; - NETWORK_INDEX DeliveryBikeNetId; // this is a guess, verify + NETWORK_INDEX DeliveryBikeNetId; SCR_BOOL PAD_0057; uint64_t PAD_0058[15]; // confirmed these are not used by PC scripts PLAYER_BLIP PlayerBlip; diff --git a/script/scriptId.hpp b/script/scriptId.hpp index e7ee468..4577bbf 100644 --- a/script/scriptId.hpp +++ b/script/scriptId.hpp @@ -11,4 +11,16 @@ namespace rage char m_name[0x20]; // 0x0C }; } + +class CGameScriptId : public rage::scriptId +{ +public: + char m_padding[0x04]; // 0x2C + std::int32_t m_timestamp; // 0x30 + std::int32_t m_position_hash; // 0x34 + std::int32_t m_instance_id; // 0x38 + std::int32_t m_unk; // 0x3C +}; + +static_assert(sizeof(CGameScriptId) == 0x40); #pragma pack(pop) \ No newline at end of file diff --git a/script/scriptIdBase.hpp b/script/scriptIdBase.hpp index ea4c85a..34a9083 100644 --- a/script/scriptIdBase.hpp +++ b/script/scriptIdBase.hpp @@ -13,45 +13,45 @@ namespace rage class scriptIdBase { public: - virtual ~scriptIdBase() = default; // 0 (0x00) + virtual ~scriptIdBase() = default; // 0 (0x00) - // Assumes the script thread's identity. - virtual void assume_thread_identity(scrThread*) = 0; // 1 (0x08) + // Assumes the script thread's identity. + virtual void assume_thread_identity(scrThread*) {}; // 1 (0x08) - // Returns whether the hash of the script id is valid. - virtual bool is_valid() = 0; // 2 (0x10) + // Returns whether the hash of the script id is valid. + virtual bool is_valid() { return false; }; // 2 (0x10) - // Gets the hash of the script id. - virtual joaat_t *get_hash(joaat_t *out) = 0; // 3 (0x18) + // Gets the hash of the script id. + virtual joaat_t* get_hash(joaat_t* out) { return 0; }; // 3 (0x18) - // Gets an unknown value from the script id. - virtual std::uint32_t *get_hash2(std::uint32_t *out) = 0; // 4 (0x20) - - // Gets the name of the script id. - virtual const char *get_name() = 0; // 5 (0x28) + // Gets an unknown value from the script id. + virtual std::uint32_t* get_hash2(std::uint32_t* out) { return 0; }; // 4 (0x20) - // Serializes the script id from the buffer. - virtual void deserialize(datBitBuffer* buffer) = 0; // 6 (0x30) + // Gets the name of the script id. + virtual const char* get_name() { return nullptr; }; // 5 (0x28) - // Serializes the script id to the buffer. - virtual void serialize(datBitBuffer* buffer) = 0; // 7 (0x38) - - // Calculates some information with the position hash & instance id. - virtual std::uint32_t _0x40() = 0; // 8 (0x40) + // Serializes the script id from the buffer. + virtual void deserialize(datBitBuffer* buffer) {}; // 6 (0x30) - // Calls _0x40 and returns it's value added to another value. - virtual std::uint32_t _0x48() = 0; // 9 (0x48) + // Serializes the script id to the buffer. + virtual void serialize(datBitBuffer* buffer) {}; // 7 (0x38) - // Logs some information about the script id. - virtual void log_information(netLoggingInterface* logger) = 0; // 10 (0x50) - - // Copies the information of other to this object. - virtual void copy_data(scriptIdBase *other) = 0; // 11 (0x58) - - // Returns whether the other script id is equal. - virtual bool operator==(scriptIdBase*) = 0; // 12 (0x60) + // Calculates some information with the position hash & instance id. + virtual std::uint32_t _0x40() { return 0; }; // 8 (0x40) - virtual bool _0x68(void*) = 0; // 13 (0x68) + // Calls _0x40 and returns it's value added to another value. + virtual std::uint32_t _0x48() { return 0; }; // 9 (0x48) + + // Logs some information about the script id. + virtual void log_information(netLoggingInterface* logger) {}; // 10 (0x50) + + // Copies the information of other to this object. + virtual void copy_data(scriptIdBase* other) {} // 11 (0x58) + + // Returns whether the other script id is equal. + virtual bool operator==(scriptIdBase*) { return false; }; // 12 (0x60) + + virtual bool _0x68(void*) { return false; }; // 13 (0x68) }; } #pragma pack(pop) \ No newline at end of file diff --git a/stats/CPlayerCardStats.hpp b/stats/CPlayerCardStats.hpp new file mode 100644 index 0000000..51c2633 --- /dev/null +++ b/stats/CPlayerCardStats.hpp @@ -0,0 +1,23 @@ +#pragma once +#include + +class CPlayerCardStats +{ +public: + uint32_t m_access_flags; //0x0000 + float m_kd_ratio; //0x0004 + float m_unk_ratio; //0x0008 + float m_rank; //0x000C + float m_can_spectate; //0x0010 + float m_is_spectating; //0x0014 + float m_current_crew_rank; //0x0018 + float m_overall_badsport; //0x001C + float m_stamina; //0x0020 + float m_strength; //0x0024 + float m_shooting_ability; //0x0028 + float m_stealth_ability; //0x002C + float m_flying_ability; //0x0030 + float m_wheelie_ability; //0x0034 + float m_mental_state; //0x0038 +}; //Size: 0x003C +static_assert(sizeof(CPlayerCardStats) == 0x3C); \ No newline at end of file diff --git a/stats/CStatsSerializationContext.hpp b/stats/CStatsSerializationContext.hpp new file mode 100644 index 0000000..1fd685e --- /dev/null +++ b/stats/CStatsSerializationContext.hpp @@ -0,0 +1,27 @@ +#pragma once +#include + +#pragma pack(push, 1) +class CStatsSerializationContext +{ +public: + bool m_compressed; //0x0000 + char pad_0001[7]; //0x0001 + class CStatSerializationEntry* m_entries; //0x0008 + uint16_t m_size; //0x0010 +}; //Size: 0x0012 +static_assert(sizeof(CStatsSerializationContext) == 0x12); + +class CStatSerializationEntry +{ +public: + uint32_t m_hash; //0x0000 + union //0x0004 + { + float m_float_value; //0x0000 + uint16_t m_short_value; //0x0000 + uint64_t m_int_value; //0x0000 + }; +}; //Size: 0x000C +static_assert(sizeof(CStatSerializationEntry) == 0xC); // can be 0x8 or 0xC +#pragma pack(pop) \ No newline at end of file