Skip to content

Commit

Permalink
config server.saved_world_regex is full-matched, so no need for ^$
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Feb 24, 2024
1 parent 9472ff4 commit 54df497
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 6 additions & 2 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ Options on how to interact with the Minecraft server
"auto_save_on": "save-on"
},
"saved_world_regex": [
"^Saved the game$",
"^Saved the world$"
"Saved the game",
"Saved the world"
],
"save_world_max_wait": "10m"
}
Expand Down Expand Up @@ -182,6 +182,10 @@ Timing of what Prime Backup will do during a backup creation

A list of regular expressions for identifying whether the server has already saved the world

!!! note

The regex patterns will perform a [full match](https://docs.python.org/3/library/re.html#re.fullmatch) check on the server info content

- Type: `List[re.Pattern]`

#### save_world_max_wait
Expand Down
8 changes: 6 additions & 2 deletions docs/config.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ MCDR 中,Prime Backup 所有命令的前缀。通常你不需要更改它
"auto_save_on": "save-on"
},
"saved_world_regex": [
"^Saved the game$",
"^Saved the world$"
"Saved the game",
"Saved the world"
],
"save_world_max_wait": "10m"
}
Expand Down Expand Up @@ -181,6 +181,10 @@ Prime Backup 在创建备份时的操作时序如下:

一个正则表达式列表,用于识别服务器是否已保存完成

!!! note

正则表达式将对服务端消息输出执行 [全串匹配](https://docs.python.org/3/library/re.html#re.fullmatch) 检查

- 类型:`List[re.Pattern]`

#### save_world_max_wait
Expand Down
4 changes: 2 additions & 2 deletions prime_backup/config/server_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ServerConfig(Serializable):
turn_off_auto_save: bool = True
commands: MinecraftServerCommands = MinecraftServerCommands()
saved_world_regex: List[re.Pattern] = [
re.compile('^Saved the game$'),
re.compile('^Saved the world$'),
re.compile('Saved the game'),
re.compile('Saved the world'),
]
save_world_max_wait: Duration = Duration('10min')

0 comments on commit 54df497

Please sign in to comment.