From bc1bf0ede6354f47c022882e125a65c327f40a15 Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Sun, 2 Aug 2026 13:21:01 +0700 Subject: [PATCH] [saco] Implement/match `DumpNetworkStateInformation` --- saco/exceptions.cpp | 29 +++++++++++++++++++++++++++-- saco/net/playerpool.h | 2 +- saco/net/remoteplayer.h | 6 +++--- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/saco/exceptions.cpp b/saco/exceptions.cpp index fb6dd15..9568cd7 100644 --- a/saco/exceptions.cpp +++ b/saco/exceptions.cpp @@ -27,13 +27,38 @@ int dword_10125A58=0; void DumpNetworkStateInformation(PCHAR sz) { CPlayerPool *pPlayerPool = pNetGame->GetPlayerPool(); - PLAYERID playerId=0; + PLAYERID playerId; + char szBuffer[16384]; sz[0] = '\0'; sprintf(sz,"\r\nState Information: Ped Context: %u\r\n",*pbyteCurrentPlayer); - // TODO: DumpNetworkStateInformation 10060160 + playerId = 0; + do + { + if(playerId < MAX_PLAYERS && pPlayerPool->field_2A[playerId]) + { + CNetPlayer *pNetPlayer = pPlayerPool->m_pPlayers[playerId]; + CRemotePlayer *pRemotePlayer; + + if(pNetPlayer) + pRemotePlayer = pNetPlayer->m_pRemotePlayer; + else + pRemotePlayer = NULL; + + sprintf(szBuffer,"P%u (%u,%u) ",playerId,pRemotePlayer->field_10A,pRemotePlayer->field_1E7); + strcat(sz,szBuffer); + + if(playerId > 0) + { + if(!((playerId + 1) % 4)) + strcat(sz,"\r\n"); + } + } + playerId++; + } + while(playerId != MAX_PLAYERS); } //---------------------------------------------------- diff --git a/saco/net/playerpool.h b/saco/net/playerpool.h index 50b4eba..3dd3f8d 100644 --- a/saco/net/playerpool.h +++ b/saco/net/playerpool.h @@ -10,7 +10,7 @@ class CPlayerPool { -private: +public: int field_0; PLAYERID m_LocalPlayerID; diff --git a/saco/net/remoteplayer.h b/saco/net/remoteplayer.h index 16be238..b19a17c 100644 --- a/saco/net/remoteplayer.h +++ b/saco/net/remoteplayer.h @@ -6,7 +6,7 @@ #pragma pack(1) class CRemotePlayer { -private: +public: //char _gap0[509]; int field_0; int field_4; @@ -23,7 +23,7 @@ private: char field_AD[24]; char field_C5[68]; char field_109; - char field_10A; + BYTE field_10A; char field_10B; int field_10C; int field_110; @@ -44,7 +44,7 @@ private: CPlayerPed *m_pPlayerPed; int field_1E1; PLAYERID m_PlayerID; - short field_1E7; + WORD field_1E7; int field_1E9; int field_1ED; int field_1F1;