mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-22 00:35:34 +00:00
Fix: [ALAS] Device.__init__() was never called if EmulatorNotRunningError handled
This commit is contained in:
parent
3180e10356
commit
37d45af63f
@ -71,11 +71,14 @@ class Device(Screenshot, Control, AppControl):
|
||||
stuck_timer = Timer(60, count=60).start()
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
for _ in range(2):
|
||||
for trial in range(4):
|
||||
try:
|
||||
super().__init__(*args, **kwargs)
|
||||
break
|
||||
except EmulatorNotRunningError:
|
||||
if trial >= 3:
|
||||
logger.critical('Failed to start emulator after 3 trial')
|
||||
raise RequestHumanTakeover
|
||||
# Try to start emulator
|
||||
if self.emulator_instance is not None:
|
||||
self.emulator_start()
|
||||
@ -84,7 +87,7 @@ class Device(Screenshot, Control, AppControl):
|
||||
f'No emulator with serial "{self.config.Emulator_Serial}" found, '
|
||||
f'please set a correct serial'
|
||||
)
|
||||
raise
|
||||
raise RequestHumanTakeover
|
||||
|
||||
# Auto-fill emulator info
|
||||
if IS_WINDOWS and self.config.EmulatorInfo_Emulator == 'auto':
|
||||
|
@ -221,7 +221,7 @@ class PlatformWindows(PlatformBase, EmulatorManager):
|
||||
logger.info(f'Found azurlane packages: {m}')
|
||||
|
||||
interval = Timer(0.5).start()
|
||||
timeout = Timer(300).start()
|
||||
timeout = Timer(180).start()
|
||||
new_window = 0
|
||||
while 1:
|
||||
interval.wait()
|
||||
|
Loading…
Reference in New Issue
Block a user