From b3feddfef372618c8a9d7a0abcaf18cfad866c18 Mon Sep 17 00:00:00 2001 From: daoge <3523206925@qq.com> Date: Tue, 3 Mar 2026 03:04:10 +0800 Subject: feat: TU19 (Dec 2014) Features & Content (#155) * try to resolve merge conflict * feat: TU19 (Dec 2014) Features & Content (#32) * December 2014 files * Working release build * Fix compilation issues * Add sound to Windows64Media * Add DLC content and force Tutorial DLC * Revert "Add DLC content and force Tutorial DLC" This reverts commit 97a43994725008e35fceb984d5549df9c8cea470. * Disable broken light packing * Disable breakpoint during DLC texture map load Allows DLC loading but the DLC textures are still broken * Fix post build not working * ... * fix vs2022 build * fix cmake build --------- Co-authored-by: Loki --- .../Common/Network/Sony/SQRNetworkManager.cpp | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) (limited to 'Minecraft.Client/Common/Network/Sony/SQRNetworkManager.cpp') diff --git a/Minecraft.Client/Common/Network/Sony/SQRNetworkManager.cpp b/Minecraft.Client/Common/Network/Sony/SQRNetworkManager.cpp index 20f2641c..f23a0a63 100644 --- a/Minecraft.Client/Common/Network/Sony/SQRNetworkManager.cpp +++ b/Minecraft.Client/Common/Network/Sony/SQRNetworkManager.cpp @@ -8,3 +8,76 @@ void SQRNetworkManager::SafeToRespondToGameBootInvite() { s_safeToRespondToGameBootInvite = true; } + +int SQRNetworkManager::GetSendQueueSizeBytes() +{ + int queueSize = 0; + int playerCount = GetPlayerCount(); + for(int i = 0; i < playerCount; ++i) + { + SQRNetworkPlayer *player = GetPlayerByIndex( i ); + if( player != NULL ) + { + queueSize += player->GetTotalSendQueueBytes(); + } + } + return queueSize; +} + +int SQRNetworkManager::GetSendQueueSizeMessages() +{ + int queueSize = 0; + int playerCount = GetPlayerCount(); + for(int i = 0; i < playerCount; ++i) + { + SQRNetworkPlayer *player = GetPlayerByIndex( i ); + if( player != NULL ) + { + queueSize += player->GetTotalSendQueueMessages(); + } + } + return queueSize; +} + +int SQRNetworkManager::GetOutstandingAckCount(SQRNetworkPlayer *pSQRPlayer) +{ + int ackCount = 0; + int playerCount = GetPlayerCount(); + for(int i = 0; i < playerCount; ++i) + { + SQRNetworkPlayer *pSQRPlayer2 = GetPlayerByIndex( i ); + if( pSQRPlayer2 ) + { + if( ( pSQRPlayer == pSQRPlayer2 ) || (pSQRPlayer->IsSameSystem(pSQRPlayer2) ) ) + { + ackCount += pSQRPlayer2->m_acksOutstanding; + } + } + } + return ackCount; +} + +void SQRNetworkManager::RequestWriteAck(int smallId) +{ + EnterCriticalSection(&m_csAckQueue); + m_queuedAckRequests.push(smallId); + LeaveCriticalSection(&m_csAckQueue); +} + +void SQRNetworkManager::TickWriteAcks() +{ + EnterCriticalSection(&m_csAckQueue); + while(m_queuedAckRequests.size() > 0) + { + int smallId = m_queuedAckRequests.front(); + m_queuedAckRequests.pop(); + SQRNetworkPlayer *player = GetPlayerBySmallId(smallId); + if( player ) + { + LeaveCriticalSection(&m_csAckQueue); + player->WriteAck(); + EnterCriticalSection(&m_csAckQueue); + } + } + LeaveCriticalSection(&m_csAckQueue); +} \ No newline at end of file -- cgit v1.2.3