mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2025-01-06 04:32:02 -05:00
Update for MCAuthLib changes.
This commit is contained in:
parent
701fa0d7b0
commit
706ba62990
4 changed files with 9 additions and 4 deletions
2
pom.xml
2
pom.xml
|
@ -68,7 +68,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.steveice10</groupId>
|
<groupId>com.github.steveice10</groupId>
|
||||||
<artifactId>mcauthlib</artifactId>
|
<artifactId>mcauthlib</artifactId>
|
||||||
<version>401c99c722</version>
|
<version>1058d78fd5</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -56,7 +56,9 @@ public class ClientListener extends SessionAdapter {
|
||||||
throw new IllegalStateException("Failed to generate shared key.", e);
|
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);
|
GameProfile profile = event.getSession().getFlag(MinecraftConstants.PROFILE_KEY);
|
||||||
String serverId = sessionService.getServerId(packet.getServerId(), packet.getPublicKey(), key);
|
String serverId = sessionService.getServerId(packet.getServerId(), packet.getPublicKey(), key);
|
||||||
String accessToken = event.getSession().getFlag(MinecraftConstants.ACCESS_TOKEN_KEY);
|
String accessToken = event.getSession().getFlag(MinecraftConstants.ACCESS_TOKEN_KEY);
|
||||||
|
|
|
@ -228,7 +228,8 @@ public class MinecraftProtocol extends PacketProtocol {
|
||||||
private MinecraftProtocol(String username, String clientToken, String using, boolean token, Proxy authProxy) throws RequestException {
|
private MinecraftProtocol(String username, String clientToken, String using, boolean token, Proxy authProxy) throws RequestException {
|
||||||
this(SubProtocol.LOGIN);
|
this(SubProtocol.LOGIN);
|
||||||
|
|
||||||
AuthenticationService auth = new AuthenticationService(clientToken, authProxy);
|
AuthenticationService auth = new AuthenticationService(clientToken);
|
||||||
|
auth.setProxy(authProxy);
|
||||||
auth.setUsername(username);
|
auth.setUsername(username);
|
||||||
if(token) {
|
if(token) {
|
||||||
auth.setAccessToken(using);
|
auth.setAccessToken(using);
|
||||||
|
|
|
@ -190,7 +190,9 @@ public class ServerListener extends SessionAdapter {
|
||||||
public void run() {
|
public void run() {
|
||||||
GameProfile profile = null;
|
GameProfile profile = null;
|
||||||
if(this.key != 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 {
|
try {
|
||||||
profile = sessionService.getProfileByServer(username, sessionService.getServerId(SERVER_ID, KEY_PAIR.getPublic(), this.key));
|
profile = sessionService.getProfileByServer(username, sessionService.getServerId(SERVER_ID, KEY_PAIR.getPublic(), this.key));
|
||||||
} catch(RequestException e) {
|
} catch(RequestException e) {
|
||||||
|
|
Loading…
Reference in a new issue