Update for MCAuthLib changes.

This commit is contained in:
Steveice10 2020-06-01 13:05:55 -07:00
parent 701fa0d7b0
commit 706ba62990
4 changed files with 9 additions and 4 deletions

View file

@ -68,7 +68,7 @@
<dependency>
<groupId>com.github.steveice10</groupId>
<artifactId>mcauthlib</artifactId>
<version>401c99c722</version>
<version>1058d78fd5</version>
<scope>compile</scope>
</dependency>
<dependency>

View file

@ -56,7 +56,9 @@ public class ClientListener extends SessionAdapter {
throw new IllegalStateException("Failed to generate shared key.", e);
}
SessionService sessionService = new SessionService(event.getSession().getFlag(MinecraftConstants.AUTH_PROXY_KEY, Proxy.NO_PROXY));
SessionService sessionService = new SessionService();
sessionService.setProxy(event.getSession().getFlag(MinecraftConstants.AUTH_PROXY_KEY, Proxy.NO_PROXY));
GameProfile profile = event.getSession().getFlag(MinecraftConstants.PROFILE_KEY);
String serverId = sessionService.getServerId(packet.getServerId(), packet.getPublicKey(), key);
String accessToken = event.getSession().getFlag(MinecraftConstants.ACCESS_TOKEN_KEY);

View file

@ -228,7 +228,8 @@ public class MinecraftProtocol extends PacketProtocol {
private MinecraftProtocol(String username, String clientToken, String using, boolean token, Proxy authProxy) throws RequestException {
this(SubProtocol.LOGIN);
AuthenticationService auth = new AuthenticationService(clientToken, authProxy);
AuthenticationService auth = new AuthenticationService(clientToken);
auth.setProxy(authProxy);
auth.setUsername(username);
if(token) {
auth.setAccessToken(using);

View file

@ -190,7 +190,9 @@ public class ServerListener extends SessionAdapter {
public void run() {
GameProfile profile = null;
if(this.key != null) {
SessionService sessionService = new SessionService(this.session.getFlag(MinecraftConstants.AUTH_PROXY_KEY, Proxy.NO_PROXY));
SessionService sessionService = new SessionService();
sessionService.setProxy(this.session.getFlag(MinecraftConstants.AUTH_PROXY_KEY, Proxy.NO_PROXY));
try {
profile = sessionService.getProfileByServer(username, sessionService.getServerId(SERVER_ID, KEY_PAIR.getPublic(), this.key));
} catch(RequestException e) {