mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
chore(settings): every catalog setting in the shipped .ini files; forget settings taken out of a file
- resources/*.ini list the 73 settings the catalog knew but the files left out (dashboard AI helper, backups, metrics, public status, strikes, property rent and reputation, chat log, contraband, logins...), with their title, description and default. The test ShippedFilesListEveryCatalogSetting keeps it that way; with DLU_WRITE_INI_TEMPLATES=1 it writes the missing ones. - ConfigSync forgets a setting row when its key has left a file the server read: from the file, no value set on the dashboard, not a permission level. Before, rows of removed keys stayed forever. - Docs: where setting rows come from and when they go, the templates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -58,6 +58,16 @@ namespace ConfigSync {
|
||||
Database::Get()->ReportConfigFromFile(setting);
|
||||
}
|
||||
|
||||
// A key taken out of a file this server read is forgotten: its row came from that file (not the environment,
|
||||
// not only the dashboard) and nobody set it on the dashboard
|
||||
std::set<std::string> filesRead;
|
||||
for (const auto& entry : config.GetFileEntries()) filesRead.insert(entry.file);
|
||||
for (const auto& row : Database::Get()->GetServerConfig({ filesRead.begin(), filesRead.end() })) {
|
||||
if (row.fileSource != "file" || row.webValue || setLocally.contains(row.name) || Permissions::IsPermissionSetting(row.name)) continue;
|
||||
LOG("Forgetting the setting %s of %s: it is no longer in the file", row.name.c_str(), row.file.c_str());
|
||||
Database::Get()->DeleteServerConfig(row.file, row.name);
|
||||
}
|
||||
|
||||
const auto rows = Database::Get()->GetServerConfig({ config.GetFileName(), "sharedconfig.ini" });
|
||||
// Keys set only by environment variables count as set locally too
|
||||
for (const auto& row : rows) {
|
||||
|
||||
Reference in New Issue
Block a user