mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Fix 1.19.3 key exchange in offline mode
This commit is contained in:
parent
92a911ce99
commit
1f54a7c247
5 changed files with 12 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ namespace MinecraftClient.Protocol
|
|||
/// <summary>
|
||||
/// Called when a server was successfully joined
|
||||
/// </summary>
|
||||
void OnGameJoined();
|
||||
void OnGameJoined(bool isOnlineMode);
|
||||
|
||||
/// <summary>
|
||||
/// Received chat/system message from the server
|
||||
|
|
|
|||
|
|
@ -24,6 +24,12 @@ namespace MinecraftClient.Protocol.ProfileKey
|
|||
|
||||
if (!string.IsNullOrEmpty(sigV2))
|
||||
SignatureV2 = Convert.FromBase64String(sigV2!);
|
||||
|
||||
if (SignatureV2 == null || SignatureV2.Length == 0)
|
||||
SignatureV2 = Signature;
|
||||
|
||||
if (Signature == null || Signature.Length == 0)
|
||||
Signature = SignatureV2;
|
||||
}
|
||||
|
||||
public PublicKey(byte[] key, byte[] signature)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue