From 66b62303e42f7f3125c8c6f1921ca89d83683c1b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 29 Feb 2016 22:01:33 -0600 Subject: [PATCH] Fix for shared_memory and clearing out hotfix_ when ran --- shared_memory/main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index 3d47f217f..11d21153b 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -62,6 +62,18 @@ int main(int argc, char **argv) { database.LoadLogSettings(Log.log_settings); Log.StartFileLogs(); + database.LoadVariables(); + + /* If we're running shared memory and hotfix has no custom name, we probably want to start from scratch... */ + char db_hotfix_name[256] = { 0 }; + if (database.GetVariable("hotfix_name", db_hotfix_name, 256)) { + if (strlen(db_hotfix_name) > 0 && strcasecmp("hotfix_", db_hotfix_name) == 0) { + Log.Out(Logs::General, Logs::Status, "Current hotfix in variables is the default %s, clearing out variable", db_hotfix_name); + std::string query = StringFormat("UPDATE `variables` SET `value`='' WHERE (`varname`='hotfix_name')"); + database.QueryDatabase(query); + } + } + std::string hotfix_name = ""; bool load_all = true; bool load_items = false;