1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 03:58:22 +08:00
This commit is contained in:
GH Action - Upstream Sync
2025-12-18 16:35:20 +00:00
4 changed files with 8 additions and 2 deletions

View File

@@ -273,6 +273,10 @@ class NemuIpcImpl:
self.connect_id = connect_id
# logger.info(f'NemuIpc connected: {self.connect_id}')
@retry
def connect_with_retry(self, on_thread=True):
self.connect(on_thread=on_thread)
def disconnect(self):
if self.connect_id == 0:
return
@@ -497,11 +501,13 @@ class NemuIpc(Platform):
logger.info(f'nemu_ipc is not available on MuMuPlayerGlobal, {self.emulator_instance.path}')
raise RequestHumanTakeover
try:
return NemuIpcImpl(
impl = NemuIpcImpl(
nemu_folder=self.emulator_instance.emulator.abspath('../'),
instance_id=self.emulator_instance.MuMuPlayer12_id,
display_id=0
).__enter__()
)
impl.connect_with_retry()
return impl
except (NemuIpcIncompatible, NemuIpcError, JobTimeout) as e:
logger.error(e)
logger.error('Unable to initialize NemuIpc')