Skip to content

Commit 914950c

Browse files
committed
Merge pull request LmeSzinc#5093 from guoh064/handle_manjuu_2
2 parents 8ec910a + f816d27 commit 914950c

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

module/device/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Device(Screenshot, Control, AppControl, Input):
6868
click_record = collections.deque(maxlen=15)
6969
stuck_timer = Timer(60, count=60).start()
7070
stuck_timer_long = Timer(180, count=180).start()
71-
stuck_long_wait_list = ['BATTLE_STATUS_S', 'PAUSE', 'LOGIN_CHECK']
71+
stuck_long_wait_list = ['BATTLE_STATUS_S', 'PAUSE', 'LOGIN_CHECK', 'TEMPLATE_MANJUU']
7272

7373
def __init__(self, *args, **kwargs):
7474
for trial in range(4):

module/handler/info_handler.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,11 +535,18 @@ def wait_until_manjuu_disappear(self):
535535
"""
536536
Wait until manjuu loading disappear.
537537
"""
538+
# Abuse of notation. Template do not have readable name, so add string here.
539+
self.device.stuck_record_add('TEMPLATE_MANJUU')
540+
timer = Timer(1.5, count=3).start()
538541
while 1:
539542
self.device.screenshot()
540-
if not self.manjuu_count():
541-
break
542-
543+
if self.manjuu_count():
544+
timer.reset()
545+
else:
546+
if timer.reached():
547+
logger.info(f'Manjuu disappeared')
548+
break
549+
543550
def handle_manjuu(self):
544551
"""
545552
Handle manjuu loading.

0 commit comments

Comments
 (0)