Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-25 15:50:19 +01:00
Fix SpotBugs complaint
Dieser Commit ist enthalten in:
Ursprung
45752d5ea4
Commit
536049995d
@ -16,13 +16,10 @@ import com.velocitypowered.api.proxy.config.ProxyConfig;
|
|||||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||||
import com.velocitypowered.api.util.ProxyVersion;
|
import com.velocitypowered.api.util.ProxyVersion;
|
||||||
|
|
||||||
import io.netty.channel.unix.DomainSocketAddress;
|
|
||||||
|
|
||||||
import java.net.Inet4Address;
|
import java.net.Inet4Address;
|
||||||
import java.net.Inet6Address;
|
import java.net.Inet6Address;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.SocketAddress;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -170,9 +167,7 @@ public enum InformationUtils {
|
|||||||
public static JsonObject collectServerInfo(RegisteredServer server) {
|
public static JsonObject collectServerInfo(RegisteredServer server) {
|
||||||
JsonObject info = new JsonObject();
|
JsonObject info = new JsonObject();
|
||||||
info.addProperty("currentPlayers", server.getPlayersConnected().size());
|
info.addProperty("currentPlayers", server.getPlayersConnected().size());
|
||||||
SocketAddress address = server.getServerInfo().getAddress();
|
InetSocketAddress iaddr = server.getServerInfo().getAddress();
|
||||||
if (address instanceof InetSocketAddress) {
|
|
||||||
InetSocketAddress iaddr = (InetSocketAddress) address;
|
|
||||||
if (iaddr.isUnresolved()) {
|
if (iaddr.isUnresolved()) {
|
||||||
// Greetings form Netty 4aa10db9
|
// Greetings form Netty 4aa10db9
|
||||||
info.addProperty("host", iaddr.getHostString());
|
info.addProperty("host", iaddr.getHostString());
|
||||||
@ -180,12 +175,6 @@ public enum InformationUtils {
|
|||||||
info.addProperty("host", anonymizeInetAddress(iaddr.getAddress()));
|
info.addProperty("host", anonymizeInetAddress(iaddr.getAddress()));
|
||||||
}
|
}
|
||||||
info.addProperty("port", iaddr.getPort());
|
info.addProperty("port", iaddr.getPort());
|
||||||
} else if (address instanceof DomainSocketAddress) {
|
|
||||||
DomainSocketAddress daddr = (DomainSocketAddress) address;
|
|
||||||
info.addProperty("path", daddr.path());
|
|
||||||
} else {
|
|
||||||
info.addProperty("info", address.toString());
|
|
||||||
}
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren