Host closing server closes all connections and closes the listener.

This commit is contained in:
alzeih
2010-07-23 18:00:26 +12:00
committed by Chris Forbes
parent 05d0e825fd
commit 409416b55c
2 changed files with 11 additions and 1 deletions

View File

@@ -24,7 +24,7 @@ namespace OpenRA.Server
static class Server
{
static List<Connection> conns = new List<Connection>();
static TcpListener listener;
static TcpListener listener = null;
static Dictionary<int, List<Connection>> inFlightFrames
= new Dictionary<int, List<Connection>>();
static Session lobbyInfo;
@@ -424,6 +424,14 @@ namespace OpenRA.Server
if (conns.Count != 0)
SyncLobbyInfo();
}
public static void CloseServer()
{
while (conns.Count() != 0)
DropClient(conns.ElementAt(conns.Count() - 1), null);
if (listener != null)
listener.Stop();
}
static void SyncLobbyInfo()
{