Exemple #1
0
        private void AddServerToDropDown(ServerData serverData)
        {
            var oldCount = _popupServerNames.Count;

            _popupServerNames.Add(serverData.IpAddress);
            if (oldCount == 0)
            {
                _currentServerIndex = 0;
                _serverList.SelectServerFromList(_serverList.AvailableServers[_currentServerIndex]);
                ConnectToServer();
            }
        }
Exemple #2
0
        private void RemoveInactiveServers()
        {
            ServerData removedServer = null;

            for (int i = AvailableServers.Count - 1; i >= 0; i--)
            {
                if (_timeProvider.RealtimeSinceStartup - AvailableServers[i].LastConnectionTime > SERVER_INACTIVE_TOLERANCE)
                {
                    removedServer = AvailableServers[i].ServerData;
                    if (removedServer == SelectedServer.ServerData)
                    {
                        RemoveSelectedServer(removedServer);
                    }
                    AvailableServers.RemoveAt(i);
                    i--;
                }
            }
            if (removedServer != null)
            {
                ServerRemoved(removedServer);
                ServerListChanged();
            }
        }
Exemple #3
0
 private void RemoveServerFromDropDown(ServerData serverData)
 {
     _popupServerNames.Remove(serverData.IpAddress);
 }
Exemple #4
0
 private void DisconnectFromSelectedServer(ServerData serverData)
 {
     ConnectionClient.Disconnect();
 }