Add lobby support for configuring starting units.

This commit is contained in:
Paul Chote
2013-07-13 13:31:11 +12:00
parent db22f3568d
commit 55653c3f1f
3 changed files with 67 additions and 2 deletions

View File

@@ -399,6 +399,32 @@ namespace OpenRA.Mods.RA.Server
server.SyncLobbyInfo();
return true;
}},
{ "startingunits",
s =>
{
if (!client.IsAdmin)
{
server.SendOrderTo(conn, "Message", "Only the host can set that option");
return true;
}
if (!server.Map.AllowStartUnitConfig)
{
server.SendOrderTo(conn, "Message", "Map has disabled start unit configuration");
return true;
}
var startUnits = Rules.Info["world"].Traits.WithInterface<MPStartUnitsInfo>();
if (!startUnits.Any(msu => msu.Class == s))
{
server.SendOrderTo(conn, "Message", "Unknown unit class: {0}".F(s));
return true;
}
server.lobbyInfo.GlobalSettings.StartingUnitsClass = s;
server.SyncLobbyInfo();
return true;
}},
{ "kick",
s =>
{