Пример #1
0
        public void SetSettings(ISettings settings)
        {
            Settings = settings;

            Login     = new Rpc.Login(this);
            Player    = new Rpc.Player(this);
            Download  = new Rpc.Download(this);
            Inventory = new Rpc.Inventory(this);
            Map       = new Rpc.Map(this);
            Fort      = new Rpc.Fort(this);
            Encounter = new Rpc.Encounter(this);
            Misc      = new Rpc.Misc(this);

            Player.SetCoordinates(Settings.DefaultLatitude, Settings.DefaultLongitude, Settings.DefaultAltitude);

            ProxyEx proxy = new ProxyEx
            {
                Address  = Settings.ProxyIP,
                Port     = Settings.ProxyPort,
                Username = Settings.ProxyUsername,
                Password = Settings.ProxyPassword
            };

            HttpClientHandler handler = new HttpClientHandler
            {
                AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate,
                AllowAutoRedirect      = false,
                Proxy    = proxy.AsWebProxy(),
                UseProxy = true,
            };

            PokemonHttpClient = new PokemonHttpClient(handler);
        }
Пример #2
0
        public Client(ISettings settings)
        {
            Settings          = settings;
            proxy             = InitProxy();
            PokemonHttpClient = new PokemonHttpClient();
            Login             = new Rpc.Login(this);
            Player            = new Rpc.Player(this);
            Download          = new Rpc.Download(this);
            Inventory         = new Rpc.Inventory(this);
            Map       = new Rpc.Map(this);
            Fort      = new Rpc.Fort(this);
            Encounter = new Rpc.Encounter(this);
            Misc      = new Rpc.Misc(this);

            Player.SetCoordinates(settings.DefaultLatitude, settings.DefaultLongitude, settings.DefaultAltitude);

            InventoryLastUpdateTimestamp = 0;

            /*AppVersion = 4303;
             * SettingsHash = "";
             *
             * CurrentApiEmulationVersion = new Version("0.43.3");*/

            AppVersion   = 4500;
            SettingsHash = "";

            CurrentApiEmulationVersion = new Version("0.45.0");
        }
Пример #3
0
        public Client(Shared.ClientSettings settings)
        {
            ReadyToUse        = false;
            AuthType          = settings.userType;
            Username          = settings.userName;
            Password          = settings.password;
            proxy             = InitProxy(settings.proxyUrl, settings.proxyPort, settings.proxyUser, settings.proxyPass);
            PokemonHttpClient = new PokemonHttpClient();
            Login             = new Rpc.Login(this);
            Player            = new Rpc.Player(this);
            Download          = new Rpc.Download(this);
            Inventory         = new Rpc.Inventory(this);
            Map       = new Rpc.Map(this);
            Fort      = new Rpc.Fort(this);
            Encounter = new Rpc.Encounter(this);
            Misc      = new Rpc.Misc(this);
            Hasher    = new PokeHashHasher(settings.hashKey);
            Store     = new PokemonGo.RocketAPI.Rpc.Store(this);
            Platform  = POGOProtos.Enums.Platform.Ios;

            //Player.SetCoordinates(settings.latitude, settings.longitude, settings.altitude);

            InventoryLastUpdateTimestamp = 0;

            AppVersion   = Resources.Api.ClientVersionInt;
            SettingsHash = "";

            CurrentApiEmulationVersion = settings.currentApi;
        }
Пример #4
0
        public Client(ISettings settings, IApiFailureStrategy apiFailureStrategy)
        {
            //handle initial session hash
            Random = new Random(DateTime.Now.Millisecond);
            GenerateNewSessionHash();

            //setup
            Settings   = settings;
            ApiFailure = apiFailureStrategy;
            if (settings.UseProxy)
            {
                InitProxy(settings);
            }
            PokemonHttpClient = new PokemonHttpClient(settings);
            Login             = new Rpc.Login(this);
            Player            = new Rpc.Player(this);
            Download          = new Rpc.Download(this);
            Inventory         = new Rpc.Inventory(this);
            Map       = new Rpc.Map(this);
            Fort      = new Rpc.Fort(this);
            Encounter = new Rpc.Encounter(this);
            Misc      = new Rpc.Misc(this);

            //player coords
            Player.SetCoordinates(Settings.DefaultLatitude, Settings.DefaultLongitude, Settings.DefaultAltitude);
        }
Пример #5
0
        public Client(ISettings settings)
        {
            Settings = settings;

            Login     = new Rpc.Login(this);
            Player    = new Rpc.Player(this);
            Download  = new Rpc.Download(this);
            Inventory = new Rpc.Inventory(this);
            Map       = new Rpc.Map(this);
            Fort      = new Rpc.Fort(this);
            Encounter = new Rpc.Encounter(this);
            Misc      = new Rpc.Misc(this);

            Player.SetCoordinates(Settings.DefaultLatitude, Settings.DefaultLongitude, Settings.DefaultAltitude);
        }
Пример #6
0
        public Client(ISettings settings)
        {
            Settings = settings;

            Login = new Rpc.Login(this);
            Player = new Rpc.Player(this);
            Download = new Rpc.Download(this);
            Inventory = new Rpc.Inventory(this);
            Map = new Rpc.Map(this);
            Fort = new Rpc.Fort(this);
            Encounter = new Rpc.Encounter(this);
            Misc = new Rpc.Misc(this);

            Player.SetCoordinates(Settings.DefaultLatitude, Settings.DefaultLongitude, Settings.DefaultAltitude);
        }
        public Client(ISettings settings)
        {
            DeviceId = RequestBuilder.GetDeviceId();
            RequestBuilder.SetDevice(settings);

            Settings = settings;

            Login     = new Rpc.Login(this);
            Player    = new Rpc.Player(this);
            Download  = new Rpc.Download(this);
            Inventory = new Rpc.Inventory(this);
            Map       = new Rpc.Map(this);
            Fort      = new Rpc.Fort(this);
            Encounter = new Rpc.Encounter(this);
            Misc      = new Rpc.Misc(this);
        }
Пример #8
0
        public Client(ISettings settings, IApiFailureStrategy apiFailureStrategy)
        {
            Settings   = settings;
            ApiFailure = apiFailureStrategy;

            Login     = new Rpc.Login(this);
            Player    = new Rpc.Player(this);
            Download  = new Rpc.Download(this);
            Inventory = new Rpc.Inventory(this);
            Map       = new Rpc.Map(this);
            Fort      = new Rpc.Fort(this);
            Encounter = new Rpc.Encounter(this);
            Misc      = new Rpc.Misc(this);

            Player.SetCoordinates(Settings.DefaultLatitude, Settings.DefaultLongitude, 0.0);
        }
Пример #9
0
        public Client(Shared.ClientSettings settings)
        {
            ReadyToUse        = false;
            AuthType          = settings.userType;
            Username          = settings.userName;
            Password          = settings.password;
            proxy             = InitProxy(settings.proxyUrl, settings.proxyPort, settings.proxyUser, settings.proxyPass);
            PokemonHttpClient = new PokemonHttpClient();
            Login             = new Rpc.Login(this);
            Player            = new Rpc.Player(this);
            Download          = new Rpc.Download(this);
            Inventory         = new Rpc.Inventory(this);
            Map       = new Rpc.Map(this);
            Fort      = new Rpc.Fort(this);
            Encounter = new Rpc.Encounter(this);
            Misc      = new Rpc.Misc(this);
            Crypter   = new Cipher();
            Hasher    = new PokeHashHasher(settings.hashKey);
            Store     = new PokemonGo.RocketAPI.Rpc.Store(this);

            if (DeviceSetup.SelectedDevice.OSType == "iOS")
            {
                Platform = POGOProtos.Enums.Platform.Ios;
            }
            else
            {
                Platform = POGOProtos.Enums.Platform.Android;
            }

            Logger.Info("Platform:" + Platform);


            InventoryLastUpdateTimestamp = 0;

            AppVersion   = Resources.Api.AndroidClientVersionInt;
            SettingsHash = "";

            CurrentApiEmulationVersion = settings.currentApi;
        }