Minor fixes; add CPU count to dump

This commit is contained in:
Camotoy 2021-12-03 20:26:20 -05:00
parent 66819aee83
commit f0213d4b8e
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
3 changed files with 10 additions and 4 deletions

View file

@ -36,17 +36,17 @@ import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.proxy.ProxyServer; import com.velocitypowered.api.proxy.ProxyServer;
import lombok.Getter; import lombok.Getter;
import org.geysermc.common.PlatformType; import org.geysermc.common.PlatformType;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.GeyserBootstrap; import org.geysermc.geyser.GeyserBootstrap;
import org.geysermc.geyser.session.auth.AuthType; import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.configuration.GeyserConfiguration; import org.geysermc.geyser.configuration.GeyserConfiguration;
import org.geysermc.geyser.dump.BootstrapDumpInfo; import org.geysermc.geyser.dump.BootstrapDumpInfo;
import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough; import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough;
import org.geysermc.geyser.ping.IGeyserPingPassthrough; import org.geysermc.geyser.ping.IGeyserPingPassthrough;
import org.geysermc.geyser.platform.velocity.command.GeyserVelocityCommandExecutor; import org.geysermc.geyser.platform.velocity.command.GeyserVelocityCommandExecutor;
import org.geysermc.geyser.platform.velocity.command.GeyserVelocityCommandManager; import org.geysermc.geyser.platform.velocity.command.GeyserVelocityCommandManager;
import org.geysermc.geyser.util.FileUtils; import org.geysermc.geyser.session.auth.AuthType;
import org.geysermc.geyser.text.GeyserLocale; import org.geysermc.geyser.text.GeyserLocale;
import org.geysermc.geyser.util.FileUtils;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger; import org.slf4j.Logger;

View file

@ -66,6 +66,7 @@ public class DumpInfo {
private static final long MEGABYTE = 1024L * 1024L; private static final long MEGABYTE = 1024L * 1024L;
private final DumpInfo.VersionInfo versionInfo; private final DumpInfo.VersionInfo versionInfo;
private final int cpuCount;
private Properties gitInfo; private Properties gitInfo;
private final GeyserConfiguration config; private final GeyserConfiguration config;
private final Floodgate floodgate; private final Floodgate floodgate;
@ -79,6 +80,8 @@ public class DumpInfo {
public DumpInfo(boolean addLog) { public DumpInfo(boolean addLog) {
this.versionInfo = new VersionInfo(); this.versionInfo = new VersionInfo();
this.cpuCount = Runtime.getRuntime().availableProcessors();
try (InputStream stream = GeyserImpl.getInstance().getBootstrap().getResource("git.properties")) { try (InputStream stream = GeyserImpl.getInstance().getBootstrap().getResource("git.properties")) {
this.gitInfo = new Properties(); this.gitInfo = new Properties();
this.gitInfo.load(stream); this.gitInfo.load(stream);

View file

@ -39,7 +39,7 @@ import java.util.StringJoiner;
/** /**
* Contains information about the supported protocols in Geyser. * Contains information about the supported protocols in Geyser.
*/ */
public class MinecraftProtocol { public final class MinecraftProtocol {
/** /**
* Default Bedrock codec that should act as a fallback. Should represent the latest available * Default Bedrock codec that should act as a fallback. Should represent the latest available
* release of the game that Geyser supports. * release of the game that Geyser supports.
@ -114,4 +114,7 @@ public class MinecraftProtocol {
return joiner.toString(); return joiner.toString();
} }
private MinecraftProtocol() {
}
} }