Little changes

This commit is contained in:
Tim203 2019-11-30 18:38:09 +01:00
parent b12256bc1e
commit 1c48279a9f
4 changed files with 11 additions and 11 deletions

View file

@ -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;
}
}

View file

@ -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;

View file

@ -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

View file

@ -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")