Merge pull request #3103 from ScottNZ/missions

Add `Required` slot checking in lobby logic. Set up needed player slots as Required for missions
This commit is contained in:
Chris Forbes
2013-04-18 14:34:00 -07:00
11 changed files with 12 additions and 2 deletions

View File

@@ -94,7 +94,7 @@ namespace OpenRA.Mods.RA.Server
if (server.lobbyInfo.Slots.Any(sl => sl.Value.Required &&
server.lobbyInfo.ClientInSlot(sl.Key) == null))
{
server.SendChat(conn, "Unable to start the game until required slots are full.");
server.SendChatTo(conn, "Unable to start the game until required slots are full.");
return true;
}
server.StartGame();

View File

@@ -258,7 +258,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var startGameButton = lobby.Get<ButtonWidget>("START_GAME_BUTTON");
startGameButton.IsVisible = () => Game.IsHost;
startGameButton.IsDisabled = () => gameStarting;
startGameButton.IsDisabled = () => gameStarting
|| orderManager.LobbyInfo.Slots.Any(sl => sl.Value.Required && orderManager.LobbyInfo.ClientInSlot(sl.Key) == null);
startGameButton.OnClick = () =>
{
gameStarting = true;