-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathclientclass.h
87 lines (77 loc) · 1.89 KB
/
clientclass.h
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
#pragma once
// pre-declares.
class CRecvProxyData;
class RecvProp;
class RecvTable;
// prototypes.
// these are networkable entity ptrs.
using CreateClientClass_t = void*( __cdecl* )( int index, int serial );
using CreateEvent_t = void*( __cdecl* )( );
// other prototypes.
using ArrayLengthRecvProxy_t = void( __cdecl* )( void* ptr, int id, int len );
using RecvVarProxy_t = void( __cdecl* )( CRecvProxyData* data, void* struct_ptr, void* out );
using DataTableRecvVarProxy_t = void( __cdecl* )( RecvProp* prop, void** out, void* data, int id );
// types of props.
enum SendPropType {
DPT_Int = 0,
DPT_Float,
DPT_Vector,
DPT_String,
DPT_Array,
DPT_DataTable
};
class RecvProp {
public:
char *m_pVarName;
int m_RecvType;
int m_Flags;
int m_StringBufferSize;
bool m_bInsideArray;
const void* m_pExtraData;
RecvProp *m_pArrayProp;
ArrayLengthRecvProxy_t m_ArrayLengthProxy;
RecvVarProxy_t m_ProxyFn;
DataTableRecvVarProxy_t 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;
void* m_pDecoder;
char *m_pNetTableName;
bool m_bInitialized;
bool m_bInMainList;
};
class ClientClass {
public:
CreateClientClass_t m_pCreate;
CreateEvent_t m_pCreateEvent;
char* m_pNetworkName;
RecvTable* m_pRecvTable;
ClientClass* m_pNext;
int m_ClassID;
};
class DVariant {
public:
union {
float m_Float;
long m_Int;
char *m_pString;
void *m_pData;
float m_Vector[ 3 ];
long long m_Int64;
};
SendPropType m_Type;
};
class CRecvProxyData {
public:
const RecvProp *m_pRecvProp;
DVariant m_Value;
int m_iElement;
int m_ObjectID;
};