Add native info to dump

This commit is contained in:
Andrew Steinborn 2023-01-01 11:30:39 -05:00
parent 118c4b451c
commit 4ef9a33f4c
2 changed files with 11 additions and 1 deletions

View File

@ -35,7 +35,7 @@ import io.netty.channel.socket.nio.NioSocketChannel;
import java.util.concurrent.ThreadFactory;
import java.util.function.BiFunction;
enum TransportType {
public enum TransportType {
NIO("NIO", NioServerSocketChannel::new,
NioSocketChannel::new,
NioDatagramChannel::new,

View File

@ -32,6 +32,8 @@ import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.proxy.config.ProxyConfig;
import com.velocitypowered.api.proxy.server.RegisteredServer;
import com.velocitypowered.api.util.ProxyVersion;
import com.velocitypowered.natives.util.Natives;
import com.velocitypowered.proxy.network.TransportType;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
@ -102,6 +104,14 @@ public enum InformationUtils {
envInfo.addProperty("operatingSystemArchitecture", System.getProperty("os.arch"));
envInfo.addProperty("javaVersion", System.getProperty("java.version"));
envInfo.addProperty("javaVendor", System.getProperty("java.vendor"));
JsonObject listenerInfo = new JsonObject();
listenerInfo.addProperty("listenerType", TransportType.bestType().toString());
listenerInfo.addProperty("compression", Natives.compress.getLoadedVariant());
listenerInfo.addProperty("encryption", Natives.cipher.getLoadedVariant());
envInfo.add("listener", listenerInfo);
return envInfo;
}