mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-12-29 03:39:22 +00:00
Fix direct connection and ensure connecting doesn't block
This commit is contained in:
@@ -58,7 +58,7 @@ public final class LocalSession extends TcpSession {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connect() {
|
||||
public void connect(boolean wait) {
|
||||
if (this.disconnected) {
|
||||
throw new IllegalStateException("Connection has already been disconnected.");
|
||||
}
|
||||
|
||||
@@ -845,7 +845,7 @@ public class GeyserSession implements GeyserConnection, CommandSender {
|
||||
// We're going to connect through the JVM and not through TCP
|
||||
downstream = new LocalSession(this.remoteAddress, this.remotePort,
|
||||
geyser.getBootstrap().getSocketAddress(), upstream.getAddress().getAddress().getHostAddress(),
|
||||
this.protocol, this.downstream.getCodecHelper());
|
||||
this.protocol, this.protocol.createHelper());
|
||||
} else {
|
||||
downstream = new TcpClientSession(this.remoteAddress, this.remotePort, this.protocol);
|
||||
disableSrvResolving();
|
||||
@@ -1017,7 +1017,7 @@ public class GeyserSession implements GeyserConnection, CommandSender {
|
||||
setDaylightCycle(true);
|
||||
}
|
||||
|
||||
downstream.connect();
|
||||
downstream.connect(false);
|
||||
}
|
||||
|
||||
public void disconnect(String reason) {
|
||||
|
||||
Reference in New Issue
Block a user