From 0a4c557336dd41e79565c600949c2b633eaedee5 Mon Sep 17 00:00:00 2001 From: Jordie Date: Sun, 17 Dec 2017 15:23:23 +1100 Subject: [PATCH 1/2] Db schema version check by simplification (#33582) * db schema version check by concatenation * lets just use actual floats * simplifies schema check and some more logging --- code/game/world.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/game/world.dm b/code/game/world.dm index 2853bb2ef6..6c49e37456 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -62,15 +62,15 @@ GLOBAL_PROTECT(security_mode) var/db_major = text2num(query_db_version.item[1]) var/db_minor = text2num(query_db_version.item[2]) if(db_major != DB_MAJOR_VERSION || db_minor != DB_MINOR_VERSION) - var/which = "behind" - if(db_major < DB_MAJOR_VERSION || db_minor < DB_MINOR_VERSION) - which = "ahead of" - message_admins("Database schema ([db_major].[db_minor]) is [which] the latest schema version ([DB_MAJOR_VERSION].[DB_MINOR_VERSION]), this may lead to undefined behaviour or errors") - log_sql("Database schema ([db_major].[db_minor]) is [which] the latest schema version ([DB_MAJOR_VERSION].[DB_MINOR_VERSION]), this may lead to undefined behaviour or errors") + message_admins("Database schema ([db_major].[db_minor]) doesn't match the latest schema version ([DB_MAJOR_VERSION].[DB_MINOR_VERSION]), this may lead to undefined behaviour or errors") + log_sql("Database schema ([db_major].[db_minor]) doesn't match the latest schema version ([DB_MAJOR_VERSION].[DB_MINOR_VERSION]), this may lead to undefined behaviour or errors") else message_admins("Could not get schema version from database") + log_sql("Could not get schema version from database") else - log_world("Your server failed to establish a connection with the database.") + log_sql("Your server failed to establish a connection with the database.") + else + log_sql("Database is not enabled in configuration.") /world/proc/SetRoundID() if(CONFIG_GET(flag/sql_enabled))