Add ServerHangWatchdog to TerminalTransformer whitelist. Closes #2203
This commit is contained in:
parent
978861b521
commit
93be22fc8e
1 changed files with 9 additions and 5 deletions
|
@ -134,11 +134,15 @@ public class TerminalTransformer implements IClassTransformer
|
||||||
String callingClass = cause.length > 2 ? cause[3].getClassName() : "none";
|
String callingClass = cause.length > 2 ? cause[3].getClassName() : "none";
|
||||||
String callingParent = cause.length > 3 ? cause[4].getClassName() : "none";
|
String callingParent = cause.length > 3 ? cause[4].getClassName() : "none";
|
||||||
// FML is allowed to call system exit and the Minecraft applet (from the quit button), and the dedicated server (from itself)
|
// FML is allowed to call system exit and the Minecraft applet (from the quit button), and the dedicated server (from itself)
|
||||||
if (!(callingClass.startsWith("net.minecraftforge.fml.") ||
|
boolean allowed = false;
|
||||||
("net.minecraft.client.Minecraft".equals(callingClass) && "net.minecraft.client.Minecraft".equals(callingParent)) ||
|
allowed |= callingClass.startsWith("net.minecraftforge.fml.");
|
||||||
("net.minecraft.server.gui.MinecraftServerGui$1".equals(callingClass) && "java.awt.AWTEventMulticaster".equals(callingParent)) ||
|
allowed |= callingClass.equals("net.minecraft.client.Minecraft") && callingParent.equals("net.minecraft.client.Minecraft");
|
||||||
("net.minecraft.server.dedicated.DedicatedServer".equals(callingClass) && "net.minecraft.server.MinecraftServer".equals(callingParent)))
|
allowed |= callingClass.equals("net.minecraft.server.gui.MinecraftServerGui$1") && callingParent.equals("java.awt.AWTEventMulticaster");
|
||||||
)
|
allowed |= callingClass.equals("net.minecraft.server.dedicated.DedicatedServer") && callingParent.equals("net.minecraft.server.MinecraftServer");
|
||||||
|
allowed |= callingClass.equals("net.minecraft.server.dedicated.ServerHangWatchdog");
|
||||||
|
allowed |= callingClass.equals("net.minecraft.server.dedicated.ServerHangWatchdog$1");
|
||||||
|
|
||||||
|
if (!allowed)
|
||||||
{
|
{
|
||||||
throw new ExitTrappedException();
|
throw new ExitTrappedException();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue