add suffix to the player has disconnected message in-game

closes #3864
This commit is contained in:
Matthias Mailänder
2013-11-09 17:44:39 +01:00
parent 4f91c22fed
commit 7de2dd7083

View File

@@ -509,8 +509,12 @@ namespace OpenRA.Server
if (dropClient == null)
return;
var suffix = "";
if (State == ServerState.GameStarted)
suffix = dropClient.IsObserver ? " (Spectator)" : dropClient.Team != 0 ? " (Team {0})".F(dropClient.Team) : "";
SendMessage("{0}{1} has disconnected.".F(dropClient.Name, suffix));
// Send disconnected order, even if still in the lobby
SendMessage("{0} has disconnected.".F(dropClient.Name));
DispatchOrdersToClients(toDrop, 0, new ServerOrder("Disconnected", "").Serialize());
lobbyInfo.Clients.RemoveAll(c => c.Index == toDrop.PlayerIndex);