Skip to content

Commit 748e823

Browse files
committed
v1.5.0: custom saved_world_keywords support
for #28
1 parent a5994ed commit 748e823

File tree

5 files changed

+37
-3
lines changed

5 files changed

+37
-3
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,21 @@ mcd_root/
119119

120120
若文件名字符串以 `*` 结尾,则将忽略以指定字符串开头的文件,如 `temp*` 表示忽略所有以 `temp` 开头的文件,如 `tempfile`
121121

122+
### saved_world_keywords
123+
124+
默认值:
125+
126+
```
127+
"saved_world_keywords": [
128+
"Saved the game",
129+
"Saved the world"
130+
]
131+
```
132+
133+
用于识别服务端已保存完毕存档的关键词
134+
135+
如果服务器的输出与任何一个关键词相符,则认为存档已保存完毕,随后插件将开始复制存档文件
136+
122137
### backup_path
123138

124139
默认值: `./qb_multi`

README_en.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,21 @@ If the name string starts with `*`, then it will ignore files with name ending w
121121

122122
If the name string ends with `*`, then it will ignore files with name starting with specific string, e.g. `temp*` makes all files starts with `temp` be ignored, like `tempfile`
123123

124+
### saved_world_keywords
125+
126+
Default:
127+
128+
```
129+
"saved_world_keywords": [
130+
"Saved the game",
131+
"Saved the world"
132+
]
133+
```
134+
135+
Keywords for the plugin to consider if the server has saved the world
136+
137+
It is considered that the world has been saved if any keyword string equals to the server output, then the plugin will start copying the world files
138+
124139
### backup_path
125140

126141
Default: `./qb_multi`

mcdreforged.plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "quick_backup_multi",
3-
"version": "1.4.4",
3+
"version": "1.5.0",
44
"name": "Quick Backup Multi",
55
"description": {
66
"en_us": "A backup / restore plugin, with multiple backup slot",

quick_backup_multi/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,9 @@ def print_help_message(source: CommandSource):
425425
)
426426

427427

428-
def on_info(server, info: Info):
428+
def on_info(server: PluginServerInterface, info: Info):
429429
if not info.is_user:
430-
if info.content == 'Saved the game' or info.content == 'Saved the world':
430+
if info.content in config.saved_world_keywords:
431431
global game_saved
432432
game_saved = True
433433

quick_backup_multi/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ class Configure(Serializable):
1313
ignored_files: List[str] = [
1414
'session.lock'
1515
]
16+
saved_world_keywords: List[str] = [
17+
'Saved the game', # 1.13+
18+
'Saved the world', # 1.12-
19+
]
1620
backup_path: str = './qb_multi'
1721
server_path: str = './server'
1822
overwrite_backup_folder: str = 'overwrite'

0 commit comments

Comments
 (0)