Try to fix reload, give more detailed error (#874)

Fixes #874
This commit is contained in:
Dan Mulloy 2020-06-28 17:06:12 -04:00
parent b2f6a56843
commit fd93c1c553
No known key found for this signature in database
GPG Key ID: 2B62F7DACFF133E8
2 changed files with 8 additions and 9 deletions

View File

@ -79,11 +79,15 @@ public class ChannelInjector extends ByteToMessageDecoder implements Injector {
// Versioning
private static Class<?> PACKET_SET_PROTOCOL = null;
private static final AtomicInteger keyId = new AtomicInteger();
private static final AttributeKey<Integer> PROTOCOL_KEY;
private static AtomicInteger keyId = new AtomicInteger();
private static AttributeKey<Integer> PROTOCOL_KEY;
static {
try {
PROTOCOL_KEY = AttributeKey.valueOf("PROTOCOL-" + keyId.getAndIncrement());
} catch (Exception ex) {
throw new RuntimeException("Encountered an error caused by a reload! Please properly restart your server!", ex);
}
}
// Saved accessors

View File

@ -22,12 +22,7 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.ChannelPromise;
import io.netty.channel.*;
import io.netty.util.concurrent.EventExecutorGroup;
/**