ignore spectators for readiness check
This commit is contained in:
@@ -53,6 +53,16 @@ namespace OpenRA.Mods.RA.Server
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CheckAutoStart(S server, Connection conn, Session.Client client)
|
||||||
|
{
|
||||||
|
var actualPlayers = server.conns
|
||||||
|
.Select(c => server.GetClient(c))
|
||||||
|
.Where(c => c.Slot != null);
|
||||||
|
|
||||||
|
if (actualPlayers.Count() > 0 && actualPlayers.All(c => c.State == Session.ClientState.Ready))
|
||||||
|
InterpretCommand(server, conn, client, "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)
|
||||||
{
|
{
|
||||||
if (!ValidateCommand(server, conn, client, cmd))
|
if (!ValidateCommand(server, conn, client, cmd))
|
||||||
@@ -74,8 +84,7 @@ namespace OpenRA.Mods.RA.Server
|
|||||||
|
|
||||||
server.SyncLobbyInfo();
|
server.SyncLobbyInfo();
|
||||||
|
|
||||||
if (server.conns.Count > 0 && server.conns.All(c => server.GetClient(c).State == Session.ClientState.Ready))
|
CheckAutoStart(server, conn, client);
|
||||||
InterpretCommand(server, conn, client, "startgame");
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}},
|
}},
|
||||||
@@ -114,6 +123,8 @@ namespace OpenRA.Mods.RA.Server
|
|||||||
S.SyncClientToPlayerReference(client, server.Map.Players[s]);
|
S.SyncClientToPlayerReference(client, server.Map.Players[s]);
|
||||||
|
|
||||||
server.SyncLobbyInfo();
|
server.SyncLobbyInfo();
|
||||||
|
CheckAutoStart(server, conn, client);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}},
|
}},
|
||||||
{ "spectate",
|
{ "spectate",
|
||||||
|
|||||||
Reference in New Issue
Block a user