Fix a few issues with the registry
Dieser Commit ist enthalten in:
Ursprung
a9aa406d29
Commit
e5bc602af3
@ -33,7 +33,11 @@ public class ProtocolLogger {
|
||||
}
|
||||
|
||||
private static boolean isDebugEnabled() {
|
||||
return ProtocolLibrary.getConfig().isDebug();
|
||||
try {
|
||||
return ProtocolLibrary.getConfig().isDebug();
|
||||
} catch (Throwable ex) {
|
||||
return true; // For testing
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -67,7 +71,11 @@ public class ProtocolLogger {
|
||||
|
||||
public static void debug(String message, Object... args) {
|
||||
if (isDebugEnabled()) {
|
||||
log("[Debug] " + message, args);
|
||||
if (logger != null) {
|
||||
log("[Debug] " + message, args);
|
||||
} else {
|
||||
System.out.println("[Debug] " + MessageFormat.format(message, args));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -43,7 +43,7 @@ public class PacketRegistry {
|
||||
public static final ReportType REPORT_INSUFFICIENT_SERVER_PACKETS = new ReportType("Too few server packets detected: %s");
|
||||
public static final ReportType REPORT_INSUFFICIENT_CLIENT_PACKETS = new ReportType("Too few client packets detected: %s");
|
||||
|
||||
// Two different packet registry
|
||||
// The Netty packet registry
|
||||
private static volatile ProtocolRegistry NETTY;
|
||||
|
||||
// Cached for Netty
|
||||
@ -51,8 +51,8 @@ public class PacketRegistry {
|
||||
private static volatile Set<Integer> LEGACY_CLIENT_PACKETS;
|
||||
private static volatile Map<Integer, Class> LEGACY_PREVIOUS_PACKETS;
|
||||
|
||||
// Whether or not the registry has
|
||||
private static boolean INITIALIZED;
|
||||
// Whether or not the registry has been initialized
|
||||
private static volatile boolean INITIALIZED = false;
|
||||
|
||||
/**
|
||||
* Initializes the packet registry.
|
||||
@ -65,8 +65,8 @@ public class PacketRegistry {
|
||||
return;
|
||||
}
|
||||
|
||||
INITIALIZED = true;
|
||||
NETTY = new NettyProtocolRegistry();
|
||||
INITIALIZED = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren