Rename 'TickUpdate' to 'nettick_t' and move to public

Renamed, and moved to public. also added additional static assertions to avoid alignment mistakes in the future.
This commit is contained in:
Kawe Mazidjatari 2023-02-15 17:52:25 +01:00
parent ccf221fd6e
commit 8550d7a865
2 changed files with 17 additions and 14 deletions

View File

@ -1,16 +1,6 @@
#if !defined( FRAMESNAPSHOT_H )
#define FRAMESNAPSHOT_H
struct TickUpdate
{
int m_nTickUnused;
int m_nTick;
float m_flHostFrameTime;
float m_flHostFrameTimeStdDeviation;
bool m_bStruggling;
char m_nServerCPU;
int command_number;
};
#include "public/inetchannel.h"
struct CFrameSnapshot
{
@ -30,7 +20,7 @@ struct CFrameSnapshot
_BYTE snap_byte26;
__unaligned __declspec(align(1)) _WORD word27;
_BYTE gap29[3];
TickUpdate snap_tick_update;
nettick_t snap_tick_update;
_BYTE gap44[4];
_QWORD qword48;
_QWORD qword50;

View File

@ -50,8 +50,7 @@ public:
struct CS_INetChannelHandler : INetChannelHandler
{};
typedef struct netpacket_s netpacket_t;
typedef struct __declspec(align(8)) netpacket_s
typedef struct netpacket_s
{
netadr_t from;
int source;
@ -63,4 +62,18 @@ typedef struct __declspec(align(8)) netpacket_s
char stream;
netpacket_s* pNext;
} netpacket_t;
static_assert(sizeof(netpacket_t) == 0x88);
typedef struct nettick_s
{
int m_nTickUnused;
int m_nTick;
float m_flHostFrameTime;
float m_flHostFrameTimeStdDeviation;
bool m_bStruggling;
char m_nServerCPU;
int command_number;
} nettick_t;
static_assert(sizeof(nettick_s) == 0x18);
#endif // !INETCHANNEL_H