mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Simplify IP censoring in dumps (#3330)
This commit is contained in:
parent
87f8cf9cea
commit
592b48dbf5
10 changed files with 56 additions and 132 deletions
|
@ -29,7 +29,6 @@ import lombok.Getter;
|
|||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||
import org.geysermc.geyser.text.AsteriskSerializer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
@ -52,15 +51,17 @@ public class GeyserBungeeDumpInfo extends BootstrapDumpInfo {
|
|||
this.plugins = new ArrayList<>();
|
||||
|
||||
for (net.md_5.bungee.api.config.ListenerInfo listener : proxy.getConfig().getListeners()) {
|
||||
String hostname = listener.getHost().getHostString();
|
||||
if (!AsteriskSerializer.showSensitive && !(hostname.equals("") || hostname.equals("0.0.0.0"))) {
|
||||
hostname = "***";
|
||||
}
|
||||
this.listeners.add(new ListenerInfo(hostname, listener.getHost().getPort()));
|
||||
this.listeners.add(new ListenerInfo(listener.getHost().getHostString(), listener.getHost().getPort()));
|
||||
}
|
||||
|
||||
for (Plugin plugin : proxy.getPluginManager().getPlugins()) {
|
||||
this.plugins.add(new PluginInfo(true, plugin.getDescription().getName(), plugin.getDescription().getVersion(), plugin.getDescription().getMain(), Collections.singletonList(plugin.getDescription().getAuthor())));
|
||||
this.plugins.add(new PluginInfo(
|
||||
true,
|
||||
plugin.getDescription().getName(),
|
||||
plugin.getDescription().getVersion(),
|
||||
plugin.getDescription().getMain(),
|
||||
Collections.singletonList(plugin.getDescription().getAuthor()))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue