|
|
@@ -13,7 +13,7 @@ from tools.emulator.ld_operate import LD
|
|
|
from tools.emulator.ys_operate import YS
|
|
|
from tools.upload_log import LogInfo
|
|
|
from tools.utils import Utils
|
|
|
-
|
|
|
+from tools.log import logger
|
|
|
|
|
|
@dataclass
|
|
|
class ScriptHelper:
|
|
|
@@ -152,13 +152,13 @@ class MyHelper:
|
|
|
# 启动模拟器并确认启动状态
|
|
|
result, message = self.emu.start_and_confirm(self.emulator_index)
|
|
|
|
|
|
- if result:
|
|
|
- self.emulator_info = message
|
|
|
- # 设置模拟器窗口位置
|
|
|
- self.emu.set_emulator_position(self.emulator_info.top_handle, self.window_id)
|
|
|
- time.sleep(1)
|
|
|
- return True, f"模拟器编号:{self.emulator_index},启动成功"
|
|
|
- return False, f"模拟器编号:{self.emulator_index},,启动失败,错误信息:{message}"
|
|
|
+ # if result:
|
|
|
+ # self.emulator_info = message
|
|
|
+ # # 设置模拟器窗口位置
|
|
|
+ # self.emu.set_emulator_position(self.emulator_info.top_handle, self.window_id)
|
|
|
+ # time.sleep(1)
|
|
|
+ # return True, f"模拟器编号:{self.emulator_index},启动成功"
|
|
|
+ # return False, f"模拟器编号:{self.emulator_index},,启动失败,错误信息:{message}"
|
|
|
except Exception as e:
|
|
|
return False, f"模拟器编号:{self.emulator_index},启动失败,错误信息:{str(e)}"
|
|
|
|
|
|
@@ -217,8 +217,12 @@ class MyHelper:
|
|
|
Returns:
|
|
|
tuple: 成功与否的标志和结果或错误信息。
|
|
|
"""
|
|
|
+
|
|
|
+ logger.info(f"进游戏了1",100)
|
|
|
try:
|
|
|
if self.game_config.script.endswith('.dll'):
|
|
|
+ logger.info(f"进游戏了3", 100)
|
|
|
+
|
|
|
# 获取字符串的字节数据
|
|
|
task_id_bytes = self.game_config.task_id.encode('gbk')
|
|
|
account_bytes = self.account_info.account.encode('gbk')
|
|
|
@@ -245,6 +249,7 @@ class MyHelper:
|
|
|
)
|
|
|
return True, result
|
|
|
elif self.game_config.script.endswith('.py'):
|
|
|
+ logger.info(f"进游戏了2", 100)
|
|
|
script_helper = ScriptHelper(dm=self.dm,
|
|
|
emu=self.emu,
|
|
|
emulator_index=self.emulator_index,
|
|
|
@@ -260,6 +265,7 @@ class MyHelper:
|
|
|
timeout=self.game_config.timeout * 60
|
|
|
)
|
|
|
result = self.script.execute('script_start_game',script_helper, timeout=30*60)
|
|
|
+ logger.info(f"进游戏了4", 100)
|
|
|
return True, result
|
|
|
else:
|
|
|
return False, "脚本文件格式错误"
|