Databases issue
Asleeepp opened this issue ยท 0 comments
Skript/Server Version
[Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
00:28:41 [INFO] [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
00:28:41 [INFO] [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
00:28:41 [INFO] [Skript] Server Version: git-Purpur-2176 (MC: 1.20.4)
00:28:41 [INFO] [Skript] Skript Version: 2.8.4 (skriptlang-github)
00:28:41 [INFO] [Skript] Installed Skript Addons:
00:28:41 [INFO] [Skript] - skript-placeholders v1.5.2 (https://github.com/APickledWalrus/skript-placeholders)
00:28:41 [INFO] [Skript] - skript-itemsadder v1.5
00:28:41 [INFO] [Skript] - skript-particle v1.2.0 (https://github.com/sovdeeth/skript-particle)
00:28:41 [INFO] [Skript] - skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect)
00:28:41 [INFO] [Skript] - SkBee v3.4.3 (https://github.com/ShaneBeee/SkBee)
00:28:41 [INFO] [Skript] - ItemsAdder v3.6.3-beta-14 (devs.beer)
00:28:41 [INFO] [Skript] Installed dependencies:
00:28:41 [INFO] [Skript] - Vault v1.7.3-b131
00:28:41 [INFO] [Skript] - WorldGuard v7.0.9+5934e49
Bug Description
I misinterpreted on how to add memory variables onto my server, thus, I duplicated the "default" database, slapped the memory regex on it, and called it a day.
Upon the server's restart, I found that the variables.csv, just gets wiped of all variables.
I understand that this is user error, but other people may also misinterpret how to add this functionality to Skript, doing the same thing I did, there should be a failsafe for when another "database" gets registered to the same file
It seems like the duplicate I made overrides the default database, resulting in an empty variables.csv, maybe, add a warning/error saying that having 2 databases linked up to the same file may result in clearing of variables.csv
Expected Behavior
I expected there to be some sort of warning/failsafe against something like this.
Steps to Reproduce
- put this into config.sk
default:
# The default "database" is a simple text file, with each variable on a separate line and the variable's name, type, and value separated by commas.
# This is the last database in this list to catch all variables that have not been saved anywhere else.
# You can modify this database freely, but make sure to know what you're doing if you don't want to loose any variables.
type: CSV
pattern: .*
file: ./plugins/Skript/variables.csv
backup interval: 2 hours
# PS: If you don't want some variables to be saved in any database (e.g. variables that contain an %entity% which usually despawn when the server is shut down)
# you can modify the last database's pattern to not match all variables, e.g. use '(?!x_).*' to match all variables that don't start with 'x_'.
# Be very cautious when doing this however as unsaved variables cannot be recovered after the server has been stopped.
# I recommend to use a single character to denote unsaved variables (similar to local variables' '_'), e.g. '-', in which case the last database's pattern should be '(?!-).*'.
memory:
# The default "database" is a simple text file, with each variable on a separate line and the variable's name, type, and value separated by commas.
# This is the last database in this list to catch all variables that have not been saved anywhere else.
# You can modify this database freely, but make sure to know what you're doing if you don't want to loose any variables.
type: CSV
pattern: (?!-).*
file: ./plugins/Skript/variables.csv
backup interval: 2 hours
# PS: If you don't want some variables to be saved in any database (e.g. variables that contain an %entity% which usually despawn when the server is shut down)
# you can modify the last database's pattern to not match all variables, e.g. use '(?!x_).*' to match all variables that don't start with 'x_'.
# Be very cautious when doing this however as unsaved variables cannot be recovered after the server has been stopped.
# I recommend to use a single character to denote unsaved variables (similar to local variables' '_'), e.g. '-', in which case the last database's pattern should be '(?!-).*'.
2, restart server
3, profit
Errors or Screenshots
I did see that backups fail to generate,
Other
No response
Agreement
- I have read the guidelines above and affirm I am following them with this report.