| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Just a quick thought. If I have seen it right the Accounts table will be dropped on -cd. I think it would make sense not to drop it. :) |
Sorry, something went wrong.
|
@peterbaumert Thats why its marked as [WIP] :D |
Sorry, something went wrong.
|
|
||
| remote_config = api_response['responses']['DOWNLOAD_REMOTE_CONFIG_VERSION'] | ||
| if remote_config.result == 0: | ||
| Accounts.set_tempban(account) |
There was a problem hiding this comment.
Please handle this during the login as it is the only point it makes sense and we should avoid messing module concerns.
Sorry, something went wrong.
| def get_accounts_in_use(min_level=1, max_level=40): | ||
| query = (Accounts | ||
| .select() | ||
| .where((Accounts.instance_name == args.status_name) & |
There was a problem hiding this comment.
pass the status_name as a parameter we should avoid using globals
Sorry, something went wrong.
There was a problem hiding this comment.
@friscoMad is correct, better to pass it as a parameter.
Sorry, something went wrong.
| num_fields = len(fields) | ||
|
|
||
| if num_fields == 2: | ||
| account = { |
There was a problem hiding this comment.
I am quite sure the can be rewritten shomehow to avoid having to declare defaults twice.
Sorry, something went wrong.
There was a problem hiding this comment.
@friscoMad is correct. Define the defaults for the account object outside of the conditional, then update the object according to the values you have available.
e.g.:
account = { 'something': 'default' }
if num_fields = x:
account['something_else'] = 1
elif num_fields = y:
account['something_else'] = 2
Sorry, something went wrong.
| ((last_scan_date - datetime.utcnow()).total_seconds() + | ||
| self.args.scan_delay), | ||
| 2) | ||
| return min(max(((last_scan_date - datetime.utcnow()).total_seconds() + |
There was a problem hiding this comment.
?? This seem totally unrelated.
Sorry, something went wrong.
There was a problem hiding this comment.
Why the change @Alderon86 ?
Sorry, something went wrong.
| for i, account in enumerate(args.accounts): | ||
| account_queue.put(account) | ||
| add_accounts_to_queue(args, account_queue, db_updates_queue, args.workers, | ||
| max_level=29, init=True) |
There was a problem hiding this comment.
I don't think this will happen anytime soon but sometime ago there was people scanning with lv30 maybe a flag should be added, maybe we can add it when it is needed.
Sorry, something went wrong.
| (Accounts(username=account['username'], | ||
| in_use=False, | ||
| instance_name=None, | ||
| tempban=True) |
There was a problem hiding this comment.
permban
Sorry, something went wrong.
| #wh-threads: # Number of webhook threads; increase if the webhook queue falls behind. (default=1) | ||
| #wh-retries: # Number of times to retry sending webhook data on failure (default=5) | ||
| #wh-timeout: # Timeout (in seconds) for webhook requests (default=1). | ||
| #wh-timeout: # Timeout (in seconds) for webhook requests (default=2). |
There was a problem hiding this comment.
Default has been 1 for a while, and the new webhook updates have changed timeout config items. Could you rebase to latest so it's easier to keep track?
Sorry, something went wrong.
|
|
||
| from pgoapi.utilities import get_cell_ids | ||
| from .models import Accounts | ||
| from pgoapi.utilities import f2i, get_cell_ids |
There was a problem hiding this comment.
Accounts is an unused import, and the one below it is unused (f2i) and duplicate (get_cell_ids).
Sorry, something went wrong.
| ((last_scan_date - datetime.utcnow()).total_seconds() + | ||
| self.args.scan_delay), | ||
| 2) | ||
| return min(max(((last_scan_date - datetime.utcnow()).total_seconds() + |
There was a problem hiding this comment.
Why the change @Alderon86 ?
Sorry, something went wrong.
| # Parse recorded time and place also to db. | ||
| account['latitude'] = scan_coords[0] | ||
| account['longitude'] = scan_coords[1] | ||
| dbq.put((Accounts, {0: Accounts.db_format(account)})) |
There was a problem hiding this comment.
Consider flagging accounts as "dirty" and sending the dirty accounts to the DB update queue as a group every x time. The upsert code is built to be efficient for multiple inserts/updates, this'll reduce overhead per query.
Sorry, something went wrong.
| t.start() | ||
| else: | ||
| log.info('Periodical proxies refresh disabled.') | ||
| >>>>>>> 0e17804... Accounts in db Alpha 1 |
There was a problem hiding this comment.
😬
>>>> 0e17804... Accounts in db Alpha 1
Sorry, something went wrong.
| return results | ||
|
|
||
|
|
||
| # TODO: Add support for high_lvl_accounts. |
There was a problem hiding this comment.
Still todo? I see for ex. get_hlvl_account. Clarify what's missing.
Sorry, something went wrong.
| # Checking if account is shadowbanned | ||
| if (nearby_pokemon or wild_pokemon) and not args.no_pokemon: | ||
|
|
||
| # Create list of present pokemon IDs for blinded check |
There was a problem hiding this comment.
Dots in all the comments here.
.
Sorry, something went wrong.
|
|
||
| # Remove common pokemons from seen | ||
| rare_finds = [p for p in nearby_pokemon_ids if p not in common_ids] | ||
| # Checking if found only common pokemons |
There was a problem hiding this comment.
Indentation.
Sorry, something went wrong.
| if len(rare_finds) == 0: | ||
| # Get nearby active pokemons from database | ||
| status['nonrares'] += 1 | ||
| if status['nonrares'] >= 3: |
There was a problem hiding this comment.
Is 3 a good enough count? What's the average count of non-rare scans on regular accounts?
Sorry, something went wrong.
|
|
||
| if ('ENCOUNTER' in enc_responses and | ||
| enc_responses['ENCOUNTER'].status != 1): | ||
| enc_responses['ENCOUNTER'].status == 0): |
There was a problem hiding this comment.
Keep != 1 for now, until the code below has been added for the other response codes.
Sorry, something went wrong.
| .where((Accounts.in_use == 1) & | ||
| (Accounts.last_modified < | ||
| (datetime.utcnow() - timedelta(minutes=15)))) | ||
| .execute()) |
There was a problem hiding this comment.
These account cleanups should be in their own methods in Accounts and be called by the clean_db_loop.
Sorry, something went wrong.
| cache = TTLCache(maxsize=100, ttl=60 * 5) | ||
|
|
||
| db_schema_version = 20 | ||
| db_schema_version = 21 |
There was a problem hiding this comment.
is this correct to increase schema version?
Sorry, something went wrong.
There was a problem hiding this comment.
Once this is merged we dont want to get back to older version to not mess up setups @fosJoddie
Sorry, something went wrong.
There was a problem hiding this comment.
This should be 22 now
Sorry, something went wrong.
to login sequence, all of this needs proper testing/fixing.
placeholders for l30 shadowban handling
I was under the impression that the logic would load files from instance A and lock them to instance A, and then load files for instance B separate from that? The logic will gladly take an account that is level 0 (not done tutorial) over an account that has done tutorial and cause some issues from this (not sure if 100% sure thing to happen or somewhat random). Since accounts last a very short time, it's bad if restart will use lvl 0 accounts before lvl 2. |
Sorry, something went wrong.
|
@fosJoddie this logic will be applied with #2424 for now, we just inserting accs into the db and use them fpr scanning assuming your are only using one! .csv file |
Sorry, something went wrong.
|
I have been thinking about what @fosJoddie posted and we will probably break things badly for some people, my use case is naive just 1 instance 1 file with accounts, that should be ok with this PR but I am not that sure that people with multiple instances would understand or be able to have the same setup. With this PR only 1 instance should be in charge of the accounts file but there is no way to comunicate to other instances that A is the instance in charge. So my proposal would be to add all this code and PR but try to avoid as much user errors as possible, let RM work 2 ways:
That way #1 can keep working as we advance down the road if #2 does not fit all use cases, and #2 it is clear enough to avoid issues with several instances, single instances on the other hand will need to run #2 alone to hot change accounts. If this seems too much work then at least I will ask some people with several instances to run this PR for some time to see if it fits all needs. And I also came accross a possible problem, maybe it has already been thought if accounts are removed from DB but workers are not forced to abandon those accounts they will be readded when they are changed (in_use to False or whatever) and reused again if there is no error with it, at least it is a bit weird as we will be using an account not in the file. |
Sorry, something went wrong.
|
@friscoMad and @sebastienvercammen
I just wanted to clarify my view and justify the reason I created PR #2424. If anyone wants to help and review code I'm accepting it gladly 👍 |
Sorry, something went wrong.
|
Per our discussion in Discord in the RM channels and between Foxbabe and myself, we've decided the following:
@neskk has received this explanation in PM on Discord. The response was the following:
This is not kindergarten. So please stop acting like it. "Drama" is a thing that happens on school grounds, or when children are spreading rumors about who's in a relationship with whom. After having been removed two times already from our Discord channels for behavior, this is the final straw. Either you do your best to be a decent person and to work together and learn, and you learn to communicate properly with people instead of insulting them each time something is explained to you, or you're not meant to be on a collaboration platform in the first place. @neskk Should you still want to contribute, I can guarantee that each of your future PRs will be considered objectively and without bias. But any comments you make on Github or Discord will be looked at with renewed scrutiny. This is the third and final time I've had to explain this to you. |
Sorry, something went wrong.
|
Sometimes I wonder why I keep spending my time on this project since all you do @sebastienvercammen is hold a grudge towards me... but it's fine, I forgive you :)
This is not true whatsoever, Alderon and I talked a bit and I tried to help him saying what changes were going to help 2376 get to the same database model I was using in 2424.
Maybe I wasn't clear enough... I didn't work on this for the last two months hence not having collaborated with Alderon. Due to my lack of time I'm guessing Alderon was tired of waiting and decided to take action in his own hands - which I encouraged back then. To say that I refused to collaborate is untrue and unfair. Alderon could also have asked me to collaborate on my branch but decided to create his own... I have no problem whatsoever with this but you're painting me as an uncooperative person which is not true at all. As I've said in Discord directly to Seb (I think he misunderstood my point): |
Sorry, something went wrong.
I'm not. It's easy to change a person's words to fit your own narrative in private when you believe no one is listening. I make my conversations public so the team has the full context, with no words edited or removed. That includes your attempt at an insult, which you've quickly retracted just now in PM on Discord:
As for "misunderstandings":
The relevant context from PM:
("The team", "messages" and "decisions" refering to me linking the full context to our team members, as well as the decisions explained above about both PRs.) As mentioned over and over again: the full context was shared with the team, you've been informed of the circumstances and you will not receive a fourth warning. We've had enough of your games. We're usually flexible, and we try to accomodate everyone, but you've been so disruptive that we don't have the freedom to extend that flexibility to you. So we won't anymore. |
Sorry, something went wrong.
And I kept telling you that it didn't make sense to separate things. I really didn't have a choice in the matter, you decided it was that way and my opinion was not taken in consideration. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
This is a combination of an old Pr "F-HealthyAccountDB" (can be found on my repo) and Neskk's approach.
Added "on-the-fly" support for csv files. No instance restarting is needed, just change your .csv.
Parses given .csv file into database to use the defined number of workers via -w to start scanning.
Accounts are locked to instances.
Csv Parser got rewritten to also add the account level (usefull for l30's and above)
Removed couple of commands like -u and -p because its defined via csv.
Accounts removed from the csv also will get removed from db.
TODO's are marked properly.
Motivation and Context
coming soon
How Has This Been Tested?
locale instance
Screenshots (if appropriate):
coming soon
Types of changes
Checklist:
thanks @neskk for inspiration