From 4082cddde5e6a0d689b7c24f029ad6eab6810cbe Mon Sep 17 00:00:00 2001 From: Koncord Date: Fri, 26 May 2017 03:10:53 +0800 Subject: [PATCH] [Browser] Do not allow to connect to unreachable servers --- apps/browser/ServerInfoDialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/browser/ServerInfoDialog.cpp b/apps/browser/ServerInfoDialog.cpp index ea6dbe3bb..d4c614069 100644 --- a/apps/browser/ServerInfoDialog.cpp +++ b/apps/browser/ServerInfoDialog.cpp @@ -36,7 +36,9 @@ void ServerInfoDialog::refresh() { leAddr->setText(sd.first.ToString(true, ':')); lblName->setText(sd.second.GetName()); - lblPing->setNum((int) PingRakNetServer(sd.first.ToString(false), sd.first.GetPort())); + int ping = PingRakNetServer(sd.first.ToString(false), sd.first.GetPort()); + lblPing->setNum(ping); + btnConnect->setDisabled(ping == PING_UNREACHABLE); listPlayers->clear();