aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/Network/GameNetworkManager.cpp
diff options
context:
space:
mode:
authorlspepinho <162769565+lspepinho@users.noreply.github.com>2026-03-02 20:30:22 -0300
committerGitHub <noreply@github.com>2026-03-03 06:30:22 +0700
commit8b28c20d7adc3824f96fbcc34ad65d778a97a05b (patch)
treee61705a557e4e064d707ec542c53dbdac1acbe09 /Minecraft.Client/Common/Network/GameNetworkManager.cpp
parent15129932da9442c2815974c519258345b22d5588 (diff)
Fixes for PR #96 (#170)
* Implement basic multiplayer functionality * Update README.md --------- Co-authored-by: Slenderman <ssimulpong@outlook.com>
Diffstat (limited to 'Minecraft.Client/Common/Network/GameNetworkManager.cpp')
-rw-r--r--Minecraft.Client/Common/Network/GameNetworkManager.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/Minecraft.Client/Common/Network/GameNetworkManager.cpp b/Minecraft.Client/Common/Network/GameNetworkManager.cpp
index 940a148e..b3fb5cd7 100644
--- a/Minecraft.Client/Common/Network/GameNetworkManager.cpp
+++ b/Minecraft.Client/Common/Network/GameNetworkManager.cpp
@@ -167,6 +167,11 @@ bool CGameNetworkManager::_RunNetworkGame(LPVOID lpParameter)
return true;
}
}
+ else
+ {
+ // Client needs QNET_STATE_GAME_PLAY so that IsInGameplay() returns true
+ s_pPlatformNetworkManager->SetGamePlayState();
+ }
if( g_NetworkManager.IsLeavingGame() ) return false;
@@ -1479,7 +1484,10 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc
Minecraft *pMinecraft = Minecraft::GetInstance();
Socket *socket = NULL;
- shared_ptr<MultiplayerLocalPlayer> mpPlayer = pMinecraft->localplayers[pNetworkPlayer->GetUserIndex()];
+ shared_ptr<MultiplayerLocalPlayer> mpPlayer = nullptr;
+ int userIdx = pNetworkPlayer->GetUserIndex();
+ if (userIdx >= 0 && userIdx < XUSER_MAX_COUNT)
+ mpPlayer = pMinecraft->localplayers[userIdx];
if( localPlayer && mpPlayer != NULL && mpPlayer->connection != NULL)
{
// If we already have a MultiplayerLocalPlayer here then we are doing a session type change