summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-05-11 19:19:37 +0200
committerGitHub <noreply@github.com>2021-05-11 19:19:37 +0200
commitd0eb3e4bc4904c64667efd791b24846d9ac3c741 (patch)
tree4cb39e841cd2fd869123b74a742231884b2282c6 /src
parent0968d009c8b4ec5b3f5d84000f2f9f5636f9198a (diff)
downloadopenttd-d0eb3e4bc4904c64667efd791b24846d9ac3c741.tar.xz
Fix: [Network] mark server as offline when no longer reachable (#9244)
Diffstat (limited to 'src')
-rw-r--r--src/network/network.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp
index d8f002547..3b43ddbcd 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -627,6 +627,14 @@ private:
public:
TCPQueryConnecter(const std::string &connection_string) : TCPConnecter(connection_string, NETWORK_DEFAULT_PORT), connection_string(connection_string) {}
+ void OnFailure() override
+ {
+ NetworkGameList *item = NetworkGameListAddItem(connection_string);
+ item->online = false;
+
+ UpdateNetworkGameWindow();
+ }
+
void OnConnect(SOCKET s) override
{
_networking = true;