Prevent Unexpected SQL Errors (#1628)

* Don't nag me, game.

* Added disabled message, made config consistent

* Missed adding 'else'
This commit is contained in:
Arokha Sieyes
2016-05-14 21:09:21 -04:00
committed by Datraen
parent 25827b3b14
commit 6c9346d0c4
3 changed files with 10 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ var/list/gamemode_cache = list()
var/log_pda = 0 // log pda messages
var/log_hrefs = 0 // logs all links clicked in-game. Could be used for debugging and tracking down exploits
var/log_runtime = 0 // logs world.log to a file
var/sql_enabled = 1 // for sql switching
var/sql_enabled = 0 // for sql switching
var/allow_admin_ooccolor = 0 // Allows admins with relevant permissions to have their own ooc colour
var/allow_vote_restart = 0 // allow votes to restart
var/ert_admin_call_only = 0
@@ -289,7 +289,7 @@ var/list/gamemode_cache = list()
config.log_access = 1
if ("sql_enabled")
config.sql_enabled = text2num(value)
config.sql_enabled = 1
if ("log_say")
config.log_say = 1

View File

@@ -558,7 +558,9 @@ var/failed_db_connections = 0
var/failed_old_db_connections = 0
/hook/startup/proc/connectDB()
if(!setup_database_connection())
if(!config.sql_enabled)
world.log << "SQL connection disabled in config."
else if(!setup_database_connection())
world.log << "Your server failed to establish a connection with the feedback database."
else
world.log << "Feedback database connection established."
@@ -600,7 +602,9 @@ proc/establish_db_connection()
/hook/startup/proc/connectOldDB()
if(!setup_old_database_connection())
if(!config.sql_enabled)
world.log << "SQL connection disabled in config."
else if(!setup_old_database_connection())
world.log << "Your server failed to establish a connection with the SQL database."
else
world.log << "SQL database connection established."

View File

@@ -67,8 +67,8 @@ LOG_PDA
## log admin warning messages
##LOG_ADMINWARN ## Also duplicates a bunch of other messages.
## sql switching
# SQL_ENABLED
## Enable/disable SQL connection (comment out to disable)
SQL_ENABLED
## disconnect players who did nothing during the set amount of minutes
# KICK_INACTIVE 10