CheckForErrors() public method

public CheckForErrors ( ) : ConfigErrorResult
return ConfigErrorResult
Example #1
0
        private static void Main()
        {
            Console.Title = "Exchange Bot by sne4kyFox";
            Console.WriteLine("Welcome to the exchange bot!");
            Console.WriteLine(
                "By using this software you agree to the terms in \"license.txt\".");

            _config = ConfigHandler.Reload(_config);

            ConfigErrorResult errors = _config.CheckForErrors();
            if (!errors.Valid)
            {
                Console.WriteLine(errors.ErrorMessage);
                Console.ReadLine();
                Environment.Exit(-1);
            }

            Console.WriteLine("Attempting web login...");

            _account = Web.RetryDoLogin(TimeSpan.FromSeconds(5), 10, _config.Username, _config.Password, _config.SteamMachineAuth);

            if (!string.IsNullOrEmpty(_account.SteamMachineAuth))
            {
                _config.SteamMachineAuth = _account.SteamMachineAuth;
                ConfigHandler.WriteChanges(_config);
            }

            Console.WriteLine("Login was successful!");

            PollOffers();
        }