edited the LobbyLogic to include a spectator toggle in the server admin dropdown.

This commit is contained in:
Matthew Uzzell
2014-02-15 21:07:41 +00:00
parent 4075742d19
commit 88121b272d
8 changed files with 839 additions and 747 deletions

View File

@@ -276,6 +276,13 @@ namespace OpenRA.Server
IsAdmin = !LobbyInfo.Clients.Any(c1 => c1.IsAdmin)
};
if (client.IsObserver && !LobbyInfo.GlobalSettings.AllowSpectate)
{
SendOrderTo(newConn, "ServerError", "The game is full");
DropClient(newConn);
return;
}
if (client.Slot != null)
SyncClientToPlayerReference(client, Map.Players[client.Slot]);
else
@@ -317,7 +324,7 @@ namespace OpenRA.Server
LobbyInfo.Clients.Add(client);
Log.Write("server", "Client {0}: Accepted connection from {1}.",
newConn.PlayerIndex, newConn.socket.RemoteEndPoint);
newConn.PlayerIndex, newConn.socket.RemoteEndPoint);
foreach (var t in serverTraits.WithInterface<IClientJoined>())
t.ClientJoined(this, newConn);