Skip to content

Commit

Permalink
Fix 1.20.2 ProtocolAutoDetector
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytv committed Sep 21, 2023
1 parent ffd7e0b commit 957b626
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
org.gradle.jvmargs=-Xms32M -Xmx4G -XX:+UseG1GC -XX:+UseStringDeduplication

loader_version=0.14.21
viaver_version=4.8.0-1.20.2-rc1-SNAPSHOT
viaver_version=4.8.0-1.20.2-rc2-SNAPSHOT
yaml_version=2.0

publish_mc_versions=1.20.1, 1.19.4, 1.18.2, 1.17.1, 1.16.5, 1.15.2, 1.14.4, 1.8.9
# example: 1.19.1-rc1. Can be a blank value
modrinth_mc_snapshot=1.20.2-rc1
modrinth_mc_snapshot=1.20.2-rc2
# example: 1.19-Snapshot. Can be a blank value
curseforge_mc_snapshot=1.20.2-Snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ public class ProtocolAutoDetector {
.handler(new ChannelInitializer<>() {
@Override
protected void initChannel(@NotNull Channel channel) {
channel.attr(ClientConnection.SERVERBOUND_PROTOCOL_KEY)
.set(NetworkState.HANDSHAKING.getHandler(NetworkSide.SERVERBOUND));
channel.attr(ClientConnection.CLIENTBOUND_PROTOCOL_KEY)
.set(NetworkState.STATUS.getHandler(NetworkSide.CLIENTBOUND));
channel.attr(ClientConnection.SERVERBOUND_PROTOCOL_KEY)
.set(NetworkState.STATUS.getHandler(NetworkSide.SERVERBOUND));
try {
channel.config().setOption(ChannelOption.TCP_NODELAY, true);
channel.config().setOption(ChannelOption.IP_TOS, 0x18); // Stolen from Velocity, low delay, high reliability
Expand Down Expand Up @@ -115,6 +115,9 @@ public boolean isConnectionOpen() {
address.getPort(),
ConnectionIntent.STATUS
));

ch.channel().attr(ClientConnection.SERVERBOUND_PROTOCOL_KEY)
.set(NetworkState.STATUS.getHandler(NetworkSide.SERVERBOUND));
clientConnection.send(new QueryRequestC2SPacket());
});
}
Expand Down

0 comments on commit 957b626

Please sign in to comment.