From 197f60b2a51336435e7da4790e8885c4d1f07116 Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Tue, 7 Apr 2015 17:32:22 +0200 Subject: [PATCH] Mark running games as password protected as well Fixes #7893 --- .../Widgets/Logic/ServerBrowserLogic.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/ServerBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ServerBrowserLogic.cs index 3586c548d9..a18dc9d68a 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ServerBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ServerBrowserLogic.cs @@ -336,22 +336,25 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (game.State == (int)ServerState.GameStarted) { + var label = ""; try { var runTime = DateTime.Now - System.DateTime.Parse(game.Started); - return "In progress for {0} minute{1}".F(runTime.Minutes, runTime.Minutes > 1 ? "s" : ""); + label = "In progress for {0} minute{1}".F(runTime.Minutes, runTime.Minutes > 1 ? "s" : ""); } catch (Exception) { - return "In progress"; + label = "In progress"; } + + return game.Protected ? label + " (Password protected)" : label; } - if (game.Protected) - return "Password protected"; - if (game.State == (int)ServerState.WaitingPlayers) - return "Waiting for players"; + { + var label = "Waiting for players"; + return game.Protected ? label + " (Password protected)" : label; + } if (game.State == (int)ServerState.ShuttingDown) return "Server shutting down";