Add db-reconnect adminverb (#1398)

Adds a Reconnect-SQL verb to admins with permission flag R_DEBUG, as well as making the server attempt to automatically reconnect to SQL on connection drop.
This commit is contained in:
Lohikar
2017-01-05 15:39:01 -06:00
committed by skull132
parent bd9b5c1aea
commit 36a084fbbc
2 changed files with 30 additions and 4 deletions

View File

@@ -199,7 +199,8 @@ var/list/admin_verbs_debug = list(
/client/proc/jumptomob,
/client/proc/jumptocoord,
/client/proc/dsay,
/client/proc/toggle_recursive_explosions
/client/proc/toggle_recursive_explosions,
/client/proc/restart_sql
)
var/list/admin_verbs_paranoid_debug = list(
@@ -1034,4 +1035,18 @@ var/list/admin_verbs_cciaa = list(
log_and_message_admins("admin-wiped [key_name_admin(target)]'s core.")
target.do_wipe_core()
/client/proc/restart_sql()
set category = "Debug"
set name = "Reconnect SQL"
set desc = "Causes the server to re-establish its connection to the MySQL server."
if (!check_rights(R_DEBUG))
return
if (alert("Reconnect to SQL?", "SQL Reconnection", "No", "No", "Yes") != "Yes")
return
log_and_message_admins("is attempting to reconnect the server to MySQL.")
dbcon.Reconnect()