@@ -18,6 +18,51 @@ struct CEntityPrecacheContext;
18
18
struct ChangeAccessorFieldPathIndexInfo_t ;
19
19
struct datamap_t ;
20
20
21
+ struct NetworkStateChangedData
22
+ {
23
+ inline NetworkStateChangedData () : m_unk001(1 ), m_FieldOffset(-1 ), m_nArrayIndex(-1 ), m_nPathIndex(ChangeAccessorFieldPathIndex_t()), m_unk101(0 ) { }
24
+ inline explicit NetworkStateChangedData ( bool bFullChanged ) :
25
+ m_unk001(static_cast <uint32>(!bFullChanged)), m_FieldOffset(-1 ),
26
+ m_nArrayIndex(-1 ), m_nPathIndex(ChangeAccessorFieldPathIndex_t()),
27
+ m_unk101(0 )
28
+ { }
29
+
30
+ // nLocalOffset is the flattened field offset
31
+ // calculated taking into account embedded structures
32
+ // if PathIndex is specified, then the offset must start from the last object in the chain
33
+ // nArrayIndex is the index of the array element
34
+ // if the field is a CNetworkUtlVectorBase, otherwise pass -1
35
+ // nPathIndex is the value to specify
36
+ // if the path to the field goes through one or more pointers, otherwise pass -1
37
+ // this value is usually a member of the CNetworkVarChainer and belongs to the last object in the chain
38
+ inline NetworkStateChangedData ( uint32 nLocalOffset, int32 nArrayIndex = -1 , ChangeAccessorFieldPathIndex_t nPathIndex = ChangeAccessorFieldPathIndex_t() ) :
39
+ m_unk001(1 ), m_LocalOffsets(0 , 1 ), m_FieldOffset(-1 ), m_nArrayIndex(nArrayIndex), m_nPathIndex(nPathIndex), m_unk101(0 )
40
+ {
41
+ m_LocalOffsets.AddToHead (nLocalOffset);
42
+ }
43
+
44
+ inline NetworkStateChangedData (const std::initializer_list< uint32 > nLocalOffsets, int32 nArrayIndex = -1 , ChangeAccessorFieldPathIndex_t nPathIndex = ChangeAccessorFieldPathIndex_t()) :
45
+ m_unk001(1 ), m_LocalOffsets(0 , nLocalOffsets.size()), m_FieldOffset(-1 ), m_nArrayIndex(nArrayIndex), m_nPathIndex(nPathIndex), m_unk101(1 )
46
+ {
47
+ for ( const uint32& nLocalOffset : nLocalOffsets )
48
+ {
49
+ m_LocalOffsets.AddToTail ( nLocalOffset );
50
+ }
51
+ }
52
+
53
+ uint32 m_unk001; // Perhaps it is an enum, default 1, when 0 adds FL_FULL_EDICT_CHANGED
54
+ CUtlVector<uint32> m_LocalOffsets;
55
+
56
+ // AMNOTE: Mostly unused/debug
57
+ CUtlString m_ClassName;
58
+ CUtlString m_FieldName;
59
+ int32 m_FieldOffset;
60
+ int32 m_nArrayIndex;
61
+ ChangeAccessorFieldPathIndex_t m_nPathIndex;
62
+
63
+ int16 m_unk101; // default 0, if m_LocalOffsets has multiple values, it is set to 1
64
+ };
65
+
21
66
class CEntityInstance
22
67
{
23
68
public:
@@ -30,14 +75,17 @@ class CEntityInstance
30
75
virtual void Precache ( const CEntityPrecacheContext* pContext ) = 0;
31
76
virtual void AddedToEntityDatabase () = 0;
32
77
virtual void Spawn ( const CEntityKeyValues* pKeyValues ) = 0;
78
+
79
+ virtual void unk001 () = 0;
80
+
33
81
virtual void PostDataUpdate ( /* DataUpdateType_t*/ int updateType ) = 0;
34
82
virtual void OnDataUnchangedInPVS () = 0;
35
83
virtual void Activate ( /* ActivateType_t*/ int activateType ) = 0;
36
84
virtual void UpdateOnRemove () = 0;
37
85
virtual void OnSetDormant ( /* EntityDormancyType_t*/ int prevDormancyType, /* EntityDormancyType_t*/ int newDormancyType ) = 0;
38
86
39
87
virtual void * ScriptEntityIO () = 0;
40
- virtual int ScriptAcceptInput ( const CUtlSymbolLarge &sInputName , CEntityInstance* pActivator, CEntityInstance* pCaller, const variant_t &value, int nOutputID ) = 0;
88
+ virtual int ScriptAcceptInput ( const CUtlSymbolLarge &sInputName , CEntityInstance* pActivator, CEntityInstance* pCaller, const variant_t &value, int nOutputID, void * pUnk1, void * pUnk2 ) = 0;
41
89
42
90
virtual void PreDataUpdate ( /* DataUpdateType_t*/ int updateType ) = 0;
43
91
@@ -49,37 +97,40 @@ class CEntityInstance
49
97
virtual void OnSave () = 0;
50
98
virtual void OnRestore () = 0;
51
99
52
- virtual void unk001 () = 0;
100
+ virtual void unk101 () = 0;
101
+
53
102
virtual int ObjectCaps () = 0;
54
103
virtual CEntityIndex RequiredEdictIndex () = 0;
55
-
56
- // marks an entire entity for transmission over the network
57
- virtual void NetworkStateChanged () = 0;
58
-
104
+
59
105
// marks a field for transmission over the network
60
- // nOffset is the flattened field offset
61
- // calculated taking into account embedded structures
62
- // if PathIndex is specified, then the offset must start from the last object in the chain
63
- // nItem is the index of the array element
64
- // if the field is a CNetworkUtlVectorBase, otherwise pass -1
65
- // PathIndex is the value to specify
66
- // if the path to the field goes through one or more pointers, otherwise pass -1
67
- // this value is usually a member of the CNetworkVarChainer and belongs to the last object in the chain
68
- virtual void NetworkStateChanged ( uint nOffset, int nItem = -1 , ChangeAccessorFieldPathIndex_t PathIndex = ChangeAccessorFieldPathIndex_t() ) = 0;
69
-
70
- virtual void LogFieldInfo ( const char * pszFieldName, const char * pszInfo ) = 0;
106
+ virtual void NetworkStateChanged ( const NetworkStateChangedData& data ) = 0;
107
+
108
+ // AMNOTE: NetworkState related methods
109
+ virtual void unk201 ( const void * data ) = 0;
110
+ virtual void unk202 ( const void * data ) = 0;
111
+
112
+ // Toggles network update state, if set to false would skip network updates
113
+ virtual void NetworkUpdateState ( bool state ) = 0;
114
+ virtual void NetworkStateChangedLog ( const char * pszFieldName, const char * pszInfo ) = 0;
115
+
71
116
virtual bool FullEdictChanged () = 0;
72
- virtual void unk101 () = 0;
73
- virtual void unk102 () = 0;
117
+
118
+ virtual void unk301 () = 0;
119
+ virtual void unk302 () = 0;
120
+
74
121
virtual ChangeAccessorFieldPathIndex_t AddChangeAccessorPath ( const CFieldPath& path ) = 0;
75
122
virtual void AssignChangeAccessorPathIds () = 0;
76
123
virtual ChangeAccessorFieldPathIndexInfo_t* GetChangeAccessorPathInfo_1 () = 0;
77
124
virtual ChangeAccessorFieldPathIndexInfo_t* GetChangeAccessorPathInfo_2 () = 0;
78
125
79
- virtual void unk201 () = 0;
126
+ virtual void unk401 () = 0;
127
+ virtual void unk402 () = 0;
128
+
80
129
virtual void ReloadPrivateScripts () = 0;
81
130
virtual datamap_t * GetDataDescMap () = 0;
82
- virtual void unk301 () = 0;
131
+
132
+ virtual void unk501 () = 0;
133
+
83
134
virtual SchemaMetaInfoHandle_t<CSchemaClassInfo> Schema_DynamicBinding () = 0;
84
135
85
136
public:
0 commit comments