Silv3rPRO / proshine

A free, open-source and advanced bot for Pokémon Revolution Online.
https://proshine-bot.com/
MIT License
52 stars 69 forks source link

[feature] ProxyManager #90

Open M1L4 opened 7 years ago

M1L4 commented 7 years ago

I already whined a little about how difficult it is using proxies (see #89). There is an additional complexity to the problem. While not knowing how bot detection works in PRO, I had following scenario:

[scenarios]

[conclusion]

  1. ips get ban flagged
  2. ban flagged ips, get testes more frequently/throughly...
  3. sharing ip adresses is probably a bad idea

[feature | use case] So I would like to suggest a ProxyManager of some sorts:

[example] I currently use a text file to handle proxies. It's setup in a way that a parser could interpret. It looks like this:

--holds all active bot connections ||active|| --connection: soaktyp || ip || account_name s5||xxx.xxx.xxx.xxx:xxxx||account s4||xxx.xxx.xxx.xxx:xxxx||account2 ... --rdy to be used proxies, add new ones here ||queue|| --newly added ips xxx.xxx.xxx.xxx:xxxx xxx.xxx.xxx.xxx:xxxx --previously added ips - tested and converted into schema except for an account name since not assigned yet s4||xxx.xxx.xxx.xxx:xxxx ... --one time not connecting proxies, get moved here and will be reused as much as possible ||badflagged_soft|| s4||xxx.xxx.xxx.xxx:xxxx||account .... --if proxy isn't available at multiple occasions (with some time difference), move them here. Less likely to be reused.
||badflagged_med|| ... --after some cycles in badflagged_med, move them here. Don't attempt to reuse them. ||broken|| ... --If an account gets banned, move its used ip here, don't reuse them, if possible
||banflagged|| ... --well you can't reuse them either way XD ||banned|| ...

Keeping them in the file and not removing them allows us to just throw a handful of new proxy adresses into the ||queue|| section:

M1L4 commented 7 years ago

[Idea Update] I looked a little into this. And after verifying the current implementation, another idea suggested itself. AccountManager already writes socks connections to file. If upgraded instead of holding a single socks object, Account could hold a socks list and maybe sort them according to how probable a connection is. The only open thing then, would be the test vs other accounts. That thought might be not fully well-conceived. I'll added it for discussion :)