Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 16:12:46 +01:00
Replace instances of configs using generateduuid
for Metrics
Dieser Commit ist enthalten in:
Ursprung
af08488d1e
Commit
137eb3ece8
@ -35,9 +35,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
|
import org.geysermc.geyser.network.CIDRMatcher;
|
||||||
import org.geysermc.geyser.session.auth.AuthType;
|
import org.geysermc.geyser.session.auth.AuthType;
|
||||||
import org.geysermc.geyser.text.AsteriskSerializer;
|
import org.geysermc.geyser.text.AsteriskSerializer;
|
||||||
import org.geysermc.geyser.network.CIDRMatcher;
|
|
||||||
import org.geysermc.geyser.text.GeyserLocale;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -240,8 +240,21 @@ public abstract class GeyserJacksonConfiguration implements GeyserConfiguration
|
|||||||
public static class MetricsInfo implements IMetricsInfo {
|
public static class MetricsInfo implements IMetricsInfo {
|
||||||
private boolean enabled = true;
|
private boolean enabled = true;
|
||||||
|
|
||||||
|
@JsonDeserialize(using = MetricsIdDeserializer.class)
|
||||||
@JsonProperty("uuid")
|
@JsonProperty("uuid")
|
||||||
private String uniqueId = UUID.randomUUID().toString();
|
private String uniqueId = UUID.randomUUID().toString();
|
||||||
|
|
||||||
|
private static class MetricsIdDeserializer extends JsonDeserializer<String> {
|
||||||
|
@Override
|
||||||
|
public String deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
|
||||||
|
String uuid = p.getValueAsString();
|
||||||
|
if ("generateduuid".equals(uuid)) {
|
||||||
|
// Compensate for configs not copied from the jar
|
||||||
|
return UUID.randomUUID().toString();
|
||||||
|
}
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonProperty("scoreboard-packet-threshold")
|
@JsonProperty("scoreboard-packet-threshold")
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren