Example #1
0
 public Logic(ISettings clientSettings)
 {
     _clientSettings = clientSettings;
     _client = new Client(_clientSettings);
     _inventory = new Inventory(_client);
     _navigation = new Navigation(_client);
 }
Example #2
0
 public Logic(ISettings clientSettings)
 {
     _clientSettings = clientSettings;
     _client = new Client(_clientSettings);
     _inventory = new Inventory(_client);
     _botStats = new BotStats();
     _navigation = new Navigation(_client);
     _pokevision = new PokeVisionUtil();
 }
Example #3
0
 public Logic(ISettings clientSettings)
 {
     _clientSettings = clientSettings;
     ResetCoords();
     _client = new Client(_clientSettings);
     _inventory = new Inventory(_client);
     _stats = new Statistics();
     _navigation = new Navigation(_client);
 }
Example #4
0
 public TelegramUtil(Client client, Telegram.Bot.TelegramBotClient telegram, ISettings settings, Inventory inv)
 {
     _client = client;
     _telegram = telegram;
     _clientSettings = settings;
     _inventory = inv;
     DoLiveStats(settings);
     DoInformation();
 }
        public GameManagerViewModel()
        {
            // Client init            
            Logger.SetLogger(new ConsoleLogger(LogLevel.Info));
            _clientSettings = new Settings();
            _client = new Client(_clientSettings);
            _inventory = new Inventory(_client);

            if (ApiInformation.IsTypePresent("Windows.Phone.Devices.Notification.VibrationDevice"))
            {
                _vibrationDevice = VibrationDevice.GetDefault();
            }
        }
Example #6
0
 public PokemonForm(Client client)
 {
     _client = client;
     _inventory = new Inventory(client);
     InitializeComponent();
 }
Example #7
0
        public TelegramUtil(Client client, Telegram.Bot.TelegramBotClient telegram, ISettings settings, Inventory inv)
        {
            instance = this;
            _client = client;
            _telegram = telegram;
            _clientSettings = settings;
            _inventory = inv;

            Array values = Enum.GetValues(typeof(TelegramUtilInformationTopics));
            foreach (TelegramUtilInformationTopics topic in values)
            {
                _informationDescription[topic] = TranslationHandler.GetString(_informationDescriptionIDs[topic], _informationDescriptionDefault[topic]);
                _information[topic] = false;
            }

            DoLiveStats(settings);
            DoInformation();
        }
 public PokemonSnipingForm(Client client, Inventory inventory)
 {
     _client = client;
     _inventory = inventory;
     InitializeComponent();
 }
        private async Task loginPtc(string username, string password)
        {
            try
            {
                // Creating the Settings
                Logger.Write("Adjusting the Settings.");
                UserSettings.Default.AuthType = AuthType.Ptc.ToString();
                UserSettings.Default.PtcUsername = username;
                UserSettings.Default.PtcPassword = password;
                this.settings = new Settings();

                // Begin Login
                Logger.Write("Trying to Login with PTC Credentials...");
                Client client = new Client(this.settings);
                await client.DoPtcLogin(this.settings.PtcUsername, this.settings.PtcPassword);
                await client.SetServer();

                // Server Ready
                Logger.Write("Connected! Server is Ready.");
                this.client = client;

                Logger.Write("Attempting to Retrieve Inventory and Player Profile...");
                this.inventory = new Inventory(client);
                this.profile = await client.GetProfile();
                enableButtons();
            }         
            catch
            {
                Logger.Write("Unable to Connect using the PTC Credentials.");
                MessageBox.Show("Unable to Authenticate with Login Server.", "Login Problem");
                Application.Exit();
            }
        }
        private async Task loginGoogle()
        {
            try
            {
                // Creating the Settings
                Logger.Write("Adjusting the Settings.");
                UserSettings.Default.AuthType = AuthType.Google.ToString();
                this.settings = new Settings();

                // Begin Login
                Logger.Write("Trying to Login with Google Token...");
                Client client = new Client(this.settings);
                await client.DoGoogleLogin();
                await client.SetServer();

                // Server Ready
                Logger.Write("Connected! Server is Ready.");
                this.client = client;

                Logger.Write("Attempting to Retrieve Inventory and Player Profile...");
                this.inventory = new Inventory(client);
                this.profile = await client.GetProfile();
                enableButtons();
            }
            catch
            {
                Logger.Write("Unable to Connect using the Google Token.");
                MessageBox.Show("Unable to Authenticate with Login Server.", "Login Problem");
                Application.Exit();
            }
        }
        private async Task LoginPtc(string username, string password)
        {
            try
            {
                // Login Method
                _loginMethod = AuthType.Ptc;
                _username = username;
                _password = password;

                // Creating the Settings
                Logger.Write("Adjusting the Settings.");
                UserSettings.Default.AuthType = AuthType.Ptc.ToString();
                UserSettings.Default.PtcUsername = username;
                UserSettings.Default.PtcPassword = password;
                _settings = new Settings();

                // Begin Login
                Logger.Write("Trying to Login with PTC Credentials...");
                Client client = new Client(_settings);
                await client.DoPtcLogin(_settings.PtcUsername, _settings.PtcPassword);
                await client.SetServer();

                // Server Ready
                Logger.Write("Connected! Server is Ready.");                
                _client = client;

                Logger.Write("Attempting to Retrieve Inventory and Player Profile...");
                _inventory = new Inventory(client);
                _profile = await client.GetProfile();
                EnableButtons();
                _loginSuccess = true;
            }         
            catch(Exception ex)
            {
                // Error Logging
                ErrorReportCreator.Create("PTCLoginError", "Unable to Login with PTC", ex);

                Logger.Write("Unable to Connect using the PTC Credentials.");
                MessageBox.Show(@"Unable to Authenticate with Login Server.", @"Login Problem");
                Application.Exit();
            }
        }
        private async Task LoginGoogle(string username, string password)
        {
            try
            {
                // Login Method
                _loginMethod = AuthType.Google;
                _username = username;
                _password = password;

                // Creating the Settings
                Logger.Write("Adjusting the Settings.");
                UserSettings.Default.AuthType = AuthType.Google.ToString();
                _settings = new Settings();

                // Begin Login
                Logger.Write("Trying to Login with Google Token...");
                Client client = new Client(_settings);
                client.DoGoogleLogin(username, password);
                await client.SetServer();

                // Server Ready
                Logger.Write("Connected! Server is Ready.");
                _client = client;

                Logger.Write("Attempting to Retrieve Inventory and Player Profile...");
                _inventory = new Inventory(client);
                _profile = await client.GetProfile();
                EnableButtons();
                _loginSuccess = true;
            }
            catch (GoogleException ex)
            {
                if(ex.Message.Contains("NeedsBrowser"))
                {
                    StringBuilder sb = new StringBuilder();
                    sb.AppendLine("It seems you have Google 2 Factor Authentication enabled.");
                    sb.AppendLine("In order to enable this bot to access your Google Account you need to create an App Password and use that one instead of your Google Password.");
                    sb.AppendLine();
                    sb.AppendLine("Please go to: https://security.google.com/settings/security/apppasswords");                    
                    sb.AppendLine("In 'Select App' select 'Other' and 'on my' select 'Windows Computer'.");
                    sb.AppendLine();
                    sb.AppendLine("This will generate a random password use that password login to the bot.");                    
                    MessageBox.Show(sb.ToString(), "Google 2 Factor Authentication");
                    Application.Exit();
                }

                if(ex.Message.Contains("BadAuth"))
                {
                    MessageBox.Show("Your Google Credentials are incorrect.", "Google Login");
                    Application.Exit();
                }
            }
            catch(Exception ex)
            {
                // Error Logging
                ErrorReportCreator.Create("GoogleLoginError", "Unable to Login with Google", ex);

                Logger.Write("Unable to Connect using the Google Token.");
                MessageBox.Show(@"Unable to Authenticate with Login Server.", @"Login Problem");
                Application.Exit();
            }
        }
Example #13
0
 public Logic(ISettings clientSettings)
 {
     this._clientSettings = clientSettings;
     this._client = new Client(this._clientSettings);
     this._inventory = new Inventory(this._client);
 }