mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Fixed transfering breaking on multiple versions
This commit is contained in:
parent
52eda4ccdd
commit
41a1a1db9b
4 changed files with 81 additions and 17 deletions
|
|
@ -618,7 +618,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
}
|
||||
}
|
||||
|
||||
public bool Login(PlayerKeyPair? playerKeyPair, SessionToken session)
|
||||
public bool Login(PlayerKeyPair? playerKeyPair, SessionToken session, bool isTransfer = false)
|
||||
{
|
||||
if (Handshake(handler.GetUserUuidStr(), handler.GetUsername(), handler.GetSessionID(), handler.GetServerHost(), handler.GetServerPort(), session))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3188,8 +3188,13 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
/// Do the Minecraft login.
|
||||
/// </summary>
|
||||
/// <returns>True if login successful</returns>
|
||||
public bool Login(PlayerKeyPair? playerKeyPair, SessionToken session)
|
||||
public bool Login(PlayerKeyPair? playerKeyPair, SessionToken session, bool isTransfer = false)
|
||||
{
|
||||
int nextState = isTransfer && protocolVersion >= MC_1_20_6_Version ? 3 : 2;
|
||||
|
||||
if (nextState == 3)
|
||||
log.Debug("Using transfer handshake intent for transferred login.");
|
||||
|
||||
// 1. Send the handshake packet
|
||||
SendPacket(0x00, dataTypes.ConcatBytes(
|
||||
// Protocol Version (use raw version for snapshot/RC servers)
|
||||
|
|
@ -3202,7 +3207,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
dataTypes.GetUShort((ushort)handler.GetServerPort()),
|
||||
|
||||
// Next State
|
||||
DataTypes.GetVarInt(2)) // 2 is for the Login state
|
||||
DataTypes.GetVarInt(nextState)) // 2 is Login, 3 is Transfer
|
||||
);
|
||||
|
||||
// 2. Send the Login Start packet
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue