Fixes and updates
This commit is contained in:
parent
ad29045ace
commit
cf797f2f60
@ -15,24 +15,26 @@ class SlowRequests(Session):
|
|||||||
timeout = datetime.timedelta(milliseconds=500)
|
timeout = datetime.timedelta(milliseconds=500)
|
||||||
uas = [
|
uas = [
|
||||||
# Chrome
|
# Chrome
|
||||||
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36', # noqa
|
||||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', # noqa
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', # noqa
|
||||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36', # noqa
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36', # noqa
|
||||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', # noqa
|
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36',
|
||||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', # noqa
|
|
||||||
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36',
|
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36',
|
||||||
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36',
|
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36',
|
||||||
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36',
|
|
||||||
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
|
|
||||||
|
|
||||||
# FireFox
|
# FireFox
|
||||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0',
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0',
|
||||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0',
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0',
|
||||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0',
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0',
|
||||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0',
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0',
|
||||||
'Mozilla/5.0 (X11; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0',
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0',
|
||||||
'Mozilla/5.0 (X11; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0',
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0',
|
||||||
'Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0',
|
'Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0',
|
||||||
'Mozilla/5.0 (X11; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0',
|
'Mozilla/5.0 (X11; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0',
|
||||||
|
'Mozilla/5.0 (X11; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0',
|
||||||
|
'Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0',
|
||||||
|
'Mozilla/5.0 (X11; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0',
|
||||||
|
'Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0',
|
||||||
]
|
]
|
||||||
debug = False
|
debug = False
|
||||||
|
|
||||||
|
@ -1609,7 +1609,8 @@ class CitizenMilitary(CitizenTravel):
|
|||||||
self.travel_to_residence()
|
self.travel_to_residence()
|
||||||
break
|
break
|
||||||
|
|
||||||
def fight(self, battle: classes.Battle, division: classes.BattleDivision, side: classes.BattleSide = None, count: int = None) -> int:
|
def fight(self, battle: classes.Battle, division: classes.BattleDivision, side: classes.BattleSide = None,
|
||||||
|
count: int = None) -> int:
|
||||||
"""Fight in a battle.
|
"""Fight in a battle.
|
||||||
|
|
||||||
Will auto activate booster and travel if allowed to do it.
|
Will auto activate booster and travel if allowed to do it.
|
||||||
@ -1763,7 +1764,8 @@ class CitizenMilitary(CitizenTravel):
|
|||||||
if resp.json().get('error'):
|
if resp.json().get('error'):
|
||||||
self.write_log(resp.json().get('message'))
|
self.write_log(resp.json().get('message'))
|
||||||
return False
|
return False
|
||||||
self._report_action("MILITARY_DIV_SWITCH", f"Switched to d{division.div} in battle {battle.id}", kwargs=resp.json())
|
self._report_action("MILITARY_DIV_SWITCH", f"Switched to d{division.div} in battle {battle.id}",
|
||||||
|
kwargs=resp.json())
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def get_ground_hit_dmg_value(self, rang: int = None, strength: float = None, elite: bool = None, ne: bool = False,
|
def get_ground_hit_dmg_value(self, rang: int = None, strength: float = None, elite: bool = None, ne: bool = False,
|
||||||
@ -1963,6 +1965,13 @@ class CitizenMilitary(CitizenTravel):
|
|||||||
return member.get('panelContents', {}).get('members', [{}])[0].get('dailyOrdersCompleted')
|
return member.get('panelContents', {}).get('members', [{}])[0].get('dailyOrdersCompleted')
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
def get_possibly_empty_medals(self):
|
||||||
|
self.update_war_info()
|
||||||
|
for battle in self.all_battles.values():
|
||||||
|
for division in battle.div.values():
|
||||||
|
if division.wall['dom'] == 50 or division.wall['dom'] > 98:
|
||||||
|
yield division, division.wall['for'] == battle.invader.country.id
|
||||||
|
|
||||||
|
|
||||||
class CitizenPolitics(BaseCitizen):
|
class CitizenPolitics(BaseCitizen):
|
||||||
def get_country_parties(self, country: constants.Country = None) -> dict:
|
def get_country_parties(self, country: constants.Country = None) -> dict:
|
||||||
|
@ -569,8 +569,8 @@ class Reporter:
|
|||||||
def __bot_update(self, data: dict) -> Response:
|
def __bot_update(self, data: dict) -> Response:
|
||||||
if self.__to_update:
|
if self.__to_update:
|
||||||
for unreported_data in self.__to_update:
|
for unreported_data in self.__to_update:
|
||||||
unreported_data.update(player_id=self.citizen.id, key=self.key)
|
unreported_data.update(player_id=self.citizen_id, key=self.key)
|
||||||
unreported_data = utils.json.load(utils.json.dumps(unreported_data, cls=MyJSONEncoder))
|
unreported_data = utils.json.loads(utils.json.dumps(unreported_data, cls=MyJSONEncoder))
|
||||||
self._req.post("{}/bot/update".format(self.url), json=unreported_data)
|
self._req.post("{}/bot/update".format(self.url), json=unreported_data)
|
||||||
self.__to_update.clear()
|
self.__to_update.clear()
|
||||||
data = utils.json.loads(utils.json.dumps(data, cls=MyJSONEncoder))
|
data = utils.json.loads(utils.json.dumps(data, cls=MyJSONEncoder))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user