#pragma once
#include <cstdint>
// Created with ReClass.NET by KN4CK3R
#pragma pack(push, 1)
class INetMsg
{
public:
virtual ~INetMsg() = default;
virtual void SetNetChan(void*) = 0;
virtual void SetReliable(bool) = 0;
virtual bool Process() = 0;
virtual bool ReadFromBuffer(void*) = 0;
virtual bool WriteToBuffer(void*) = 0;
virtual bool IsReliable() const = 0;
virtual int GetType() const = 0;
virtual int GetGroup() const = 0;
virtual const char* GetName() const = 0;
virtual void* GetNetChannel() const = 0;
virtual const char* ToString() const = 0;
};
class INetChannel
{
public:
char pad_0x0000[0x18];
bool m_bShouldDelete;
int m_nOutSequenceNr;
int m_nInSequenceNr;
int m_nOutSequenceNrAck;
int m_nOutReliableState;
int m_nInReliableState;
int m_nChokedPackets;
void Transmit(bool onlyreliable)
{
using Fn = bool(__thiscall*)(void*, bool);
CallVFunction<Fn>(this, 49)(this, onlyreliable);
}
void send_datagram()
{
using Fn = int(__thiscall*)(void*, void*);
CallVFunction<Fn>(this, 46)(this, 0);
}
void SetTimeOut(float seconds)
{
using Fn = void(__thiscall*)(void*, float);
return CallVFunction<Fn>(this, 4)(this, seconds);
}
int RequestFile(const char* filename)
{
using Fn = int(__thiscall*)(void*, const char*);
return CallVFunction<Fn>(this, 62)(this, filename);
}
};
class CClockDriftMgr
{
public:
float m_ClockOffsets[17]; //0x0000
uint32_t m_iCurClockOffset; //0x0044
uint32_t m_nServerTick; //0x0048
uint32_t m_nClientTick; //0x004C
}; //Size: 0x0050
class CClientState {
public:
void ForceFullUpdate() {
*reinterpret_cast<int*>(std::uintptr_t(this) + 0x174) = -1;
}
/*
char pad_0000[156]; //0x0000
INetChannel* m_NetChannel; //0x0094
uint32_t m_nChallengeNr; //0x00A0
char pad_00A4[100]; //0x00A4
uint32_t m_nSignonState; //0x0108
char pad_010C[8]; //0x010C
float m_flNextCmdTime; //0x0114
uint32_t m_nServerCount; //0x0118
uint32_t m_nCurrentSequence; //0x011C
char _0x0120[4];
__int32 m_iClockDriftMgr; //0x0124
char _0x0128[68];
uint32_t m_nDeltaTick; //0x0174
bool m_bPaused; //0x0178
char pad_0179[7]; //0x0179
uint32_t m_nViewEntity; //0x0180
uint32_t m_nPlayerSlot; //0x0184
char m_szLevelName[260]; //0x0188
char m_szLevelNameShort[80]; //0x028C
char m_szGroupName[80]; //0x02B4
char pad_02DC[92]; //0x02DC
uint32_t m_nMaxClients; //0x0310
char pad_0314[18820]; //0x0314
float m_flLastServerTickTime; //0x4C98
bool insimulation; //0x4C9C
char pad_4C9D[3]; //0x4C9D
uint32_t oldtickcount; //0x4CA0
float m_tickRemainder; //0x4CA4
float m_frameTime; //0x4CA8
uint32_t m_nLastOutgoingCmd; //0x4CAC
uint32_t m_nChokedCmds; //0x4CB0 new = 4D28
uint32_t last_command_ack; //0x4CB4
uint32_t command_ack; //0x4CB8
uint32_t m_nSoundSequence; //0x4CBC
char pad_4CC0[80]; //0x4CC0
QAngle viewangles; //0x4D10
char pad_4D1C[208]; //0x4D1C
*/
char _0x0000[156];
INetChannel* m_ptrNetChannel; //0x009C
__int32 m_iChallengeNr; //0x00A0
char _0x00A4[100];
__int32 m_iSignonState; //0x0108
char _0x010C[8];
float m_flNextCmdTime; //0x0114
__int32 m_nServerCount; //0x0118
__int32 m_nCurrentSequence; //0x011C
char _0x0120[4];
__int32 m_iClockDriftMgr; //0x0124
char _0x0128[68];
__int32 m_iServerTick; //0x016C
__int32 m_iClientTick; //0x0170
__int32 m_nDeltaTick; //0x0174
bool m_bPaused; //0x0178
char _0x017C[12];
char m_szLevelName[260]; //0x0188
char m_szLevelNameShort[40]; //0x028C
char m_szGroupName[40]; //0x02B4
char m_szSecondName[32]; //0x02DC
char _0x02FC[140];
__int32 m_nMaxClients; //0x0388
char _0x038C[18828];
float m_flLastServerTickTime; //0x4D10
bool insimulation; //0x4D14
uint32_t oldtickcount; //0x4D18
float m_tickRemainder; //0x4D1C
float m_frameTime; //0x4D20
uint32_t m_nLastOutgoingCmd; //0x4D24
uint32_t m_nChokedCmds; //0x4D28
uint32_t m_iLastCommandAck; //0x4D2C
uint32_t command_ack; //0x4D30
uint32_t m_nSoundSequence; //0x4D34
char _0x4D38[80];
QAngle viewangles; //0x4D88
char _0x4D94[55];
void* m_ptrEvents; //0x4E64
}; //Size: 0x4D1C
#pragma pack(pop)
//static_assert(FIELD_OFFSET(CClientState, m_NetChannel) == 0x0094, "Wrong struct offset");
//static_assert(FIELD_OFFSET(CClientState, m_nCurrentSequence) == 0x011C, "Wrong struct offset");
//static_assert(FIELD_OFFSET(CClientState, m_nDeltaTick) == 0x0174, "Wrong struct offset");