mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
clienttoken is created (if not passed) and added to auth request, then returned
This commit is contained in:
parent
8c065320c2
commit
2861be757f
1 changed files with 6 additions and 2 deletions
|
|
@ -151,12 +151,16 @@ namespace MinecraftClient.Protocol
|
||||||
/// <param name="uuid">Will contain the player's UUID, needed for multiplayer</param>
|
/// <param name="uuid">Will contain the player's UUID, needed for multiplayer</param>
|
||||||
/// <returns>Returns the status of the login (Success, Failure, etc.)</returns>
|
/// <returns>Returns the status of the login (Success, Failure, etc.)</returns>
|
||||||
|
|
||||||
public static LoginResult GetLogin(ref string user, string pass, ref string accesstoken, ref string uuid)
|
public static LoginResult GetLogin(ref string user, string pass, ref string accesstoken, ref string clienttoken, ref string uuid)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string result = "";
|
string result = "";
|
||||||
string json_request = "{\"agent\": { \"name\": \"Minecraft\", \"version\": 1 }, \"username\": \"" + jsonEncode(user) + "\", \"password\": \"" + jsonEncode(pass) + "\" }";
|
if (clienttoken == string.Empty)
|
||||||
|
{
|
||||||
|
clienttoken = Guid.NewGuid().ToString();
|
||||||
|
}
|
||||||
|
string json_request = "{\"agent\": { \"name\": \"Minecraft\", \"version\": 1 }, \"username\": \"" + jsonEncode(user) + "\", \"password\": \"" + jsonEncode(pass) + "\", \"clientToken\": \"" + jsonEncode(clienttoken) + "\" }";
|
||||||
int code = doHTTPSPost("authserver.mojang.com", "/authenticate", json_request, ref result);
|
int code = doHTTPSPost("authserver.mojang.com", "/authenticate", json_request, ref result);
|
||||||
if (code == 200)
|
if (code == 200)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue