Refactors dbcon into a subsystem
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
log_admin("[key_name(usr)] has toggled the Panic Bunker, it is now [(config.panic_bunker?"on":"off")]")
|
||||
message_admins("[key_name_admin(usr)] has toggled the Panic Bunker, it is now [(config.panic_bunker?"enabled":"disabled")].")
|
||||
if (config.panic_bunker && (!GLOB.dbcon || !GLOB.dbcon.IsConnected()))
|
||||
if (config.panic_bunker && (!SSdbcore || !SSdbcore.IsConnected()))
|
||||
message_admins("The Database is not connected! Panic bunker will not work until the connection is reestablished.")
|
||||
feedback_add_details("admin_toggle","Toggle Panic Bunker|[config.panic_bunker]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
to_chat(usr, "<span class='adminnotice'>The Database is not enabled!</span>")
|
||||
return
|
||||
|
||||
if (GLOB.dbcon && GLOB.dbcon.IsConnected())
|
||||
if (SSdbcore && SSdbcore.IsConnected())
|
||||
if (!check_rights(R_DEBUG,0))
|
||||
alert("The database is already connected! (Only those with +debug can force a reconnection)", "The database is already connected!")
|
||||
return
|
||||
@@ -14,7 +14,7 @@
|
||||
if (reconnect != "Force Reconnect")
|
||||
return
|
||||
|
||||
GLOB.dbcon.Disconnect()
|
||||
SSdbcore.Disconnect()
|
||||
log_admin("[key_name(usr)] has forced the database to disconnect")
|
||||
message_admins("[key_name_admin(usr)] has <b>forced</b> the database to disconnect!")
|
||||
feedback_add_details("admin_verb","Force Reestablished Database Connection") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -23,8 +23,8 @@
|
||||
message_admins("[key_name_admin(usr)] is attempting to re-established the DB Connection")
|
||||
feedback_add_details("admin_verb","Reestablished Database Connection") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
GLOB.dbcon.failed_connections = 0
|
||||
if(!GLOB.dbcon.Connect())
|
||||
message_admins("Database connection failed: " + GLOB.dbcon.ErrorMsg())
|
||||
SSdbcore.failed_connections = 0
|
||||
if(!SSdbcore.Connect())
|
||||
message_admins("Database connection failed: " + SSdbcore.ErrorMsg())
|
||||
else
|
||||
message_admins("Database connection re-established")
|
||||
Reference in New Issue
Block a user