public bool DoStep(NetworkClient networkClient, GameClient client) { //Get game servers list List<object> gameServersList = client.AdditionalData[ObjectPropertyName.GAME_SERVER]; //If servers list is available if (gameServersList != null) { //Connect to the game server while (gameServersList.Count > 0) { //Pop a first game server in the list string server = (string) gameServersList[0]; gameServersList.Remove(server); //Out log message networkClient.OutLogMessage(string.Format("Connecting to the game server: {0}...", server)); //Try to connect bool isConnected = networkClient.ConnectToGameServer(server); if (isConnected) { if (networkClient.DoAuthorization()) { return true; } } } } //Connection failed networkClient.Disconnect(); return false; }