Fixes #3336.
This commit is contained in:
@@ -55,12 +55,17 @@ namespace OpenRA.Mods.RA.Server
|
|||||||
|
|
||||||
void CheckAutoStart(S server, Connection conn, Session.Client client)
|
void CheckAutoStart(S server, Connection conn, Session.Client client)
|
||||||
{
|
{
|
||||||
var actualPlayers = server.conns
|
var playerClients = server.lobbyInfo.Clients.Where(c => c.Bot == null && c.Slot != null);
|
||||||
.Select(c => server.GetClient(c))
|
|
||||||
.Where(c => c.Slot != null);
|
|
||||||
|
|
||||||
if (actualPlayers.Count() > 0 && actualPlayers.All(c => c.State == Session.ClientState.Ready))
|
// Are all players ready?
|
||||||
InterpretCommand(server, conn, client, "startgame");
|
if (playerClients.Count() == 0 || playerClients.Any(c => c.State != Session.ClientState.Ready))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Are the map conditions satisfied?
|
||||||
|
if (server.lobbyInfo.Slots.Any(sl => sl.Value.Required && server.lobbyInfo.ClientInSlot(sl.Key) == null))
|
||||||
|
return;
|
||||||
|
|
||||||
|
server.StartGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool InterpretCommand(S server, Connection conn, Session.Client client, string cmd)
|
public bool InterpretCommand(S server, Connection conn, Session.Client client, string cmd)
|
||||||
|
|||||||
Reference in New Issue
Block a user