mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Restore ability to login with microsoft broken after yggdrasil login implementation
This commit is contained in:
parent
1c17da2665
commit
ceff78a821
3 changed files with 6 additions and 4 deletions
|
|
@ -538,7 +538,8 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
|
|
||||||
if (needCheckSession)
|
if (needCheckSession)
|
||||||
{
|
{
|
||||||
if ((type == LoginType.mojang && ProtocolHandler.SessionCheck(uuid, sessionID, serverHash)) || (type == LoginType.yggdrasil && ProtocolHandler.YggdrasilSessionCheck(uuid, sessionID, serverHash)))
|
bool notYggdrasil = type == LoginType.mojang || type == LoginType.microsoft;
|
||||||
|
if ((notYggdrasil && ProtocolHandler.SessionCheck(uuid, sessionID, serverHash)) || (type == LoginType.yggdrasil && ProtocolHandler.YggdrasilSessionCheck(uuid, sessionID, serverHash)))
|
||||||
{
|
{
|
||||||
session.ServerIDhash = serverIDhash;
|
session.ServerIDhash = serverIDhash;
|
||||||
session.ServerPublicKey = serverPublicKey;
|
session.ServerPublicKey = serverPublicKey;
|
||||||
|
|
|
||||||
|
|
@ -2619,8 +2619,8 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
if (needCheckSession)
|
if (needCheckSession)
|
||||||
{
|
{
|
||||||
string serverHash = CryptoHandler.GetServerHash(serverIDhash, serverPublicKey, secretKey);
|
string serverHash = CryptoHandler.GetServerHash(serverIDhash, serverPublicKey, secretKey);
|
||||||
|
bool notYggdrasil = type == LoginType.mojang || type == LoginType.microsoft;
|
||||||
if ((type == LoginType.mojang && ProtocolHandler.SessionCheck(uuid, sessionID, serverHash) )|| (type == LoginType.yggdrasil && ProtocolHandler.YggdrasilSessionCheck(uuid, sessionID, serverHash)))
|
if ((notYggdrasil && ProtocolHandler.SessionCheck(uuid, sessionID, serverHash) )|| (type == LoginType.yggdrasil && ProtocolHandler.YggdrasilSessionCheck(uuid, sessionID, serverHash)))
|
||||||
{
|
{
|
||||||
session.ServerIDhash = serverIDhash;
|
session.ServerIDhash = serverIDhash;
|
||||||
session.ServerPublicKey = serverPublicKey;
|
session.ServerPublicKey = serverPublicKey;
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,8 @@ namespace MinecraftClient.Protocol.Session
|
||||||
return false;
|
return false;
|
||||||
Crypto.CryptoHandler.ClientAESPrivateKey ??= Crypto.CryptoHandler.GenerateAESPrivateKey();
|
Crypto.CryptoHandler.ClientAESPrivateKey ??= Crypto.CryptoHandler.GenerateAESPrivateKey();
|
||||||
string serverHash = Crypto.CryptoHandler.GetServerHash(ServerIDhash, ServerPublicKey, Crypto.CryptoHandler.ClientAESPrivateKey);
|
string serverHash = Crypto.CryptoHandler.GetServerHash(ServerIDhash, ServerPublicKey, Crypto.CryptoHandler.ClientAESPrivateKey);
|
||||||
if (type == LoginType.mojang && ProtocolHandler.SessionCheck(PlayerID, ID, serverHash))
|
bool notYggdrasil = type == LoginType.mojang || type == LoginType.microsoft;
|
||||||
|
if (notYggdrasil && ProtocolHandler.SessionCheck(PlayerID, ID, serverHash))
|
||||||
return true;
|
return true;
|
||||||
if (type == LoginType.yggdrasil && ProtocolHandler.YggdrasilSessionCheck(PlayerID, ID, serverHash))
|
if (type == LoginType.yggdrasil && ProtocolHandler.YggdrasilSessionCheck(PlayerID, ID, serverHash))
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue