diff --git a/pom.xml b/pom.xml index 20605f61..b4620686 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ com.github.steveice10 mcauthlib - 401c99c722 + 1058d78fd5 compile diff --git a/src/main/java/com/github/steveice10/mc/protocol/ClientListener.java b/src/main/java/com/github/steveice10/mc/protocol/ClientListener.java index d34bf41d..a9df0dd8 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/ClientListener.java +++ b/src/main/java/com/github/steveice10/mc/protocol/ClientListener.java @@ -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); diff --git a/src/main/java/com/github/steveice10/mc/protocol/MinecraftProtocol.java b/src/main/java/com/github/steveice10/mc/protocol/MinecraftProtocol.java index a1a9d9d1..3d7806d6 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/MinecraftProtocol.java +++ b/src/main/java/com/github/steveice10/mc/protocol/MinecraftProtocol.java @@ -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); diff --git a/src/main/java/com/github/steveice10/mc/protocol/ServerListener.java b/src/main/java/com/github/steveice10/mc/protocol/ServerListener.java index 6913dc97..8caff589 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/ServerListener.java +++ b/src/main/java/com/github/steveice10/mc/protocol/ServerListener.java @@ -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) {