Put dev prefs json backup in gitignore (#92938)

## About The Pull Request

This file is made when upping a major version. It should also be
ignored.
This commit is contained in:
MrMelbert
2025-09-11 13:22:37 -05:00
committed by GitHub
parent db305a9e75
commit c88a265e89
3 changed files with 5 additions and 2 deletions

1
.gitignore vendored
View File

@@ -3,6 +3,7 @@
# Local overrides--you can use this to change the config for your dev environment (like setting up SQL) without worrying about committing it
/config/dev_overrides.txt
/config/dev_preferences.json
/config/dev_preferences.json.updatebac
#Ignore everything in datafolder and subdirectories
/data/**/*

View File

@@ -38,6 +38,8 @@
#define TOGGLES_DEFAULT_CHAT (CHAT_OOC|CHAT_DEAD|CHAT_PRAYER|CHAT_PULLR|CHAT_GHOSTPDA|CHAT_GHOSTRADIO|CHAT_BANKCARD|CHAT_GHOSTLAWS|CHAT_LOGIN_LOGOUT)
/// File path to where we save backups of preference savefiles when updating them.
#define PREFS_BACKUP_PATH(base_path) "[base_path].updatebac"
/// File path to the dev preference json file, which is loaded by guests while localhosting.
#define DEV_PREFS_PATH "config/dev_preferences.json"

View File

@@ -200,7 +200,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
var/data_validity_integer = check_savedata_version(savefile.get_entry())
if(load_and_save && IS_DATA_OBSOLETE(data_validity_integer)) //fatal, can't load any data
var/bacpath = "[path].updatebac" //todo: if the savefile version is higher then the server, check the backup, and give the player a prompt to load the backup
var/bacpath = PREFS_BACKUP_PATH(path) //todo: if the savefile version is higher then the server, check the backup, and give the player a prompt to load the backup
if (fexists(bacpath))
fdel(bacpath) //only keep 1 version of backup
fcopy(savefile.path, bacpath) //byond helpfully lets you use a savefile for the first arg.
@@ -235,7 +235,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
//try to fix any outdated data if necessary
if(SHOULD_UPDATE_DATA(data_validity_integer))
var/bacpath = "[path].updatebac" //todo: if the savefile version is higher then the server, check the backup, and give the player a prompt to load the backup
var/bacpath = PREFS_BACKUP_PATH(path) //todo: if the savefile version is higher then the server, check the backup, and give the player a prompt to load the backup
if (fexists(bacpath))
fdel(bacpath) //only keep 1 version of backup
fcopy(savefile.path, bacpath) //byond helpfully lets you use a savefile for the first arg.