Fix: Delay the wrong task after restart (#755)

This commit is contained in:
LmeSzinc 2021-11-22 22:40:11 +08:00
parent 4e87034b4e
commit 790515c800
2 changed files with 15 additions and 1 deletions

View File

@ -110,6 +110,10 @@ class AzurLaneAutoScript:
from module.handler.login import LoginHandler
LoginHandler(self.config, device=self.device).app_restart()
def start(self):
from module.handler.login import LoginHandler
LoginHandler(self.config, device=self.device).app_start()
def goto_main(self):
from module.ui.ui import UI
UI(self.config, device=self.device).ui_goto_main()
@ -284,7 +288,7 @@ class AzurLaneAutoScript:
logger.info('Close game during wait')
self.device.app_stop()
self.wait_until(task.next_run)
self.run('restart')
self.run('start')
elif method == 'goto_main':
logger.info('Goto main page during wait')
self.run('goto_main')

View File

@ -97,6 +97,16 @@ class LoginHandler(Combat):
logger.critical('Azur Lane server may be under maintenance, or you may lost network connection')
raise RequestHumanTakeover
def app_stop(self):
logger.hr('App stop')
self.device.app_stop()
def app_start(self):
logger.hr('App start')
self.device.app_start()
self.handle_app_login()
# self.ensure_no_unfinished_campaign()
def app_restart(self):
logger.hr('App restart')
self.device.app_stop()