Add plumbing for short game option

This commit is contained in:
Oliver Brakmann
2014-11-17 18:44:32 +01:00
parent 470ae17271
commit 280b30961f
7 changed files with 57 additions and 5 deletions

View File

@@ -809,6 +809,29 @@ namespace OpenRA.Mods.Common.Server
server.SyncLobbyClients();
return true;
}
},
{ "shortgame",
s =>
{
if (!client.IsAdmin)
{
server.SendOrderTo(conn, "Message", "Only the host can set that option");
return true;
}
if (server.Map.Options.ShortGame.HasValue)
{
server.SendOrderTo(conn, "Message", "Map has disabled short game configuration");
return true;
}
bool.TryParse(s, out server.LobbyInfo.GlobalSettings.ShortGame);
server.SyncLobbyGlobalSettings();
server.SendMessage("{0} {1} Short Game."
.F(client.Name, server.LobbyInfo.GlobalSettings.ShortGame ? "enabled" : "disabled"));
return true;
}
}
};