css_enhanced_waf/engine/clockdriftmgr.h
Kamay Xutax 69312da01b Fixed few stuff & now server bullet impacts are events
- Fixed some game events not being sent to clients
- Use event instead of descriptor for sending it to client
- Moved server bullets to events
- Re-trained zstd data
- Corrected some stuff on clock correction
2024-07-26 05:34:50 +02:00

51 lines
1.3 KiB
C++

//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#ifndef CLOCKDRIFTMGR_H
#define CLOCKDRIFTMGR_H
#ifdef _WIN32
#pragma once
#endif
class CClockDriftMgr
{
friend class CBaseClientState;
public:
CClockDriftMgr();
// Is clock correction even enabled right now?
static bool IsClockCorrectionEnabled();
// Clear our state.
void Clear();
// This is called each time a server packet comes in. It is used to correlate
// where the server is in time compared to us.
void SetServerTick( int iServerTick, int nLaggedTick, float flServerHostFrametime, float flServerHostFrametimeStdDeviation);
void IncrementCachedTickCount(bool bFinalTick);
private:
void ShowDebugInfo();
public:
int m_nLagDiff;
int m_nOldServerTick;
int m_nServerTick; // Last-received tick from the server.
int m_nClientTick;
int m_nNumberOfTicks;
int m_nCachedRealClientTick; // The client's own tick counter (specifically, for interpolation during rendering).
// The server may be on a slightly different tick and the client will drift towards it.
int m_nLaggedClientTick;
float m_flServerHostFrametime;
float m_flServerHostFrametimeStdDeviation;
};
#endif // CLOCKDRIFTMGR_H