From fa98c0f8c06b85f8dcfe29ed4af03595094c601c Mon Sep 17 00:00:00 2001 From: "Sascha G." Date: Wed, 3 Aug 2016 15:18:51 +0200 Subject: [PATCH] Add proxy support --- PoGo.PokeMobBot.Logic/Settings.cs | 52 ++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/PoGo.PokeMobBot.Logic/Settings.cs b/PoGo.PokeMobBot.Logic/Settings.cs index 9a96298..feed882 100644 --- a/PoGo.PokeMobBot.Logic/Settings.cs +++ b/PoGo.PokeMobBot.Logic/Settings.cs @@ -96,10 +96,14 @@ public void Save() public class GlobalSettings { - [JsonIgnore] internal AuthSettings Auth = new AuthSettings(); - [JsonIgnore] public string GeneralConfigPath; - [JsonIgnore] public string ProfilePath; - [JsonIgnore] public string ProfileConfigPath; + [JsonIgnore] + internal AuthSettings Auth = new AuthSettings(); + [JsonIgnore] + public string GeneralConfigPath; + [JsonIgnore] + public string ProfilePath; + [JsonIgnore] + public string ProfileConfigPath; //bot start public bool AutoUpdate = true; @@ -110,6 +114,13 @@ public class GlobalSettings public string TranslationLanguageCode = "en"; public int WebSocketPort = 14251; + //proxy configuration + public bool proxyEnable = false; + public bool proxyEnableAuth = false; + public string proxyHost = "localhost:8080"; + public string proxyUser = "user"; + public string proxyPass = "secret"; + //coords and movement public bool Teleport = false; public double DefaultLatitude = 40.785091; @@ -621,6 +632,37 @@ string ISettings.GooglePassword set { _settings.Auth.GooglePassword = value; } } + + bool ISettings.proxyEnable + { + get { return _settings.proxyEnable; } + set { _settings.proxyEnable = value; } + } + + bool ISettings.proxyEnableAuth + { + get { return _settings.proxyEnableAuth; } + set { _settings.proxyEnableAuth = value; } + } + + string ISettings.proxyHost + { + get { return _settings.proxyHost; } + set { _settings.proxyHost = value; } + } + + string ISettings.proxyUser + { + get { return _settings.proxyUser; } + set { _settings.proxyUser = value; } + } + + string ISettings.proxyPass + { + get { return _settings.proxyPass; } + set { _settings.proxyPass = value; } + } + } public class LogicSettings : ILogicSettings @@ -634,7 +676,7 @@ public LogicSettings(GlobalSettings settings) public string ProfilePath => _settings.ProfilePath; public string ProfileConfigPath => _settings.ProfileConfigPath; - public int SnipeRequestTimeoutSeconds => _settings.SnipeRequestTimeoutSeconds*1000; + public int SnipeRequestTimeoutSeconds => _settings.SnipeRequestTimeoutSeconds * 1000; public string GeneralConfigPath => _settings.GeneralConfigPath; public bool AutoUpdate => _settings.AutoUpdate; public bool TransferConfigAndAuthOnUpdate => _settings.TransferConfigAndAuthOnUpdate;