Fix 1.19.3 key exchange in offline mode

This commit is contained in:
BruceChen 2023-01-17 20:16:35 +08:00
parent 92a911ce99
commit 1f54a7c247
5 changed files with 12 additions and 6 deletions

View file

@ -367,7 +367,7 @@ namespace MinecraftClient.Protocol.Handlers
SendPacket(PacketTypesOut.Pong, packetData);
break;
case PacketTypesIn.JoinGame:
handler.OnGameJoined();
handler.OnGameJoined(isOnlineMode);
int playerEntityID = dataTypes.ReadNextInt(packetData);
handler.OnReceivePlayerEntityID(playerEntityID);
@ -3383,7 +3383,7 @@ namespace MinecraftClient.Protocol.Handlers
public bool SendPlayerSession(PlayerKeyPair? playerKeyPair)
{
if (playerKeyPair == null)
if (playerKeyPair == null || !isOnlineMode)
return false;
if (protocolVersion >= MC_1_19_3_Version)