7e9b96a00f
* Maps and things no code/icons * helpers defines globalvars * Onclick world.dm orphaned_procs * subsystems Round vote and shuttle autocall done here too * datums * Game folder * Admin - chatter modules * clothing - mining * modular computers - zambies * client * mob level 1 * mob stage 2 + simple_animal * silicons n brains * mob stage 3 + Alien/Monkey * human mobs * icons updated * some sounds * emitter y u no commit * update tgstation.dme * compile fixes * travis fixes Also removes Fast digest mode, because reasons. * tweaks for travis Mentors are broke again Also fixes Sizeray guns * oxygen loss fix for vore code. * removes unused code * some code updates * bulk fixes * further fixes * outside things * whoops. * Maint bar ported * GLOBs.
30 lines
1.5 KiB
Plaintext
30 lines
1.5 KiB
Plaintext
/client/proc/reestablish_db_connection()
|
|
set category = "Special Verbs"
|
|
set name = "Reestablish DB Connection"
|
|
if (!config.sql_enabled)
|
|
to_chat(usr, "<span class='adminnotice'>The Database is not enabled!</span>")
|
|
return
|
|
|
|
if (GLOB.dbcon && GLOB.dbcon.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
|
|
|
|
var/reconnect = alert("The database is already connected! If you *KNOW* that this is incorrect, you can force a reconnection", "The database is already connected!", "Force Reconnect", "Cancel")
|
|
if (reconnect != "Force Reconnect")
|
|
return
|
|
|
|
GLOB.dbcon.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!
|
|
|
|
log_admin("[key_name(usr)] is attempting to re-established the DB Connection")
|
|
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())
|
|
else
|
|
message_admins("Database connection re-established") |