forked from GeyserMC/Geyser
Little changes
This commit is contained in:
parent
b12256bc1e
commit
1c48279a9f
4 changed files with 11 additions and 11 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue