Fix dropping unvalidated clients.

This commit is contained in:
Paul Chote
2010-12-31 16:52:17 +13:00
parent dc9de20553
commit 64304635b7

View File

@@ -354,18 +354,23 @@ namespace OpenRA.Server
public void DropClient(Connection toDrop) public void DropClient(Connection toDrop)
{ {
conns.Remove(toDrop); if (preConns.Contains(toDrop))
SendChat(toDrop, "Connection Dropped"); preConns.Remove(toDrop);
else
{
conns.Remove(toDrop);
SendChat(toDrop, "Connection Dropped");
if (GameStarted) if (GameStarted)
SendDisconnected(toDrop); /* Report disconnection */ SendDisconnected(toDrop); /* Report disconnection */
lobbyInfo.Clients.RemoveAll(c => c.Index == toDrop.PlayerIndex); lobbyInfo.Clients.RemoveAll(c => c.Index == toDrop.PlayerIndex);
DispatchOrders( toDrop, toDrop.MostRecentFrame, new byte[] { 0xbf } );
DispatchOrders( toDrop, toDrop.MostRecentFrame, new byte[] { 0xbf } ); if (conns.Count != 0)
SyncLobbyInfo();
if (conns.Count != 0) }
SyncLobbyInfo();
try try
{ {