Skip to content

Commit

Permalink
New screen Limitations aka most likely better MAINTENANCE (#1362)
Browse files Browse the repository at this point in the history
* Update utils.py

* Update utils.py

* Update screenPath.py

* Update screen_type.py

* Update AbstractWorkerStrategy.py

* Update screenPath.py

* Update screenPath.py
  • Loading branch information
JabLuszko authored Sep 2, 2023
1 parent 9766539 commit adecbf5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
13 changes: 11 additions & 2 deletions mapadroid/ocr/screenPath.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,11 @@ async def __handle_screentype(self, screentype: ScreenType,
logger.warning('Account saw maintenance warning!')
await self._account_handler.mark_burnt(self._worker_state.device_id,
BurnType.MAINTENANCE)
elif screentype == ScreenType.LIMITATIONS:
self._nextscreen = ScreenType.UNDEFINED
logger.warning('Account saw limitations/maintenance warning!')
await self._account_handler.mark_burnt(self._worker_state.device_id,
BurnType.MAINTENANCE)
elif screentype == ScreenType.POGO:
screentype = await self.__check_pogo_screen_ban_or_loading(screentype, y_offset=y_offset)
elif screentype == ScreenType.QUEST:
Expand Down Expand Up @@ -418,8 +423,12 @@ async def __handle_google_login(self, screentype) -> ScreenType:

async def __handle_retry_screen(self, diff, global_dict) -> None:
self._nextscreen = ScreenType.UNDEFINED
click_text = 'DIFFERENT,AUTRE,AUTORISER,ANDERES,KONTO,ACCOUNT'
await self.__click_center_button_text(click_text, diff, global_dict)
# forcing clear_game_data here due to Niantic changes and game now remembering/pre-filling username on login
await self.clear_game_data()
# after clear_game_data there should be no reason to click this button as game gets killed
# but let's leave it here if Niantic decides this is a bug rather than QOL change
#click_text = 'DIFFERENT,AUTRE,AUTORISER,ANDERES,KONTO,ACCOUNT'
#await self.__click_center_button_text(click_text, diff, global_dict)

async def __click_center_button_text(self, click_text, diff, global_dict):
n_boxes = len(global_dict['text'])
Expand Down
1 change: 1 addition & 0 deletions mapadroid/ocr/screen_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class ScreenType(Enum):
WILLOWNAME = 35 # Professor Blabla asking for name.
ADVENTURESYNC = 36 # Adventure Sync overlay after tutorial. One blue button: Turn it On!
WILLOWGO = 37 # Professor Blabla at end of tutorial.
LIMITATIONS = 38 # Most likely new MAINTENANCE/24h cooldown
POGO = 99 # uhm, whatever... At least pogo is topmost, no idea where we are yet tho (in the process of switching)
ERROR = 100 # some issue occurred while handling screentypes or not able to determine screen
BLACK = 110 # screen is black, likely loading up game
Expand Down
3 changes: 2 additions & 1 deletion mapadroid/ocr/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
34: ['nearby!', 'Nahe!', 'pres'],
35: ['Congratulations!', 'Gluckwunsch!', 'felicitations!', 'first', 'erstes', 'abord'],
36: ['Sync'],
37: ['PokéStops.']
37: ['PokéStops.'],
38: ['limitations']
}


Expand Down
3 changes: 3 additions & 0 deletions mapadroid/worker/strategy/AbstractWorkerStrategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,9 @@ async def _handle_screen(self):
elif screen_type == ScreenType.MAINTENANCE:
logger.warning("Maintenance screen - switch account ...")
await self._switch_user()
elif screen_type == ScreenType.LIMITATIONS:
logger.warning("Limitations/Maintenance screen - switch account ...")
await self._switch_user()
elif screen_type in [ScreenType.ERROR, ScreenType.FAILURE]:
logger.warning('Something wrong with screendetection or pogo failure screen')
self._worker_state.login_error_count += 1
Expand Down

0 comments on commit adecbf5

Please sign in to comment.