mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-30 05:03:54 +08:00
Fix: Catch game died in camera update
This commit is contained in:
@@ -151,7 +151,7 @@ class InfoHandler(ModuleBase):
|
|||||||
self._hot_fix_check_wait.clear()
|
self._hot_fix_check_wait.clear()
|
||||||
if self._hot_fix_check_wait.started() and 3 <= self._hot_fix_check_wait.current() <= 6:
|
if self._hot_fix_check_wait.started() and 3 <= self._hot_fix_check_wait.current() <= 6:
|
||||||
if not self.device.app_is_running():
|
if not self.device.app_is_running():
|
||||||
logger.warning('Detected hot fixes from game server, game died')
|
logger.error('Detected hot fixes from game server, game died')
|
||||||
raise GameNotRunningError
|
raise GameNotRunningError
|
||||||
self._hot_fix_check_wait.clear()
|
self._hot_fix_check_wait.clear()
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import numpy as np
|
|||||||
from module.base.timer import Timer
|
from module.base.timer import Timer
|
||||||
from module.base.utils import area_offset
|
from module.base.utils import area_offset
|
||||||
from module.combat.assets import GET_ITEMS_1, GET_ITEMS_1_RYZA
|
from module.combat.assets import GET_ITEMS_1, GET_ITEMS_1_RYZA
|
||||||
from module.exception import CampaignEnd, MapDetectionError
|
from module.exception import CampaignEnd, GameNotRunningError, MapDetectionError
|
||||||
from module.handler.assets import AUTO_SEARCH_MENU_CONTINUE, GAME_TIPS
|
from module.handler.assets import AUTO_SEARCH_MENU_CONTINUE, GAME_TIPS
|
||||||
from module.logger import logger
|
from module.logger import logger
|
||||||
from module.map.map_base import CampaignMap, location2node
|
from module.map.map_base import CampaignMap, location2node
|
||||||
@@ -179,6 +179,10 @@ class Camera(MapOperation):
|
|||||||
logger.warning(string)
|
logger.warning(string)
|
||||||
x, y = string.split('=')[1].strip('() ').split(',')
|
x, y = string.split('=')[1].strip('() ').split(',')
|
||||||
self._map_swipe((-int(x.strip()), -int(y.strip())))
|
self._map_swipe((-int(x.strip()), -int(y.strip())))
|
||||||
|
# Finally check if game is alive
|
||||||
|
elif not self.device.app_is_running():
|
||||||
|
logger.error('Trying to update camera but game died')
|
||||||
|
raise GameNotRunningError
|
||||||
else:
|
else:
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user