File tree 3 files changed +11
-8
lines changed
3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ _✨ 适用于palworld windows轮询自动重启服务端自动发送关服通
8
8
2.重启服务端前通过RCON指令发送关服倒计时
9
9
3.自定义存档备份时间
10
10
11
+ - backup.exe只有备份功能
12
+ - task_scheduler.exe为定时轮询重启任务和关服倒计时 , 可以选择是否开启关服倒计时,选择True的话就需要下载icon-cli客户端进行连接
13
+
11
14
## 使用方法
12
15
13
16
1.` pyinstaller --onefile task_scheduler.py ` 打包成exe文件
Original file line number Diff line number Diff line change 6
6
import time
7
7
import datetime
8
8
import os
9
+ import codecs
9
10
10
- # 创建一个配置文件解析器
11
+ # 读取配置文件
11
12
config = configparser .ConfigParser ()
12
-
13
- read_data = config .read ('config.ini' , encoding = 'utf-8' )
14
-
13
+ with codecs .open ('config.ini' , 'r' , encoding = 'utf-8-sig' ) as f :
14
+ config .read_file (f )
15
15
backup_source = config .get ('Settings' , 'backup_source' )
16
16
backup_target = config .get ('Settings' , 'backup_target' )
17
17
backup_interval_hours = config .get ('Settings' , 'backup_interval_hours' )
Original file line number Diff line number Diff line change 5
5
import subprocess
6
6
import time
7
7
import os
8
-
9
- # 创建一个配置文件解析器
10
- config = configparser .ConfigParser ()
8
+ import codecs
11
9
12
10
# 读取配置文件
13
- read_data = config .read ('config.ini' , encoding = 'utf-8' )
11
+ config = configparser .ConfigParser ()
12
+ with codecs .open ('config.ini' , 'r' , encoding = 'utf-8-sig' ) as f :
13
+ config .read_file (f )
14
14
program_path = config .get ('Settings' , 'program_path' )
15
15
rcon_enabled = config .getboolean ('Settings' , 'rcon_enabled' )
16
16
rcon_path = config .get ('Settings' , 'rcon_path' )
You can’t perform that action at this time.
0 commit comments