Merge pull request #12459 from pchote/fix-server-exploit

Reset server slots and reenable spectators when the last player quits.
This commit is contained in:
Oliver Brakmann
2016-12-09 21:34:50 +01:00
committed by GitHub
3 changed files with 20 additions and 4 deletions

View File

@@ -586,8 +586,10 @@ namespace OpenRA.Server
DispatchOrders(toDrop, frame, new byte[] { 0xbf });
// All clients have left: clean up
if (!Conns.Any())
TempBans.Clear();
foreach (var t in serverTraits.WithInterface<INotifyServerEmpty>())
t.ServerEmpty(this);
if (Conns.Any() || Dedicated)
SyncLobbyClients();

View File

@@ -18,6 +18,7 @@ namespace OpenRA.Server
public interface IInterpretCommand { bool InterpretCommand(Server server, Connection conn, Session.Client client, string cmd); }
public interface INotifySyncLobbyInfo { void LobbyInfoSynced(Server server); }
public interface INotifyServerStart { void ServerStarted(Server server); }
public interface INotifyServerEmpty { void ServerEmpty(Server server); }
public interface INotifyServerShutdown { void ServerShutdown(Server server); }
public interface IStartGame { void GameStarted(Server server); }
public interface IClientJoined { void ClientJoined(Server server, Connection conn); }