|
|
@@ -40,7 +40,11 @@ class GlobalState:
|
|
|
frp_process: Optional[subprocess.Popen[Any]] = None
|
|
|
|
|
|
def startup_frpc():
|
|
|
- GlobalState.frp_process = subprocess.Popen(["tool/frpc.exe", "-c", "tool/frpc-desktop.toml"])
|
|
|
+ try:
|
|
|
+ GlobalState.frp_process = subprocess.Popen(["tool/frpc.exe", "-c", "tool/frpc-desktop.toml"])
|
|
|
+ except Exception as e:
|
|
|
+ print(f"启动frpc失败: {e}")
|
|
|
+ handle_restart_game()
|
|
|
|
|
|
def terminate_frpc():
|
|
|
if GlobalState.frp_process is not None:
|
|
|
@@ -260,7 +264,11 @@ def handle_read_cfg():
|
|
|
def restart_game(type=0):
|
|
|
GlobalState.isGameBegin = False
|
|
|
while True:
|
|
|
- task_close_game()
|
|
|
+ try:
|
|
|
+ task_close_game()
|
|
|
+ except Exception as e:
|
|
|
+ print(f"关闭游戏失败: {e}")
|
|
|
+ handle_restart_game()
|
|
|
if True == task_start_game(type):
|
|
|
break
|
|
|
else:
|