Implement browser sign-in method (#1447)

* Implement browser sign-in method

* Handle empty link

* Improve

* Handle user cancel login
This commit is contained in:
ReinforceZwei 2021-02-06 09:29:14 +08:00 committed by GitHub
parent 424f514be2
commit 71eb1dca17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 124 additions and 8 deletions

View file

@ -26,6 +26,7 @@ namespace MinecraftClient
public static string Username = "";
public static string Password = "";
public static ProtocolHandler.AccountType AccountType = ProtocolHandler.AccountType.Mojang;
public static string LoginMethod = "mcc";
public static string ServerIP = "";
public static ushort ServerPort = 25565;
public static string ServerVersion = "";
@ -277,6 +278,9 @@ namespace MinecraftClient
case "type": AccountType = argValue == "mojang"
? ProtocolHandler.AccountType.Mojang
: ProtocolHandler.AccountType.Microsoft; break;
case "method": LoginMethod = argValue.ToLower() == "browser"
? "browser"
: "mcc"; break;
case "serverip": if (!SetServerIP(argValue)) serverAlias = argValue; ; break;
case "singlecommand": SingleCommand = argValue; break;
case "language": Language = argValue; break;