3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-10-05 09:20:07 +02:00
Dieser Commit ist enthalten in:
Tim203 2019-11-30 18:38:09 +01:00
Ursprung b12256bc1e
Commit 1c48279a9f
4 geänderte Dateien mit 11 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -1,27 +1,23 @@
package org.geysermc.api; package org.geysermc.api;
import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@AllArgsConstructor
@Getter @Getter
public enum AuthType { public enum AuthType {
OFFLINE("offline"), OFFLINE,
ONLINE("online"), ONLINE,
FLOODGATE("floodgate"); FLOODGATE;
public static final AuthType[] VALUES = values(); public static final AuthType[] VALUES = values();
private String name;
public static AuthType getById(int id) { public static AuthType getById(int id) {
return id < VALUES.length ? VALUES[id] : OFFLINE; return id < VALUES.length ? VALUES[id] : OFFLINE;
} }
public static AuthType getByName(String name) { public static AuthType getByName(String name) {
String lowerCase = name.toLowerCase(); String upperCase = name.toUpperCase();
for (AuthType type : VALUES) { for (AuthType type : VALUES) {
if (type.getName().equals(lowerCase)) { if (type.name().equals(upperCase)) {
return type; return type;
} }
} }

Datei anzeigen

@ -158,7 +158,7 @@ public class GeyserConnector implements Connector {
metrics = new Metrics("GeyserMC", config.getMetrics().getUUID(), false, java.util.logging.Logger.getLogger("")); 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("servers", () -> 1));
metrics.addCustomChart(new Metrics.SingleLineChart("players", Geyser::getPlayerCount)); 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; double completeTime = (System.currentTimeMillis() - startupTime) / 1000D;

Datei anzeigen

@ -198,6 +198,10 @@ public class GeyserSession implements Player {
publicKey = key; publicKey = key;
} else publicKey = null; } else publicKey = null;
if (publicKey != null) {
connector.getLogger().info("Loaded Floodgate key!");
}
downstream = new Client(remoteServer.getAddress(), remoteServer.getPort(), protocol, new TcpSessionFactory()); downstream = new Client(remoteServer.getAddress(), remoteServer.getPort(), protocol, new TcpSessionFactory());
downstream.getSession().addListener(new SessionAdapter() { downstream.getSession().addListener(new SessionAdapter() {
@Override @Override

Datei anzeigen

@ -37,7 +37,7 @@ public class BedrockClientData {
private boolean premiumSkin; private boolean premiumSkin;
@JsonProperty(value = "DeviceId") @JsonProperty(value = "DeviceId")
private UUID deviceId; private String deviceId;
@JsonProperty(value = "DeviceModel") @JsonProperty(value = "DeviceModel")
private String deviceModel; private String deviceModel;
@JsonProperty(value = "DeviceOS") @JsonProperty(value = "DeviceOS")