Improve sync classes (#108)

This commit is contained in:
maybegreat48 2023-02-23 23:11:35 +00:00 committed by GitHub
parent 9bf112e043
commit f71748dd1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
78 changed files with 928 additions and 303 deletions

View File

@ -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 --

View File

@ -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)

190
classes.cpp Normal file
View File

@ -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

View File

@ -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);

View File

@ -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)

View File

@ -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);

View File

@ -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)

View File

@ -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);

View File

@ -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 {};

View File

@ -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);

View File

@ -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);

View File

@ -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)
}

View File

@ -0,0 +1,39 @@
#pragma once
#include <cstdint>
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)
}

View File

@ -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 {};

27
netsync/netSyncTree.hpp Normal file
View File

@ -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)
}

View File

@ -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);

View File

@ -1,13 +1,12 @@
#pragma once
#include <cstdint>
#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

View File

@ -0,0 +1,17 @@
#pragma once
#include <cstdint>
#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)

View File

@ -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)

View File

@ -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)

View File

@ -1,24 +1,26 @@
#pragma once
#include <cstdint>
#include "netsync/CProjectBaseSyncDataNode.hpp"
#pragma pack(push, 4)
#pragma pack(push, 1)
struct CDecorator
{
uint32_t m_type;
uint32_t m_name_hash;
uint32_t m_value;
};
#pragma pack(pop)
class CDynamicEntityGameStateDataNode
#pragma pack(push, 4)
class CDynamicEntityGameStateDataNode : CSyncDataNodeInfrequent
{
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
CDecorator m_decors[10]; // 0x00CC
char pad[8]; // TODO!
}; //Size: 0x15C
static_assert(sizeof(CDynamicEntityGameStateDataNode) == 0x15C);
static_assert(sizeof(CDynamicEntityGameStateDataNode) == 0x14C);
#pragma pack(pop)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -1,13 +1,12 @@
#pragma once
#include <cstdint>
#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

View File

@ -1,11 +1,10 @@
#pragma once
#include <cstdint>
#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

View File

@ -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

View File

@ -1,13 +1,12 @@
#pragma once
#include <cstdint>
#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

View File

@ -0,0 +1,14 @@
#pragma once
#include <cstdint>
#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);

View File

@ -1,12 +1,11 @@
#pragma once
#include <cstdint>
#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

View File

@ -1,12 +1,11 @@
#pragma once
#include <cstdint>
#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

View File

@ -1,12 +1,11 @@
#pragma once
#include "netsync/CProjectBaseSyncDataNode.hpp"
#include <cstdint>
#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

View File

@ -1,7 +1,7 @@
#pragma once
#include <cstdint>
// todo?
#pragma pack(push, 4)
class CPedInventoryDataNode
{

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -1,12 +1,11 @@
#pragma once
#include <cstdint>
#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

View File

@ -1,15 +1,14 @@
#pragma once
#include <cstdint>
#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);
#pragma pack(pop)

View File

@ -1,13 +1,12 @@
#pragma once
#include <cstdint>
#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

View File

@ -1,11 +1,10 @@
#pragma once
#include <cstdint>
#include "netsync/CProjectBaseSyncDataNode.hpp"
#pragma pack(push, 8)
struct CPhysicalHealthDataNode
struct CPhysicalHealthDataNode : CSyncDataNodeInfrequent
{
char pad_0000[192]; //0x0000
bool unk_00C0; //0x00C0
bool m_has_max_health_changed; //0x00C1
uint32_t m_max_health; //0x00C4

View File

@ -0,0 +1,12 @@
#pragma once
#include <cstdint>
#include "netsync/CProjectBaseSyncDataNode.hpp"
#pragma pack(push, 4)
class CPhysicalMigrationDataNode : CProjectBaseSyncDataNode
{
public:
bool m_unk;
};
static_assert(sizeof(CPhysicalMigrationDataNode) == 0xC4);
#pragma pack(pop)

View File

@ -0,0 +1,14 @@
#pragma once
#include <cstdint>
#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)

View File

@ -1,12 +1,11 @@
#pragma once
#include <cstdint>
#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.

View File

@ -1,18 +1,15 @@
#pragma once
#include <cstdint>
#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

View File

@ -1,13 +1,12 @@
#pragma once
#include <cstdint>
#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

View File

@ -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

View File

@ -1,11 +1,11 @@
#pragma once
#include <cstdint>
#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

View File

@ -1,12 +1,11 @@
#pragma once
#include <cstdint>
#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

View File

@ -1,12 +1,11 @@
#pragma once
#include <cstdint>
#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

View File

@ -1,13 +1,12 @@
#pragma once
#include <cstdint>
#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

View File

@ -1,13 +1,12 @@
#pragma once
#include <cstdint>
#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)

View File

@ -1,12 +1,11 @@
#pragma once
#include <cstdint>
#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

View File

@ -1,12 +1,11 @@
#pragma once
#include <cstdint>
#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

View File

@ -1,12 +1,11 @@
#pragma once
#include <cstdint>
#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

View File

@ -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

View File

@ -1,7 +1,7 @@
#pragma once
#include <cstdint>
#include "../../rage/vector.hpp"
#include "rage/vector.hpp"
#pragma pack(push, 1)
class ClonedTakeOffPedVariationInfo

View File

@ -1,12 +1,11 @@
#pragma once
#include <cstdint>
#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

View File

@ -1,12 +1,11 @@
#pragma once
#include <cstdint>
#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

View File

@ -1,6 +1,6 @@
#pragma once
#include <cstdint>
#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

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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++;
}

View File

@ -1,7 +1,7 @@
#pragma once
#include <cstdint>
#include "../rage/netSyncTree.hpp"
#include "../netsync/netSyncTree.hpp"
#include "../base/atRTTI.hpp"
class CObject;

View File

@ -1,30 +0,0 @@
#pragma once
#include <cstdint>
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)
}

View File

@ -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)
}

View File

@ -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)

11
script/MPScriptData.hpp Normal file
View File

@ -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);

View File

@ -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<eMissionDataFlags> 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<uint64_t, 2> 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<uint64_t, 2> ActiveAmbientWeaponPickups;
SCR_ARRAY<uint64_t, 6> OfficeMapMarkers;

View File

@ -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;

View File

@ -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<eBlipFlags> 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<eAnimationBitset> 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;

View File

@ -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)

View File

@ -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)

View File

@ -0,0 +1,23 @@
#pragma once
#include <cstdint>
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);

View File

@ -0,0 +1,27 @@
#pragma once
#include <cstdint>
#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)