From 287aba4a67191272550009002f6b53adfd16d424 Mon Sep 17 00:00:00 2001 From: Lossy Date: Wed, 22 Jun 2022 15:23:50 -0500 Subject: [PATCH] Fix websocket servers not being marked as bad by the server list --- .../javasteam/networking/steam3/WebSocketConnection.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/in/dragonbra/javasteam/networking/steam3/WebSocketConnection.java b/src/main/java/in/dragonbra/javasteam/networking/steam3/WebSocketConnection.java index eb16e676..aef9496e 100644 --- a/src/main/java/in/dragonbra/javasteam/networking/steam3/WebSocketConnection.java +++ b/src/main/java/in/dragonbra/javasteam/networking/steam3/WebSocketConnection.java @@ -16,6 +16,8 @@ public class WebSocketConnection extends Connection implements WebSocketCMClient private volatile boolean userInitiated = false; + private InetSocketAddress socketEndPoint; + @Override public void connect(InetSocketAddress endPoint, int timeout) { logger.debug("Connecting to " + endPoint + "..."); @@ -26,6 +28,8 @@ public void connect(InetSocketAddress endPoint, int timeout) { oldClient.close(); } + socketEndPoint = endPoint; + newClient.connect(); } @@ -51,7 +55,7 @@ public InetAddress getLocalIP() { @Override public InetSocketAddress getCurrentEndPoint() { - return client.get().getRemoteSocketAddress(); + return socketEndPoint; } @Override @@ -66,6 +70,8 @@ private void disconnectCore(boolean userInitiated) { oldClient.close(); this.userInitiated = userInitiated; } + + socketEndPoint = null; } private static URI getUri(InetSocketAddress address) {