From 1c48279a9fd6144f09f6f5bad7a8a691049d800c Mon Sep 17 00:00:00 2001 From: Tim203 Date: Sat, 30 Nov 2019 18:38:09 +0100 Subject: [PATCH] Little changes --- api/src/main/java/org/geysermc/api/AuthType.java | 14 +++++--------- .../org/geysermc/connector/GeyserConnector.java | 2 +- .../connector/network/session/GeyserSession.java | 4 ++++ .../network/session/auth/BedrockClientData.java | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/api/src/main/java/org/geysermc/api/AuthType.java b/api/src/main/java/org/geysermc/api/AuthType.java index 55d97c20..6364ba15 100644 --- a/api/src/main/java/org/geysermc/api/AuthType.java +++ b/api/src/main/java/org/geysermc/api/AuthType.java @@ -1,27 +1,23 @@ package org.geysermc.api; -import lombok.AllArgsConstructor; import lombok.Getter; -@AllArgsConstructor @Getter public enum AuthType { - OFFLINE("offline"), - ONLINE("online"), - FLOODGATE("floodgate"); + OFFLINE, + ONLINE, + FLOODGATE; public static final AuthType[] VALUES = values(); - private String name; - public static AuthType getById(int id) { return id < VALUES.length ? VALUES[id] : OFFLINE; } public static AuthType getByName(String name) { - String lowerCase = name.toLowerCase(); + String upperCase = name.toUpperCase(); for (AuthType type : VALUES) { - if (type.getName().equals(lowerCase)) { + if (type.name().equals(upperCase)) { return type; } } diff --git a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java index 3b7b1a70..5ec21476 100644 --- a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java +++ b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java @@ -158,7 +158,7 @@ public class GeyserConnector implements Connector { metrics = new Metrics("GeyserMC", config.getMetrics().getUUID(), false, java.util.logging.Logger.getLogger("")); metrics.addCustomChart(new Metrics.SingleLineChart("servers", () -> 1)); metrics.addCustomChart(new Metrics.SingleLineChart("players", Geyser::getPlayerCount)); - metrics.addCustomChart(new Metrics.SimplePie("authMode", getAuthType()::getName)); + metrics.addCustomChart(new Metrics.SimplePie("authMode", getAuthType()::name)); } double completeTime = (System.currentTimeMillis() - startupTime) / 1000D; diff --git a/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java b/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java index fc1e687d..e748d2a1 100644 --- a/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java +++ b/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java @@ -198,6 +198,10 @@ public class GeyserSession implements Player { publicKey = key; } else publicKey = null; + if (publicKey != null) { + connector.getLogger().info("Loaded Floodgate key!"); + } + downstream = new Client(remoteServer.getAddress(), remoteServer.getPort(), protocol, new TcpSessionFactory()); downstream.getSession().addListener(new SessionAdapter() { @Override diff --git a/connector/src/main/java/org/geysermc/connector/network/session/auth/BedrockClientData.java b/connector/src/main/java/org/geysermc/connector/network/session/auth/BedrockClientData.java index 9e7345ce..574ba544 100644 --- a/connector/src/main/java/org/geysermc/connector/network/session/auth/BedrockClientData.java +++ b/connector/src/main/java/org/geysermc/connector/network/session/auth/BedrockClientData.java @@ -37,7 +37,7 @@ public class BedrockClientData { private boolean premiumSkin; @JsonProperty(value = "DeviceId") - private UUID deviceId; + private String deviceId; @JsonProperty(value = "DeviceModel") private String deviceModel; @JsonProperty(value = "DeviceOS")