File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+ # -*- encoding: utf-8 -*-
Original file line number Diff line number Diff line change 6
6
import time
7
7
import psutil
8
8
import rcon
9
- import read_conf
9
+ from src import read_conf
10
10
import threading
11
- from utils .log_control import INFO
11
+ from src . utils .log_control import INFO
12
12
from rcon .source import Client
13
13
from rcon .source .proto import Packet
14
14
@@ -79,7 +79,13 @@ def start_program(self):
79
79
program_args .extend (["-useperfthreads" , "-NoAsyncLoadingThread" , "-UseMultithreadForDS" ])
80
80
print ("[ 启动任务 ] 启动参数:" , self .conf ['arguments' ].split ())
81
81
82
- subprocess .Popen (program_args )
82
+ try :
83
+ subprocess .Popen (program_args )
84
+ except FileNotFoundError as e :
85
+ INFO .logger .error (f"[ 启动任务 ] 请检查config.ini配置路径,错误信息: { e } " )
86
+ print (f"\r [ 启动任务 ] 请检查config.ini配置路径,错误信息: { e } " )
87
+ time .sleep (3 )
88
+ exit (1 )
83
89
84
90
# 尝试连接
85
91
if self .conf ['rcon_enabled' ]:
You can’t perform that action at this time.
0 commit comments