From 80351a2d7694e7f52a15b94f432ffd64d32557bc Mon Sep 17 00:00:00 2001 From: Daid Date: Fri, 16 Aug 2024 10:07:27 +0200 Subject: [PATCH] Add failed to connect reason to client. --- src/multiplayer_client.cpp | 1 + src/multiplayer_client.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/multiplayer_client.cpp b/src/multiplayer_client.cpp index 5bbae0b0..f530698b 100644 --- a/src/multiplayer_client.cpp +++ b/src/multiplayer_client.cpp @@ -65,6 +65,7 @@ void GameClient::update(float /*delta*/) { case sp::io::network::StreamSocket::State::Closed: status = Disconnected; + disconnect_reason = DisconnectReason::FailedToConnect; LOG(INFO) << "GameClient: Failed to connect"; break; case sp::io::network::StreamSocket::State::Connecting: diff --git a/src/multiplayer_client.h b/src/multiplayer_client.h index 664121fd..c2e85c1c 100644 --- a/src/multiplayer_client.h +++ b/src/multiplayer_client.h @@ -32,6 +32,7 @@ class GameClient : public Updatable enum class DisconnectReason : uint8_t { None = 0, + FailedToConnect, VersionMismatch, BadCredentials, TimedOut,