From d2c8f7becc95d905191ff22626aaf4c2e28396a0 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 12 Feb 2023 14:54:04 +0100 Subject: [PATCH] Update 'CGlobalVarsBase' Mapped it out a little bit better. --- r5dev/public/globalvars_base.h | 49 ++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/r5dev/public/globalvars_base.h b/r5dev/public/globalvars_base.h index 1883a401..274bb8c6 100644 --- a/r5dev/public/globalvars_base.h +++ b/r5dev/public/globalvars_base.h @@ -16,25 +16,34 @@ enum GameMode_t class CGlobalVarsBase { public: + float m_nUnkTime; + float m_rRealTime; // Absolute time (per frame still - Use Plat_FloatTime() for a high precision real time. + int m_nFrameCount; // Absolute frame counter - continues to increase even if game is paused - never resets. + float m_flAbsoluteFrameTime; // Non-paused frametime. + float m_flCurTime; - float m_nUnkTime; - float m_rRealTime; // Absolute time (per frame still - Use Plat_FloatTime() for a high precision real time. - int m_nFrameCount; // Absolute frame counter - continues to increase even if game is paused - never resets. - int m_nSomeTick; - float m_fCurTime; - float m_fAbsoluteFrameTime; // Non-paused frametime - float m_fAbsoluteFrameStartTimeStdDev; - char m_nPad0[20]; // All unknown. - float m_fFrameTime; // Time spent on last server or client frame (has nothing to do with think intervals) (Also empty on dedicated) - int m_nMaxMilesAudioQueues; // Only used on the server. - int m_nMaxClients; // Current maxplayers setting - GameMode_t m_nGameMode; // 1 (MP) 2 (PVE) 3 (SP) - int m_nTickCount; // Simulation ticks - does not increase when game is paused - resets on restart. - int m_nTickInterval; - int m_nUnk1; + // These seem to be mainly used in c:\depot\r5launch\src\engine\client\clientstate.cpp. + float m_flCurTimeUnknown0; // Empty on server. + float m_flCurTimeUnknown1; // Empty on server. + float m_flCurTimeUnknown2; // Empty on server. + float m_flLastFrameTimeSincePause; // Last frame time since pause, empty on server. + float m_flCurTimeUnknown3; // Empty on server. + float m_flLastCurTimeSincePause; // Last current time since pause, empty on server. + float m_flUnknown4; - // The following seem to be mainly used in c:\depot\r5launch\src\engine\client\clientstate.cpp. - int m_nUnk2; - int m_nUnk3; // Seems to be used on client only. - int m_nUnk4; // Seems to be used on client only. -}; \ No newline at end of file + float m_flFrameTime; // Time spent on last server or client frame (has nothing to do with think intervals) + int m_nMaxPlayers; // Max internal player entities. + int m_nMaxClients; // Max players as specified in the playlists file. + GameMode_t m_nGameMode; // 1 (MP) 2 (PVE) 3 (SP) + int m_nTickCount; // Simulation ticks - resets on restart. + int m_flTickInterfal; + + int m_nUnk1; + int m_nUnk2; + + // 100 (i.e., tickcount is rounded down to this base and then the "delta" from this base is networked + int m_nTimestampNetworkingBase; + // 32 (entindex() % nTimestampRandomizeWindow ) is subtracted from gpGlobals->tickcount to set the networking basis, prevents + // all of the entities from forcing a new PackedEntity on the same tick (i.e., prevents them from getting lockstepped on this) + int m_nTimestampRandomizeWindow; +};