3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 00:00:28 +01:00

Merge branch 'master' into dev

Dieser Commit ist enthalten in:
Myles 2017-04-01 00:07:32 +01:00
Commit e3c4253c13
3 geänderte Dateien mit 22 neuen und 14 gelöschten Zeilen

Datei anzeigen

@ -3,7 +3,7 @@ License:
MIT License MIT License
Copyright (c) 2016 Copyright (c) 2017
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -46,6 +46,8 @@ public class ViaManager {
// Check for updates // Check for updates
if (platform.getConf().isCheckForUpdates()) if (platform.getConf().isCheckForUpdates())
UpdateUtil.sendUpdateMessage(); UpdateUtil.sendUpdateMessage();
// Force class load
ProtocolRegistry.getSupportedVersions();
// Inject // Inject
try { try {
injector.inject(); injector.inject();

Datei anzeigen

@ -7,6 +7,7 @@ import io.netty.handler.codec.ByteToMessageDecoder;
import io.netty.handler.codec.MessageToByteEncoder; import io.netty.handler.codec.MessageToByteEncoder;
import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.protocol.ProtocolPipeline; import us.myles.ViaVersion.api.protocol.ProtocolPipeline;
import us.myles.ViaVersion.api.protocol.ProtocolRegistry;
import java.lang.reflect.Method; import java.lang.reflect.Method;
@ -31,6 +32,8 @@ public class SpongeChannelInitializer extends ChannelInitializer<SocketChannel>
@Override @Override
protected void initChannel(SocketChannel socketChannel) throws Exception { protected void initChannel(SocketChannel socketChannel) throws Exception {
// Ensure ViaVersion is loaded
if (ProtocolRegistry.SERVER_PROTOCOL != -1) {
UserConnection info = new UserConnection(socketChannel); UserConnection info = new UserConnection(socketChannel);
// init protocol // init protocol
new ProtocolPipeline(info); new ProtocolPipeline(info);
@ -44,5 +47,8 @@ public class SpongeChannelInitializer extends ChannelInitializer<SocketChannel>
socketChannel.pipeline().replace("encoder", "encoder", encoder); socketChannel.pipeline().replace("encoder", "encoder", encoder);
socketChannel.pipeline().replace("decoder", "decoder", decoder); socketChannel.pipeline().replace("decoder", "decoder", decoder);
socketChannel.pipeline().addAfter("packet_handler", "viaversion_packet_handler", chunkHandler); socketChannel.pipeline().addAfter("packet_handler", "viaversion_packet_handler", chunkHandler);
} else {
this.method.invoke(this.original, socketChannel);
}
} }
} }