Removed client token from MinecraftProtocol

This commit is contained in:
MatteCarra 2020-12-16 15:22:36 +01:00
parent e1db422a34
commit 95ba884563

View file

@ -191,12 +191,6 @@ public class MinecraftProtocol extends PacketProtocol {
@Getter @Getter
private GameProfile profile = null; private GameProfile profile = null;
/**
* Authentication client token.
*/
@Getter
private String clientToken = "";
/** /**
* Authentication access token. * Authentication access token.
*/ */
@ -240,6 +234,7 @@ public class MinecraftProtocol extends PacketProtocol {
* @param password Password to log in with. * @param password Password to log in with.
* @throws RequestException If the log in request fails. * @throws RequestException If the log in request fails.
*/ */
@Deprecated
public MinecraftProtocol(String username, String password) throws RequestException { public MinecraftProtocol(String username, String password) throws RequestException {
this(createAuthServiceForPasswordLogin(username, password)); this(createAuthServiceForPasswordLogin(username, password));
} }
@ -251,6 +246,7 @@ public class MinecraftProtocol extends PacketProtocol {
* @param accessToken Access token to log in with. * @param accessToken Access token to log in with.
* @throws RequestException If the log in request fails. * @throws RequestException If the log in request fails.
*/ */
@Deprecated
public MinecraftProtocol(String username, String clientToken, String accessToken) throws RequestException { public MinecraftProtocol(String username, String clientToken, String accessToken) throws RequestException {
this(createAuthServiceForTokenLogin(username, clientToken, accessToken)); this(createAuthServiceForTokenLogin(username, clientToken, accessToken));
} }
@ -261,7 +257,7 @@ public class MinecraftProtocol extends PacketProtocol {
* @param authService {@link AuthenticationService} to copy from. * @param authService {@link AuthenticationService} to copy from.
*/ */
public MinecraftProtocol(AuthenticationService authService) { public MinecraftProtocol(AuthenticationService authService) {
this(authService.getSelectedProfile(), authService.getClientToken(), authService.getAccessToken()); this(authService.getSelectedProfile(), authService.getAccessToken());
} }
/** /**
@ -270,10 +266,21 @@ public class MinecraftProtocol extends PacketProtocol {
* @param clientToken Client token to use. * @param clientToken Client token to use.
* @param accessToken Access token to use. * @param accessToken Access token to use.
*/ */
@Deprecated
public MinecraftProtocol(GameProfile profile, String clientToken, String accessToken) { public MinecraftProtocol(GameProfile profile, String clientToken, String accessToken) {
this(SubProtocol.LOGIN); this(SubProtocol.LOGIN);
this.profile = profile; this.profile = profile;
this.clientToken = clientToken; this.accessToken = accessToken;
}
/**
* Constructs a new MinecraftProtocol from authentication information.
* @param profile GameProfile to use.
* @param accessToken Access token to use.
*/
public MinecraftProtocol(GameProfile profile, String accessToken) {
this(SubProtocol.LOGIN);
this.profile = profile;
this.accessToken = accessToken; this.accessToken = accessToken;
} }