From 46842a582c580db5216c8f392b803629e943cb1c Mon Sep 17 00:00:00 2001 From: Diavolo Date: Thu, 30 Jun 2022 17:36:54 +0200 Subject: [PATCH] [Struct] Document clientConnections --- src/Game/Functions.cpp | 2 ++ src/Game/Functions.hpp | 2 ++ src/Game/Structs.hpp | 43 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/src/Game/Functions.cpp b/src/Game/Functions.cpp index 33917332..121fdca5 100644 --- a/src/Game/Functions.cpp +++ b/src/Game/Functions.cpp @@ -605,6 +605,8 @@ namespace Game scr_const_t* scr_const = reinterpret_cast(0x1AA2E00); + clientConnection_t* clientConnections = reinterpret_cast(0xA1E878); + void Sys_LockRead(FastCriticalSection* critSect) { InterlockedIncrement(&critSect->readCount); diff --git a/src/Game/Functions.hpp b/src/Game/Functions.hpp index f043bc0d..8ae03984 100644 --- a/src/Game/Functions.hpp +++ b/src/Game/Functions.hpp @@ -1251,6 +1251,8 @@ namespace Game extern scr_const_t* scr_const; + extern clientConnection_t* clientConnections; + void Sys_LockRead(FastCriticalSection* critSect); void Sys_UnlockRead(FastCriticalSection* critSect); diff --git a/src/Game/Structs.hpp b/src/Game/Structs.hpp index d066ca54..0eebd158 100644 --- a/src/Game/Structs.hpp +++ b/src/Game/Structs.hpp @@ -6264,6 +6264,49 @@ namespace Game static_assert(sizeof(client_t) == 0xA6790); + struct clientConnection_t + { + int qport; + int clientNum; + int lastPacketSentTime; + int lastPacketTime; + netadr_t serverAddress; + int connectTime; + int connectPacketCount; + char serverMessage[256]; + int challenge; + int checksumFeed; + int reliableSequence; + int reliableAcknowledge; + char reliableCommands[128][1024]; + int serverMessageSequence; + int serverCommandSequence; + int lastExecutedServerCommand; + char serverCommands[128][1024]; + bool isServerRestarting; + int lastClientArchiveIndex; + char demoName[64]; + int demorecording; + int demoplaying; + int isTimeDemo; + int demowaiting; + int(__cdecl* demoread)(void*, int, int); + int demofile; + int timeDemoLog; + int timeDemoFrames; + int timeDemoStart; + int timeDemoPrev; + int timeDemoBaseTime; + netchan_t netchan; + char netchanOutgoingBuffer[2048]; + char netchanIncomingBuffer[131072]; + netProfileInfo_t OOBProf; + char statPacketsToSend; + int statPacketSendTime[7]; + }; + + static_assert(sizeof(clientConnection_t) == 0x615E8); // Size confirmed in CL_Migrate + struct CModelAllocData { void* mainArray;