mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Prevent Unexpected SQL Errors (#1628)
* Don't nag me, game. * Added disabled message, made config consistent * Missed adding 'else'
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user