Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-09-08 12:32:53 +02:00
Move leak detector to standalone bootstrap class
Dieser Commit ist enthalten in:
Ursprung
39324ce95d
Commit
1a0ac26398
@ -30,6 +30,7 @@ import com.fasterxml.jackson.databind.JavaType;
|
|||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.introspect.AnnotatedField;
|
import com.fasterxml.jackson.databind.introspect.AnnotatedField;
|
||||||
import com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition;
|
import com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition;
|
||||||
|
import io.netty.util.ResourceLeakDetector;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.minecrell.terminalconsole.TerminalConsoleAppender;
|
import net.minecrell.terminalconsole.TerminalConsoleAppender;
|
||||||
import org.apache.logging.log4j.Level;
|
import org.apache.logging.log4j.Level;
|
||||||
@ -80,6 +81,10 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
|
|||||||
private static final Map<String, String> argsConfigKeys = new HashMap<>();
|
private static final Map<String, String> argsConfigKeys = new HashMap<>();
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
if (System.getProperty("io.netty.leakDetection.level") == null) {
|
||||||
|
ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.DISABLED); // Can eat performance
|
||||||
|
}
|
||||||
|
|
||||||
GeyserStandaloneBootstrap bootstrap = new GeyserStandaloneBootstrap();
|
GeyserStandaloneBootstrap bootstrap = new GeyserStandaloneBootstrap();
|
||||||
// Set defaults
|
// Set defaults
|
||||||
boolean useGuiOpts = bootstrap.useGui;
|
boolean useGuiOpts = bootstrap.useGui;
|
||||||
|
@ -34,7 +34,6 @@ import com.nukkitx.network.util.EventLoops;
|
|||||||
import com.nukkitx.protocol.bedrock.BedrockServer;
|
import com.nukkitx.protocol.bedrock.BedrockServer;
|
||||||
import io.netty.channel.epoll.Epoll;
|
import io.netty.channel.epoll.Epoll;
|
||||||
import io.netty.channel.kqueue.KQueue;
|
import io.netty.channel.kqueue.KQueue;
|
||||||
import io.netty.util.ResourceLeakDetector;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.geysermc.common.PlatformType;
|
import org.geysermc.common.PlatformType;
|
||||||
@ -126,10 +125,6 @@ public class GeyserConnector {
|
|||||||
private Metrics metrics;
|
private Metrics metrics;
|
||||||
|
|
||||||
private GeyserConnector(PlatformType platformType, GeyserBootstrap bootstrap) {
|
private GeyserConnector(PlatformType platformType, GeyserBootstrap bootstrap) {
|
||||||
if (platformType == PlatformType.STANDALONE && System.getProperty("io.netty.leakDetection.level") == null) {
|
|
||||||
ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.DISABLED); // Can eat performance
|
|
||||||
}
|
|
||||||
|
|
||||||
long startupTime = System.currentTimeMillis();
|
long startupTime = System.currentTimeMillis();
|
||||||
|
|
||||||
instance = this;
|
instance = this;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren