From 493811c0d04e20fc5de021b2325a63530cb31db4 Mon Sep 17 00:00:00 2001 From: Scott_NZ Date: Fri, 19 Apr 2013 00:16:13 +1200 Subject: [PATCH] Add `Required` slot checking in lobby logic. Set up needed player slots as Required for missions --- OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs | 2 +- OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs | 3 ++- mods/cnc-classic/maps/gdi01/map.yaml | 1 + mods/cnc-classic/maps/nod01/map.yaml | 1 + mods/ra/maps/Survival01/map.yaml | 1 + mods/ra/maps/allies-01/map.yaml | 1 + mods/ra/maps/allies-02/map.yaml | 1 + mods/ra/maps/allies-03/map.yaml | 1 + mods/ra/maps/allies-04/map.yaml | 1 + mods/ra/maps/monster-tank-madness/map.yaml | 1 + mods/ra/maps/soviet-01-classic/map.yaml | 1 + 11 files changed, 12 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs b/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs index de24739eba..0fbb96e0fd 100644 --- a/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs +++ b/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs @@ -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(); diff --git a/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs index 9b142f6986..7066f80c25 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs @@ -258,7 +258,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic var startGameButton = lobby.Get("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; diff --git a/mods/cnc-classic/maps/gdi01/map.yaml b/mods/cnc-classic/maps/gdi01/map.yaml index a045a72e6b..a0e2c81a7d 100644 --- a/mods/cnc-classic/maps/gdi01/map.yaml +++ b/mods/cnc-classic/maps/gdi01/map.yaml @@ -42,6 +42,7 @@ Players: InitialCash: 20 Allies: GoodGuy Enemies: BadGuy,Creeps + Required: True PlayerReference@Neutral: Name: Neutral OwnsWorld: True diff --git a/mods/cnc-classic/maps/nod01/map.yaml b/mods/cnc-classic/maps/nod01/map.yaml index 9eefe03e62..9ed0571f31 100644 --- a/mods/cnc-classic/maps/nod01/map.yaml +++ b/mods/cnc-classic/maps/nod01/map.yaml @@ -45,6 +45,7 @@ Players: LockSpawn: True LockTeam: True Enemies: GDI,Neutral + Required: True Actors: Actor0: rock2 diff --git a/mods/ra/maps/Survival01/map.yaml b/mods/ra/maps/Survival01/map.yaml index 7fabdc1b5f..bfafecb24d 100644 --- a/mods/ra/maps/Survival01/map.yaml +++ b/mods/ra/maps/Survival01/map.yaml @@ -41,6 +41,7 @@ Players: LockSpawn: True LockTeam: True Enemies: Soviets + Required: True PlayerReference@Soviets: Name: Soviets Race: soviet diff --git a/mods/ra/maps/allies-01/map.yaml b/mods/ra/maps/allies-01/map.yaml index 3c66ce8b5c..3d9865e295 100644 --- a/mods/ra/maps/allies-01/map.yaml +++ b/mods/ra/maps/allies-01/map.yaml @@ -44,6 +44,7 @@ Players: LockTeam: True Allies: Creeps Enemies: Soviets + Required: True PlayerReference@Soviets: Name: Soviets Race: soviet diff --git a/mods/ra/maps/allies-02/map.yaml b/mods/ra/maps/allies-02/map.yaml index 8099ac25f9..3e2ab9961d 100644 --- a/mods/ra/maps/allies-02/map.yaml +++ b/mods/ra/maps/allies-02/map.yaml @@ -38,6 +38,7 @@ Players: LockTeam: True Allies: Allies2,Allies Enemies: Soviets + Required: True PlayerReference@Allies2: Name: Allies2 Playable: True diff --git a/mods/ra/maps/allies-03/map.yaml b/mods/ra/maps/allies-03/map.yaml index 8063ac771f..3dd0e09815 100644 --- a/mods/ra/maps/allies-03/map.yaml +++ b/mods/ra/maps/allies-03/map.yaml @@ -40,6 +40,7 @@ Players: LockTeam: True Allies: Allies2,Allies Enemies: Soviets + Required: True PlayerReference@Allies2: Name: Allies2 Playable: True diff --git a/mods/ra/maps/allies-04/map.yaml b/mods/ra/maps/allies-04/map.yaml index da95c1d853..bae768e11a 100644 --- a/mods/ra/maps/allies-04/map.yaml +++ b/mods/ra/maps/allies-04/map.yaml @@ -45,6 +45,7 @@ Players: LockTeam: True Allies: Allies2,Allies Enemies: Soviets + Required: True PlayerReference@Allies2: Name: Allies2 Playable: True diff --git a/mods/ra/maps/monster-tank-madness/map.yaml b/mods/ra/maps/monster-tank-madness/map.yaml index c9892bffa0..9c86fe8e12 100644 --- a/mods/ra/maps/monster-tank-madness/map.yaml +++ b/mods/ra/maps/monster-tank-madness/map.yaml @@ -32,6 +32,7 @@ Players: LockSpawn: True LockTeam: True Enemies: BadGuy,USSR,Ukraine,Turkey + Required: True PlayerReference@BadGuy: Name: BadGuy Race: soviet diff --git a/mods/ra/maps/soviet-01-classic/map.yaml b/mods/ra/maps/soviet-01-classic/map.yaml index e60e5bd0dd..f6be29518e 100644 --- a/mods/ra/maps/soviet-01-classic/map.yaml +++ b/mods/ra/maps/soviet-01-classic/map.yaml @@ -50,6 +50,7 @@ Players: LockSpawn: True LockTeam: True Enemies: GoodGuy,France,Germany,Turkey + Required: True PlayerReference@Turkey: Name: Turkey Race: allies