Generalizing establish_db_connection() and setup_database_connection()

Both procs are now generalized, and accept a DBConnection object as an argument. Due to this generalization, all instances of `establish_db_connection()` must be renamed to `establish_db_connection(dbcon)`.
Also added variable `failed_connections` to the definition of DBConnection.
This commit is contained in:
skull132
2016-03-03 07:04:49 +02:00
parent d46499a310
commit 8383f1c03b
20 changed files with 66 additions and 63 deletions
+5 -5
View File
@@ -12,7 +12,7 @@
else
query_details[":a_ckey"] = user.ckey
establish_db_connection()
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
alert("SQL connection failed while trying to add a note!")
return
@@ -36,7 +36,7 @@
if (!note_id || !note_edit)
return
establish_db_connection()
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
error("SQL connection failed while attempting to delete a note!")
return
@@ -93,7 +93,7 @@
player_ckey = ckey(player_ckey)
admin_ckey = ckey(admin_ckey)
establish_db_connection()
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
error("SQL connection failed while attempting to view a player's notes!")
return
@@ -187,7 +187,7 @@
if (!ckey)
return "No ckey given!"
establish_db_connection()
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
return "Unable to establish database connection! Aborting!"
@@ -231,7 +231,7 @@
note_list >> note_keys
msg_scopes("Establishing DB connection!")
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
msg_scopes("No DB connection!")
return