mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 06:18:21 +08:00
Add: Multiple server support of MAA
This commit is contained in:
@@ -27,19 +27,19 @@ class AssistantHandler:
|
||||
ASST_HANDLER: Any
|
||||
|
||||
@staticmethod
|
||||
def load(path):
|
||||
def load(path, incremental_path=None):
|
||||
sys.path.append(path)
|
||||
try:
|
||||
from submodule.AlasMaaBridge.module.handler import asst_backup
|
||||
AssistantHandler.Asst = asst_backup.Asst
|
||||
AssistantHandler.Message = asst_backup.Message
|
||||
AssistantHandler.Asst.load(path, user_dir=path)
|
||||
AssistantHandler.Asst.load(path, user_dir=path, incremental_path=incremental_path)
|
||||
except:
|
||||
logger.warning('导入MAA失败,尝试使用原生接口导入')
|
||||
asst_module = import_module('.asst', 'Python')
|
||||
AssistantHandler.Asst = asst_module.Asst
|
||||
AssistantHandler.Message = asst_module.Message
|
||||
AssistantHandler.Asst.load(path, user_dir=path)
|
||||
AssistantHandler.Asst.load(path, user_dir=path, incremental_path=incremental_path)
|
||||
|
||||
AssistantHandler.ASST_HANDLER = None
|
||||
|
||||
@@ -213,7 +213,6 @@ class AssistantHandler:
|
||||
def fight(self):
|
||||
args = {
|
||||
"report_to_penguin": self.config.MaaRecord_ReportToPenguin,
|
||||
"server": self.config.MaaEmulator_Server,
|
||||
"client_type": self.config.MaaEmulator_PackageName,
|
||||
"DrGrandet": self.config.MaaFight_DrGrandet,
|
||||
}
|
||||
@@ -226,6 +225,8 @@ class AssistantHandler:
|
||||
|
||||
if self.config.MaaFight_Medicine is not None:
|
||||
args["medicine"] = self.config.MaaFight_Medicine
|
||||
if self.config.MaaFight_RunOutOfMedicine:
|
||||
args["medicine"] = 999
|
||||
if self.config.MaaFight_Stone is not None:
|
||||
args["stone"] = self.config.MaaFight_Stone
|
||||
if self.config.MaaFight_Times is not None:
|
||||
|
||||
Reference in New Issue
Block a user