Not Enough Crashes (Fabric)

Not Enough Crashes (Fabric)

4M Downloads

Running on dedicated servers?

Fourmisain opened this issue ยท 4 comments

commented

So I got a stupid question: Is this mod supposed to work on dedicated servers as well?
From the description I get that it's about 80% client side, but deobfuscated stack traces sounds like something that could also work on servers.

I'm asking because I found it conflicts with jline4mcdsrv (Curseforge) and it fails a Mixin:

[main/WARN] @Mixin target net.minecraft.class_1132 was not found notenoughcrashes.mixins.json:MixinIntegratedServer

jline4mcdsrv replaces the server command input loop of MinecraftDedicatedServer to add auto-completion and syntax highlighting but weirdly enough it can't even find the default SysOut log4j2 console appender (here) with this mod installed, so maybe it causes some internal failure?

If NEC isn't supposed to run on dedicated servers, it might be a good idea to mark it as a client-side mod in ModMenu (see ModMenu's wiki) and maybe add some description.

commented

This mod is supposed to run on dedicated servers yes. I have updated MixinIntegratedServer to be client only as it should be.
As for jline4mcdsrv I don't know how this mod can affect the default SysOut log4j2 console appender, so for know I'm going to ignore this incompatibility (unless someone really wants these 2 mods to be compatible).

commented

I tested it again with your new version - jline4mcdsrv mostly works now, except that (after jline4mcdsrv did it's logger changes) all log lines are for some bizarre reason doubled.

I'll open an issue on jline4mcdsrv's tracker to keep a tab on it for now.

commented

I did some debugging and I think I found the cause:

Logger rootLogger = (Logger) LogManager.getRootLogger();
LoggerConfig loggerConfig = rootLogger.get();
// Remove appender refs from config
List<AppenderRef> appenderRefs = new ArrayList<>(loggerConfig.getAppenderRefs());
for (AppenderRef appenderRef : appenderRefs) {
loggerConfig.removeAppender(appenderRef.getRef());
}
// Create the RewriteAppender, which wraps the appenders
RewriteAppender rewriteAppender = RewriteAppender.createAppender(
"NotEnoughCrashesDeobfuscatingAppender",
"true",
appenderRefs.toArray(new AppenderRef[0]),
rootLogger.getContext().getConfiguration(),
new DeobfuscatingRewritePolicy(),
null
);
rewriteAppender.start();
// Add the new appender
loggerConfig.addAppender(rewriteAppender, null, null);

The // Remove appender refs from config part removes the SysOut appender and thus jline4mcdsrv can't find it.

I'm not yet sure if this is fixable in jline4mcdsrv - it could remove the NotEnoughCrashesDeobfuscatingAppender appender instead, though doing that would of course disable the deobfuscating - maybe there's a way to combine the features of both appenders...

commented

Just letting you know that I may have fixed it in jline4mcdsrv - it's a hacky solution and untested, but it should work.