3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-19 22:40:18 +01:00

Merge remote-tracking branch 'upstream/master' into feature/blocky

Dieser Commit ist enthalten in:
Joshua Castle 2023-03-11 01:49:19 -08:00
Commit 550a4725ef
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: F674F38216C35D5D

Datei anzeigen

@ -79,7 +79,8 @@ public class GeyserLegacyPingPassthrough implements IGeyserPingPassthrough, Runn
try (Socket socket = new Socket()) { try (Socket socket = new Socket()) {
String address = geyser.getConfig().getRemote().address(); String address = geyser.getConfig().getRemote().address();
int port = geyser.getConfig().getRemote().port(); int port = geyser.getConfig().getRemote().port();
socket.connect(new InetSocketAddress(address, port), 5000); InetSocketAddress endpoint = new InetSocketAddress(address, port);
socket.connect(endpoint, 5000);
ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
try (DataOutputStream handshake = new DataOutputStream(byteArrayStream)) { try (DataOutputStream handshake = new DataOutputStream(byteArrayStream)) {
@ -103,7 +104,8 @@ public class GeyserLegacyPingPassthrough implements IGeyserPingPassthrough, Runn
HAProxyProxiedProtocol.TCP4.byteValue() : HAProxyProxiedProtocol.TCP6.byteValue()); HAProxyProxiedProtocol.TCP4.byteValue() : HAProxyProxiedProtocol.TCP6.byteValue());
byte[] srcAddrBytes = NetUtil.createByteArrayFromIpAddressString( byte[] srcAddrBytes = NetUtil.createByteArrayFromIpAddressString(
((InetSocketAddress) socket.getLocalSocketAddress()).getAddress().getHostAddress()); ((InetSocketAddress) socket.getLocalSocketAddress()).getAddress().getHostAddress());
byte[] dstAddrBytes = NetUtil.createByteArrayFromIpAddressString(address); byte[] dstAddrBytes = NetUtil.createByteArrayFromIpAddressString(
endpoint.getAddress().getHostAddress());
dataOutputStream.writeShort(srcAddrBytes.length + dstAddrBytes.length + 4); dataOutputStream.writeShort(srcAddrBytes.length + dstAddrBytes.length + 4);
dataOutputStream.write(srcAddrBytes); dataOutputStream.write(srcAddrBytes);
dataOutputStream.write(dstAddrBytes); dataOutputStream.write(dstAddrBytes);