-
Notifications
You must be signed in to change notification settings - Fork 40
/
netvar.hpp
91 lines (80 loc) · 2.38 KB
/
netvar.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#pragma once
#include <string>
#include <vector>
#include <iostream>
#include "remote.hpp"
namespace netvar {
struct prop_t {
std::string name;
size_t offset;
};
struct class_t {
std::string name;
std::vector<prop_t> props;
};
// SDK definitions
class IClientNetworkable;
class CRecvDecoder;
class CRecvProxyData;
class RecvProp;
class RecvTable;
typedef IClientNetworkable* (*CreateClientClassFn)( int entnum, int serialNum );
typedef IClientNetworkable* (*CreateEventFn)();
typedef void (*RecvVarProxyFn)( const CRecvProxyData *pData, void *pStruct, void *pOut );
typedef void (*ArrayLengthRecvProxyFn)( void *pStruct, int objectID, int currentArrayLength );
typedef void (*DataTableRecvVarProxyFn)(const RecvProp *pProp, void **pOut, void *pData, int objectID);
typedef enum
{
DPT_Int=0,
DPT_Float,
DPT_Vector,
DPT_VectorXY,
DPT_String,
DPT_Array,
DPT_DataTable,
DPT_Int64,
DPT_NUMSendPropTypes
} SendPropType;
class RecvProp
{
public:
char *m_pVarName;
SendPropType m_RecvType;
int m_Flags;
int m_StringBufferSize;
bool m_bInsideArray;
const void *m_pExtraData;
RecvProp *m_pArrayProp;
ArrayLengthRecvProxyFn m_ArrayLengthProxy;
RecvVarProxyFn m_ProxyFn;
DataTableRecvVarProxyFn m_DataTableProxyFn;
RecvTable *m_pDataTable;
int m_Offset;
int m_ElementStride;
int m_nElements;
const char *m_pParentArrayPropName;
};
class RecvTable
{
public:
RecvProp *m_pProps;
int m_nProps;
CRecvDecoder *m_pDecoder;
char *m_pNetTableName;
bool m_bInitialized;
bool m_bInMainList;
};
class ClientClass
{
public:
CreateClientClassFn m_pCreateFn;
CreateEventFn m_pCreateEventFn;
char *m_pNetworkName;
RecvTable *m_pRecvTable;
ClientClass *m_pNext;
int m_ClassID;
};
bool Cache(remote::Handle game, remote::MapModuleMemoryRegion client);
std::vector<class_t> GetAllClasses();
int GetOffset(std::string classname, std::string varname);
};