mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-12-19 14:59:27 +00:00
Indicate 1.21.112/1.21.113 support, track server platform types in bstats metrics
This commit is contained in:
@@ -15,7 +15,7 @@ The ultimate goal of this project is to allow Minecraft: Bedrock Edition users t
|
||||
Special thanks to the DragonProxy project for being a trailblazer in protocol translation and for all the team members who have joined us here!
|
||||
|
||||
## Supported Versions
|
||||
Geyser is currently supporting Minecraft Bedrock 1.21.90 - 1.21.110 and Minecraft Java 1.21.9 - 1.21.10. For more information, please see [here](https://geysermc.org/wiki/geyser/supported-versions/).
|
||||
Geyser is currently supporting Minecraft Bedrock 1.21.90 - 1.21.113 and Minecraft Java 1.21.9 - 1.21.10. For more information, please see [here](https://geysermc.org/wiki/geyser/supported-versions/).
|
||||
|
||||
## Setting Up
|
||||
Take a look [here](https://geysermc.org/wiki/geyser/setup/) for how to set up Geyser.
|
||||
|
||||
@@ -271,6 +271,11 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap {
|
||||
return Paths.get(getProxy().getName().equals("BungeeCord") ? "proxy.log.0" : "logs/latest.log");
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull String getServerPlatform() {
|
||||
return getProxy().getName();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public SocketAddress getSocketAddress() {
|
||||
|
||||
@@ -238,4 +238,9 @@ public abstract class GeyserModBootstrap implements GeyserBootstrap {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull String getServerPlatform() {
|
||||
return server.getServerModName();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -402,6 +402,11 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap {
|
||||
return this.minecraftVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull String getServerPlatform() {
|
||||
return Bukkit.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SocketAddress getSocketAddress() {
|
||||
return this.geyserInjector.getServerSocketAddress();
|
||||
|
||||
@@ -314,6 +314,11 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
|
||||
return new GeyserStandaloneDumpInfo(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull String getServerPlatform() {
|
||||
return PlatformType.STANDALONE.platformName();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getServerBindAddress() {
|
||||
|
||||
@@ -230,6 +230,11 @@ public class GeyserVelocityPlugin implements GeyserBootstrap {
|
||||
return new GeyserVelocityDumpInfo(proxyServer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull String getServerPlatform() {
|
||||
return proxyServer.getVersion().getName();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public SocketAddress getSocketAddress() {
|
||||
|
||||
@@ -230,6 +230,11 @@ public class GeyserViaProxyPlugin extends ViaProxyPlugin implements GeyserBootst
|
||||
return new GeyserViaProxyDumpInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull String getServerPlatform() {
|
||||
return PlatformType.VIAPROXY.platformName();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getServerBindAddress() {
|
||||
|
||||
@@ -149,6 +149,11 @@ public interface GeyserBootstrap {
|
||||
return Paths.get("logs/latest.log");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the name of the server platform Geyser is running on.
|
||||
*/
|
||||
@NonNull String getServerPlatform();
|
||||
|
||||
/**
|
||||
* Get an InputStream for the given resource path.
|
||||
* Overridden on platforms that have different class loader properties.
|
||||
|
||||
@@ -482,7 +482,18 @@ public class GeyserImpl implements GeyserApi, EventRegistrar {
|
||||
metrics.addCustomChart(new Metrics.SingleLineChart("players", sessionManager::size));
|
||||
// Prevent unwanted words best we can
|
||||
metrics.addCustomChart(new Metrics.SimplePie("authMode", () -> config.getRemote().authType().toString().toLowerCase(Locale.ROOT)));
|
||||
metrics.addCustomChart(new Metrics.SimplePie("platform", platformType::platformName));
|
||||
|
||||
Map<String, Map<String, Integer>> platformTypeMap = new HashMap<>();
|
||||
Map<String, Integer> serverPlatform = new HashMap<>();
|
||||
serverPlatform.put(bootstrap.getServerPlatform(), 1);
|
||||
platformTypeMap.put(platformType().platformName(), serverPlatform);
|
||||
|
||||
metrics.addCustomChart(new Metrics.DrilldownPie("platform", () -> {
|
||||
// By the end, we should return, for example:
|
||||
// Geyser-Spigot => (Paper, 1)
|
||||
return platformTypeMap;
|
||||
}));
|
||||
|
||||
metrics.addCustomChart(new Metrics.SimplePie("defaultLocale", GeyserLocale::getDefaultLocale));
|
||||
metrics.addCustomChart(new Metrics.SimplePie("version", () -> GeyserImpl.VERSION));
|
||||
metrics.addCustomChart(new Metrics.SimplePie("javaHaProxyProtocol", () -> String.valueOf(config.getRemote().isUseProxyProtocol())));
|
||||
@@ -520,7 +531,7 @@ public class GeyserImpl implements GeyserApi, EventRegistrar {
|
||||
if (minecraftVersion != null) {
|
||||
Map<String, Map<String, Integer>> versionMap = new HashMap<>();
|
||||
Map<String, Integer> platformMap = new HashMap<>();
|
||||
platformMap.put(platformType.platformName(), 1);
|
||||
platformMap.put(bootstrap.getServerPlatform(), 1);
|
||||
versionMap.put(minecraftVersion, platformMap);
|
||||
|
||||
metrics.addCustomChart(new Metrics.DrilldownPie("minecraftServerVersion", () -> {
|
||||
|
||||
@@ -55,6 +55,7 @@ import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -87,7 +88,7 @@ public class DumpInfo {
|
||||
this.cpuCount = Runtime.getRuntime().availableProcessors();
|
||||
this.cpuName = CpuUtils.tryGetProcessorName();
|
||||
this.systemLocale = Locale.getDefault();
|
||||
this.systemEncoding = System.getProperty("file.encoding");
|
||||
this.systemEncoding = Charset.defaultCharset().displayName();
|
||||
|
||||
this.gitInfo = new GitInfo(GeyserImpl.BUILD_NUMBER, GeyserImpl.COMMIT.substring(0, 7), GeyserImpl.COMMIT, GeyserImpl.BRANCH, GeyserImpl.REPOSITORY);
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public final class GameProtocol {
|
||||
register(Bedrock_v818.CODEC, "1.21.90", "1.21.91", "1.21.92");
|
||||
register(Bedrock_v819.CODEC, "1.21.93", "1.21.94");
|
||||
register(Bedrock_v827.CODEC, "1.21.100", "1.21.101");
|
||||
register(Bedrock_v844.CODEC, "1.21.111");
|
||||
register(Bedrock_v844.CODEC, "1.21.111", "1.21.112", "1.21.113");
|
||||
|
||||
MinecraftVersion latestBedrock = SUPPORTED_BEDROCK_VERSIONS.get(SUPPORTED_BEDROCK_VERSIONS.size() - 1);
|
||||
DEFAULT_BEDROCK_VERSION = latestBedrock.versionString();
|
||||
|
||||
Reference in New Issue
Block a user