3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-03 14:50:19 +01:00

Fix direct connection and ensure connecting doesn't block

Dieser Commit ist enthalten in:
Camotoy 2022-06-05 18:38:29 -04:00
Ursprung bcc68ee4b5
Commit 09fb6bf3ba
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
2 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -58,7 +58,7 @@ public final class LocalSession extends TcpSession {
} }
@Override @Override
public void connect() { public void connect(boolean wait) {
if (this.disconnected) { if (this.disconnected) {
throw new IllegalStateException("Connection has already been disconnected."); throw new IllegalStateException("Connection has already been disconnected.");
} }

Datei anzeigen

@ -845,7 +845,7 @@ public class GeyserSession implements GeyserConnection, CommandSender {
// We're going to connect through the JVM and not through TCP // We're going to connect through the JVM and not through TCP
downstream = new LocalSession(this.remoteAddress, this.remotePort, downstream = new LocalSession(this.remoteAddress, this.remotePort,
geyser.getBootstrap().getSocketAddress(), upstream.getAddress().getAddress().getHostAddress(), geyser.getBootstrap().getSocketAddress(), upstream.getAddress().getAddress().getHostAddress(),
this.protocol, this.downstream.getCodecHelper()); this.protocol, this.protocol.createHelper());
} else { } else {
downstream = new TcpClientSession(this.remoteAddress, this.remotePort, this.protocol); downstream = new TcpClientSession(this.remoteAddress, this.remotePort, this.protocol);
disableSrvResolving(); disableSrvResolving();
@ -1017,7 +1017,7 @@ public class GeyserSession implements GeyserConnection, CommandSender {
setDaylightCycle(true); setDaylightCycle(true);
} }
downstream.connect(); downstream.connect(false);
} }
public void disconnect(String reason) { public void disconnect(String reason) {