Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proxy support #533

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 47 additions & 5 deletions PoGo.PokeMobBot.Logic/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand Down