Entities (#4)

* feat(metric): add rlMetric

* fix(metric): serializer fix

* feat(tls): add tlsContext

* feat(fwEntity): add entity classes

* fix: add import

* fix(vector): constexpr ctors

* feat(ped): add CPed

---------
This commit is contained in:
maybegreat48 2023-09-29 21:45:35 +00:00 committed by GitHub
parent 8d335c795b
commit ca56c5acdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 116 additions and 6 deletions

10
base/datBase.hpp Normal file
View File

@ -0,0 +1,10 @@
#pragma once
namespace rage
{
class datBase
{
public:
virtual ~datBase() = default;
}; //Size: 0x0008
static_assert(sizeof(datBase) == 0x8);
}

13
base/fwExtensibleBase.hpp Normal file
View File

@ -0,0 +1,13 @@
#pragma once
#include "fwRefAwareBase.hpp"
namespace rage
{
class fwExtensibleBase : public fwRefAwareBase
{
public:
void* m_extension_container; // 0x0010
void* m_extensible_unk; // 0x0018
}; //Size: 0x0020
static_assert(sizeof(fwExtensibleBase) == 0x20);
}

11
base/fwRefAwareBase.hpp Normal file
View File

@ -0,0 +1,11 @@
#pragma once
#include "datBase.hpp"
#include "fwRefAwareBaseImpl.hpp"
namespace rage
{
class fwRefAwareBase : public fwRefAwareBaseImpl<datBase>
{
};
static_assert(sizeof(fwRefAwareBase) == 0x10);
}

View File

@ -0,0 +1,11 @@
#pragma once
namespace rage
{
template <typename T>
class fwRefAwareBaseImpl : public T
{
private:
void *m_ref; // 0x08
};
}

View File

@ -1,5 +1,11 @@
#include "base/datBase.hpp"
#include "base/fwExtensibleBase.hpp"
#include "base/fwRefAwareBase.hpp"
#include "base/fwRefAwareBaseImpl.hpp"
#include "entity/fwEntity.hpp"
#include "network/CNetGamePlayer.hpp" #include "network/CNetGamePlayer.hpp"
#include "network/CNetworkPlayerMgr.hpp" #include "network/CNetworkPlayerMgr.hpp"
#include "network/netObject.hpp"
#include "network/netPeerAddress.hpp" #include "network/netPeerAddress.hpp"
#include "network/netPlayer.hpp" #include "network/netPlayer.hpp"
#include "network/netPlayerMgrBase.hpp" #include "network/netPlayerMgrBase.hpp"
@ -7,6 +13,7 @@
#include "network/rlGamerInfoBase.hpp" #include "network/rlGamerInfoBase.hpp"
#include "network/rlGamerInfo.hpp" #include "network/rlGamerInfo.hpp"
#include "player/CPlayerInfo.hpp" #include "player/CPlayerInfo.hpp"
#include "ped/CPed.hpp"
#include "rage/atArray.hpp" #include "rage/atArray.hpp"
#include "rage/joaat.hpp" #include "rage/joaat.hpp"
#include "rage/rlJson.hpp" #include "rage/rlJson.hpp"

29
entity/fwEntity.hpp Normal file
View File

@ -0,0 +1,29 @@
#pragma once
#include <cstdint>
#include "../base/fwExtensibleBase.hpp"
class CMoveObjectPooledObject;
class CNavigation;
class CBaseModelInfo;
namespace rage
{
class fwDrawData;
class fwDynamicEntityComponent;
class crmtRequestPose;
class crmtRequestIk;
class crFrameFilter;
class fwAudEntity;
class netObject;
class fwEntity : public fwExtensibleBase
{
public:
class CBaseModelInfo* m_ModelInfo; // 0x0020
void* m_Unk; // 0x0028
uint8_t m_EntityType; // 0x0030
char m_Pad[0xA8]; // 0x0038
// TODO: move these out of rage::fwEntity
class rage::netObject* m_NetObject; // 0x00E0
};
static_assert(sizeof(fwEntity) == 0xE8);
}

21
network/netObject.hpp Normal file
View File

@ -0,0 +1,21 @@
#pragma once
#include <cstdint>
class CObject;
namespace rage
{
class netObject
{
public:
virtual ~netObject() = 0;
char m_Pad[0x38]; // 0x08
uint16_t m_ObjectType; // 0x40
uint16_t m_ObjectId; // 0x42
uint8_t m_Unk; // 0x44
uint8_t m_OwnerId; // 0x45
uint8_t m_MigratingOwnerId; // 0x46
bool m_IsRemotelyControlled; // 0x47
};
static_assert(sizeof(rage::netObject) == 0x48);
}

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include <cstdint> #include <cstdint>
#include "rlGamerHandle.hpp" #include "rlGamerHandle.hpp"
#include "netPeerAddress.hpp"
#pragma pack(push, 8) #pragma pack(push, 8)
namespace rage namespace rage

7
ped/CPed.hpp Normal file
View File

@ -0,0 +1,7 @@
#pragma once
#include "entity/fwEntity.hpp"
// TODO
class CPed : public rage::fwEntity
{
};

View File

@ -8,13 +8,13 @@ namespace rage
T data[2]; T data[2];
struct { T x, y; }; struct { T x, y; };
vector2(T x, T y) : constexpr vector2(T x, T y) :
x(x), x(x),
y(y) y(y)
{ {
} }
vector2() : constexpr vector2() :
x(), x(),
y() y()
{ {
@ -27,14 +27,14 @@ namespace rage
T data[3]; T data[3];
struct { T x, y, z; }; struct { T x, y, z; };
vector3(T x, T y, T z) : constexpr vector3(T x, T y, T z) :
x(x), x(x),
y(y), y(y),
z(z) z(z)
{ {
} }
vector3() : constexpr vector3() :
x(), x(),
y(), y(),
z() z()
@ -48,7 +48,7 @@ namespace rage
T data[4]; T data[4];
struct { T x, y, z, w; }; struct { T x, y, z, w; };
vector4(T x, T y, T z, T w) : constexpr vector4(T x, T y, T z, T w) :
x(x), x(x),
y(y), y(y),
z(z), z(z),
@ -56,7 +56,7 @@ namespace rage
{ {
} }
vector4() : constexpr vector4() :
x(), x(),
y(), y(),
z(), z(),