Пример #1
0
 public void Close()
 {
     SessionDied -= SessionDiedHandler;
     ClientLost   = null;
     int[] SessionIDs = GetSessionIDs;
     Disconnect();
     foreach (int sessionID in SessionIDs)
     {
         SessionIDManager.FreeID(sessionID);
     }
     LogWriter.NetworkLog("Tearing Down Network");
 }
Пример #2
0
        private void RemoveDeadConnections()
        {
            foreach (NetworkConnection networkConnection in AcceptedConnections.Entries)
            {
                if (!networkConnection.Connected)
                {
                    Logger.RegistrationLog("Removing disconnected connection from Accepted Connection ( Client :  " + networkConnection.RemoteEndPoint.ToString() + ")");
                    AcceptedConnections.Remove(networkConnection);
                }
            }

            foreach (NetworkConnection networkConnection in ConnectionsReadyForQueingUpToMatchmaking.Entries)
            {
                if (!networkConnection.Connected)
                {
                    Logger.RegistrationLog("Removing disconnected connection from ConnectionsReadyForJoiningAndStarting Games Connection ( Client :  " + networkConnection.RemoteEndPoint.ToString() + ")");
                    ConnectionsReadyForQueingUpToMatchmaking.Remove(networkConnection);
                    SessionIDGenerator.FreeID(networkConnection.ClientSession.SessionID);
                }
            }
        }
Пример #3
0
 private void RemoveConnection(NetworkConnection client)
 {
     client.ConnectionDiedEvent -= RemoveConnection;
     m_waitingClientConnections.Remove(client);
     SessionIDGenerator.FreeID(client.ClientSession.SessionID);
 }