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 usage option, take 2 #2302

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

AEtHeLsYn
Copy link
Contributor

Description

With this PR we can choose if we want to use the proxies for all connecions, only for ptc login or only for niantic connections

Motivation and Context

We can use proxies only for ptc login or for niantic sessions if we have an IP banned for one of them, not both.

How Has This Been Tested?

Local map

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

parser.add_argument('-pxu', '--proxy-usage',
help=('Select which connections use proxy ' +
'(all/ptc/niantic).'),
type=str, default='all')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the code I think that using a repeated value like wh-types it is better (also add valid values) that way the ifs would be if 'ptc' in args.proxy_usage instead of ìf args.proxy_usage != 'niantic'` also it is forward compatibe if in there future more proxy controls are needed (wno knows).
The problem is that I think you can not set the default value to both, but we can do that in code, set default to None and if there are no values defined then just add all of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact I chose that approach because I couldn't find a way to set default values to none in a repeated value. This way behaves the same as proxy rotation variable, even if you spell it wrong the default behaviour is the current one.

@billyjbryant
Copy link
Contributor

@AEtHeLsYn is this PR still active?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants