Conflicts solving

This commit is contained in:
Menshin
2014-11-04 20:24:52 +01:00
587 changed files with 18446 additions and 13726 deletions
+3 -3
View File
@@ -113,7 +113,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
else
adminwho += ", [C]"
reason = sql_sanitize_text(reason)
reason = sanitizeSQL(reason)
if(maxadminbancheck)
var/DBQuery/adm_query = dbcon.NewQuery("SELECT count(id) AS num FROM [format_table_name("ban")] WHERE (a_ckey = '[a_ckey]') AND (bantype = 'ADMIN_PERMABAN' OR (bantype = 'ADMIN_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)")
@@ -235,14 +235,14 @@ datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null)
usr << "Invalid ban id. Contact the database admin"
return
reason = sql_sanitize_text(reason)
reason = sanitizeSQL(reason)
var/value
switch(param)
if("reason")
if(!value)
value = input("Insert the new reason for [pckey]'s ban", "New Reason", "[reason]", null) as null|text
value = sql_sanitize_text(value)
value = sanitizeSQL(value)
if(!value)
usr << "Cancelled"
return
+25 -6
View File
@@ -252,6 +252,10 @@ var/global/floorIsLava = 0
usr << browse_rsc(MESSAGE.img, "tmp_photo[i].png")
dat+="<img src='tmp_photo[i].png' width = '180'><BR><BR>"
dat+="<FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[MESSAGE.author]</FONT>\]</FONT><BR>"
dat+="[MESSAGE.comments.len] comment[MESSAGE.comments.len > 1 ? "s" : ""]:<br>"
for(var/datum/feed_comment/comment in MESSAGE.comments)
dat+="[comment.body]<br><font size=1>[comment.author] [comment.time_stamp]</font><br>"
dat+="<br>"
dat+="<BR><HR><A href='?src=\ref[src];ac_refresh=1'>Refresh</A>"
dat+="<BR><A href='?src=\ref[src];ac_setScreen=[1]'>Back</A>"
if(10)
@@ -287,6 +291,9 @@ var/global/floorIsLava = 0
for(var/datum/feed_message/MESSAGE in src.admincaster_feed_channel.messages)
dat+="-[MESSAGE.body] <BR><FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[MESSAGE.author]</FONT>\]</FONT><BR>"
dat+="<FONT SIZE=2><A href='?src=\ref[src];ac_censor_channel_story_body=\ref[MESSAGE]'>[(MESSAGE.body == "\[REDACTED\]") ? ("Undo story censorship") : ("Censor story")]</A> - <A href='?src=\ref[src];ac_censor_channel_story_author=\ref[MESSAGE]'>[(MESSAGE.author == "\[REDACTED\]") ? ("Undo Author Censorship") : ("Censor message Author")]</A></FONT><BR>"
dat+="[MESSAGE.comments.len] comment[MESSAGE.comments.len > 1 ? "s" : ""]: <a href='?src=\ref[src];ac_lock_comment=\ref[MESSAGE]'>[MESSAGE.locked ? "Unlock" : "Lock"]</a><br>"
for(var/datum/feed_comment/comment in MESSAGE.comments)
dat+="[comment.body] <a href='?src=\ref[src];ac_del_comment=\ref[comment];ac_del_comment_msg=\ref[MESSAGE]'>X</a><br><font size=1>[comment.author] [comment.time_stamp]</font><br>"
dat+="<BR><A href='?src=\ref[src];ac_setScreen=[10]'>Back</A>"
if(13)
dat+="<B>[src.admincaster_feed_channel.channel_name]: </B><FONT SIZE=1>\[ created by: <FONT COLOR='maroon'>[src.admincaster_feed_channel.author]</FONT> \]</FONT><BR>"
@@ -300,7 +307,6 @@ var/global/floorIsLava = 0
else
for(var/datum/feed_message/MESSAGE in src.admincaster_feed_channel.messages)
dat+="-[MESSAGE.body] <BR><FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[MESSAGE.author]</FONT>\]</FONT><BR>"
dat+="<BR><A href='?src=\ref[src];ac_setScreen=[11]'>Back</A>"
if(14)
dat+="<B>Wanted Issue Handler:</B>"
@@ -794,26 +800,39 @@ var/global/floorIsLava = 0
if(!ai_number)
usr << "<b>No AIs located</b>" //Just so you know the thing is actually working and not just ignoring you.
/datum/admins/proc/list_free_slots()
/datum/admins/proc/manage_free_slots()
if(!check_rights())
return
var/dat = "<html><head><title>List Free Slots</title></head><body>"
var/dat = "<html><head><title>Manage Free Slots</title></head><body>"
var/count = 0
if(ticker && !ticker.mode)
alert(usr, "You cannot manage jobs before the round starts!")
return
if(job_master)
for(var/datum/job/job in job_master.occupations)
count++
var/J_title = html_encode(job.title)
var/J_opPos = html_encode(job.total_positions - (job.total_positions - job.current_positions))
var/J_totPos = html_encode(job.total_positions)
dat += "[J_title]: [J_totPos]<br>"
if(job.total_positions <= 0)
dat += "[J_title]: [J_opPos]"
else
dat += "[J_title]: [J_opPos]/[J_totPos]"
if(initial(job.total_positions) > 0)
dat += " <A href='?src=\ref[src];addjobslot=[job.title]'>Add</A> | "
if(job.total_positions > job.current_positions)
dat += "<A href='?src=\ref[src];removejobslot=[job.title]'>Remove</A>"
else
dat += "Remove"
dat += "<br>"
dat += "</body>"
var/winheight = 100 + (count * 20)
winheight = min(winheight, 690)
usr << browse(dat, "window=players;size=316x[winheight]")
//
//
//ALL DONE
+2 -2
View File
@@ -22,12 +22,12 @@
F << "<small>[time2text(world.timeofday,"hh:mm")] \ref[src] ([x],[y],[z])</small> || [src] [message]<br>"
//ADMINVERBS
/client/proc/investigate_show( subject in list("hrefs","notes","ntsl","singulo","wires","telesci", "gravity") )
/client/proc/investigate_show( subject in list("hrefs","notes","ntsl","singulo","wires","telesci", "gravity", "records", "cargo") )
set name = "Investigate"
set category = "Admin"
if(!holder) return
switch(subject)
if("singulo", "ntsl", "wires", "telesci", "gravity") //general one-round-only stuff
if("singulo", "ntsl", "wires", "telesci", "gravity", "records", "cargo") //general one-round-only stuff
var/F = investigate_subject2file(subject)
if(!F)
src << "<font color='red'>Error: admin_investigate: [INVESTIGATE_DIR][subject] is an invalid path or cannot be accessed.</font>"
+15
View File
@@ -222,6 +222,10 @@ var/list/admin_ranks = list() //list of all admin_rank datums
if("remove")
if(alert("Are you sure you want to remove [adm_ckey]?","Message","Yes","Cancel") == "Yes")
if(!D) return
if(!check_if_greater_rights_than_holder(D))
message_admins("[key_name_admin(usr)] attempted to remove [adm_ckey] from the admins list without sufficient rights.")
log_admin("[key_name(usr)] attempted to remove [adm_ckey] from the admins list without sufficient rights.")
return
admin_datums -= adm_ckey
D.disassociate()
@@ -244,6 +248,12 @@ var/list/admin_ranks = list() //list of all admin_rank datums
new_rank = ckeyEx(input("Please input a new rank", "New custom rank", null, null) as null|text)
if(!new_rank) return
if(D)
if(!check_if_greater_rights_than_holder(D))
message_admins("[key_name_admin(usr)] attempted to change the rank of [adm_ckey] to [new_rank] without sufficient rights.")
log_admin("[key_name(usr)] attempted to change the rank of [adm_ckey] to [new_rank] without sufficient rights.")
return
R = rank_names[new_rank]
if(!R) //rank with that name doesn't exist yet - make it
if(D) R = new(new_rank, D.rank.rights, D.rank.adds, D.rank.subs) //duplicate our previous admin_rank but with a new name
@@ -269,6 +279,11 @@ var/list/admin_ranks = list() //list of all admin_rank datums
var/keyword = input("Input permission keyword (one at a time):\ne.g. +BAN or -FUN or +/client/proc/someverb", "Permission toggle", null, null) as null|text
if(!keyword) return
if(!check_if_greater_rights_than_holder(D))
message_admins("[key_name_admin(usr)] attempted to give [adm_ckey] the keyword [keyword] without sufficient rights.")
log_admin("[key_name(usr)] attempted to give [adm_ckey] the keyword [keyword] without sufficient rights.")
return
D.disassociate()
if(!findtext(D.rank.name, "([adm_ckey])")) //not a modified subrank, need to duplicate the admin_rank datum to prevent modifying others too
+6 -2
View File
@@ -14,6 +14,7 @@ var/list/admin_verbs_default = list(
/client/proc/investigate_show, /*various admintools for investigation. Such as a singulo grief-log*/
/client/proc/secrets,
/client/proc/reload_admins,
/client/proc/reestablish_db_connection,/*reattempt a connection to the database*/
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
/client/proc/cmd_admin_pm_panel /*admin-pm list*/
)
@@ -56,7 +57,8 @@ var/list/admin_verbs_admin = list(
/client/proc/cmd_admin_direct_narrate, /*send text directly to a player with no padding. Useful for narratives and fluff-text*/
/client/proc/cmd_admin_world_narrate, /*sends text to all players with no padding*/
/client/proc/cmd_admin_create_centcom_report,
/client/proc/check_words /*displays cult-words*/
/client/proc/check_words, /*displays cult-words*/
/client/proc/reset_all_tcs /*resets all telecomms scripts*/
)
var/list/admin_verbs_ban = list(
/client/proc/unban_panel,
@@ -184,7 +186,9 @@ var/list/admin_verbs_hideable = list(
/client/proc/cmd_debug_del_all,
/client/proc/enable_debug_verbs,
/proc/possess,
/proc/release
/proc/release,
/client/proc/reload_admins,
/client/proc/reset_all_tcs
)
/client/proc/add_admin_verbs()
+1 -1
View File
@@ -99,7 +99,7 @@ proc/DB_ban_isappearancebanned(var/playerckey)
if(!dbcon.IsConnected())
return
var/sqlplayerckey = sql_sanitize_text(ckey(playerckey))
var/sqlplayerckey = sanitizeSQL(ckey(playerckey))
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM [format_table_name("ban")] WHERE CKEY = '[sqlplayerckey]' AND ((bantype = 'APPEARANCE_PERMABAN') OR (bantype = 'APPEARANCE_TEMPBAN' AND expiration_time > Now())) AND unbanned != 1")
query.Execute()
+11 -5
View File
@@ -40,6 +40,16 @@ var/list/admin_datums = list()
owner.holder = null
owner = null
/datum/admins/proc/check_if_greater_rights_than_holder(datum/admins/other)
if(!other)
return 1 //they have no rights
if(rank.rights == 65535)
return 1 //we have all the rights
if(rank.rights != other.rank.rights)
if( (rank.rights & other.rank.rights) == other.rank.rights )
return 1 //we have all the rights they have and more
return 0
/*
checks if usr is an admin with at least ONE of the flags in rights_required. (Note, they don't need all the flags)
if rights_required == 0, then it simply checks if they are an admin.
@@ -68,13 +78,9 @@ you will have to do something like if(client.rights & R_ADMIN) yourself.
if(usr.client.holder)
if(!other || !other.holder)
return 1
if(usr.client.holder.rank.rights != other.holder.rank.rights) //Check values smaller than 65536
if( (usr.client.holder.rank.rights & other.holder.rank.rights) == other.holder.rank.rights )
return 1 //we have all the rights they have and more
usr << "<font color='red'>Error: Cannot proceed. They have greater or equal rights to us.</font>"
return usr.client.holder.check_if_greater_rights_than_holder(other.holder)
return 0
/client/proc/deadmin()
admin_datums -= ckey
if(holder)
+37 -1
View File
@@ -680,7 +680,6 @@
if(!temp) continue
joblist += temp.title
if("nonhumandept")
joblist += "pAI"
for(var/jobPos in nonhuman_positions)
if(!jobPos) continue
var/datum/job/temp = job_master.GetJob(jobPos)
@@ -785,6 +784,7 @@
var/mob/M = locate(href_list["boot2"])
if (ismob(M))
if(!check_if_greater_rights_than(M.client))
usr << "<span class='danger'>Error: They have more rights than you do.</span>"
return
M << "<span class='danger'>You have been kicked from the server.</span>"
log_admin("[key_name(usr)] booted [key_name(M)].")
@@ -1325,6 +1325,30 @@
src.owner << "[special_role_description]"
src.owner << "(<a href='?priv_msg=[M.ckey]'>PM</a>) (<A HREF='?src=\ref[src];adminplayeropts=\ref[M]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[M]'>VV</A>) (<A HREF='?src=\ref[src];subtlemessage=\ref[M]'>SM</A>) (<A HREF='?src=\ref[src];adminplayerobservejump=\ref[M]'>JMP</A>) (<A HREF='?src=\ref[src];secretsadmin=check_antagonist'>CA</A>)"
else if(href_list["addjobslot"])
if(!check_rights(R_ADMIN)) return
var/Add = href_list["addjobslot"]
for(var/datum/job/job in job_master.occupations)
if(job.title == Add)
job.total_positions += 1
break
src.manage_free_slots()
else if(href_list["removejobslot"])
if(!check_rights(R_ADMIN)) return
var/Remove = href_list["removejobslot"]
for(var/datum/job/job in job_master.occupations)
if(job.title == Remove && job.total_positions - job.current_positions > 0)
job.total_positions -= 1
break
src.manage_free_slots()
else if(href_list["adminspawncookie"])
if(!check_rights(R_ADMIN|R_FUN)) return
@@ -2249,3 +2273,15 @@
else if(href_list["ac_set_signature"])
src.admincaster_signature = adminscrub(input(usr, "Provide your desired signature", "Network Identity Handler", ""))
src.access_news_network()
else if(href_list["ac_del_comment"])
var/datum/feed_comment/FC = locate(href_list["ac_del_comment"])
var/datum/feed_message/FM = locate(href_list["ac_del_comment_msg"])
FM.comments -= FC
qdel(FC)
src.access_news_network()
else if(href_list["ac_lock_comment"])
var/datum/feed_message/FM = locate(href_list["ac_lock_comment"])
FM.locked ^= 1
src.access_news_network()
+7 -5
View File
@@ -21,8 +21,8 @@
/client/proc/SDQL2_query(query_text as message)
set category = "Debug"
if(!check_rights(R_DEBUG)) //Shouldn't happen... but just to be safe.
message_admins("<span class='danger'>ERROR: Non-admin [usr.key] attempted to execute a SDQL query!</span>")
log_admin("Non-admin [usr.key] attempted to execute a SDQL query!")
message_admins("<span class='danger'>ERROR: Non-admin [key_name(usr, usr.client)] attempted to execute a SDQL query!</span>")
log_admin("Non-admin [usr.ckey]([usr]) attempted to execute a SDQL query!")
if(!query_text || length(query_text) < 1)
return
@@ -40,10 +40,12 @@
return
var/query_log = "[usr] executed SDQL query: \"[query_text]\"."
world.log << query_log
message_admins(query_log)
var/query_log = "executed SDQL query: \"[query_text]\"."
message_admins("[key_name_admin(usr)] [query_log]")
query_log = "[usr.ckey]([usr]) [query_log]"
log_game(query_log)
NOTICE(query_log)
for(var/list/query_tree in querys)
var/list/from_objs = list()
+1 -26
View File
@@ -384,30 +384,6 @@ var/global/list/g_fancy_list_of_types = null
g_fancy_list_of_types[typename] = type
return g_fancy_list_of_types
var/global/list/g_fancy_list_of_safe_types = null
/proc/get_fancy_list_of_safe_types()
if (isnull(g_fancy_list_of_safe_types)) //init
var/blocked = list(
/turf,
/obj,
/mob,
/mob/living,
/mob/living/carbon,
/mob/living/carbon/human,
/mob/dead,
/mob/dead/observer,
/mob/living/silicon,
/mob/living/silicon/robot,
/mob/living/silicon/ai
)
var/list/source = get_fancy_list_of_types()
g_fancy_list_of_safe_types = new
for(var/typename in source)
var/type = source[typename]
if(!(type in blocked))
g_fancy_list_of_safe_types[typename] = type
return g_fancy_list_of_safe_types
/proc/filter_fancy_list(list/L, filter as text)
var/list/matches = new
for(var/key in L)
@@ -421,8 +397,7 @@ var/global/list/g_fancy_list_of_safe_types = null
set category = "Debug"
set name = "Del-All"
// usng "safe" to prevent REALLY stupid deletions
var/list/matches = get_fancy_list_of_safe_types()
var/list/matches = get_fancy_list_of_types()
if (!isnull(object) && object!="")
matches = filter_fancy_list(matches, object)
@@ -62,6 +62,9 @@ client/proc/one_click_antag()
if(config.protect_roles_from_antagonist)
temp.restricted_jobs += temp.protected_jobs
if(config.protect_assistant_from_antagonist)
temp.restricted_jobs += "Assistant"
var/list/mob/living/carbon/human/candidates = list()
var/mob/living/carbon/human/H = null
@@ -94,6 +97,9 @@ client/proc/one_click_antag()
if(config.protect_roles_from_antagonist)
temp.restricted_jobs += temp.protected_jobs
if(config.protect_assistant_from_antagonist)
temp.restricted_jobs += "Assistant"
var/list/mob/living/carbon/human/candidates = list()
var/mob/living/carbon/human/H = null
@@ -124,6 +130,9 @@ client/proc/one_click_antag()
if(config.protect_roles_from_antagonist)
temp.restricted_jobs += temp.protected_jobs
if(config.protect_assistant_from_antagonist)
temp.restricted_jobs += "Assistant"
var/list/mob/living/carbon/human/candidates = list()
var/mob/living/carbon/human/H = null
@@ -189,6 +198,9 @@ client/proc/one_click_antag()
if(config.protect_roles_from_antagonist)
temp.restricted_jobs += temp.protected_jobs
if(config.protect_assistant_from_antagonist)
temp.restricted_jobs += "Assistant"
var/list/mob/living/carbon/human/candidates = list()
var/mob/living/carbon/human/H = null
@@ -391,6 +403,9 @@ client/proc/one_click_antag()
if(config.protect_roles_from_antagonist)
temp.restricted_jobs += temp.protected_jobs
if(config.protect_assistant_from_antagonist)
temp.restricted_jobs += "Assistant"
var/list/mob/living/carbon/human/candidates = list()
var/mob/living/carbon/human/H = null
+1 -1
View File
@@ -12,7 +12,7 @@
var/datum/objective/steal/steal_objective = new
steal_objective.owner = H.mind
steal_objective.set_target("nuclear authentication disk")
steal_objective.set_target(new /datum/objective_item/steal/nukedisc)
H.mind.objectives += steal_objective
var/datum/objective/hijack/hijack_objective = new
+2 -2
View File
@@ -29,10 +29,10 @@
/proc/Centcomm_announce(var/text , var/mob/Sender)
var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN)
msg = "<span class='adminnotice'> <b><font color=orange>CENTCOM:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?_src_=holder;CentcommReply=\ref[Sender]'>RPLY</A>):</b> [msg]</span>"
msg = "<span class='adminnotice'> <b><font color=orange>CENTCOM:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminmoreinfo=\ref[Sender]'>?</A>) (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?_src_=holder;CentcommReply=\ref[Sender]'>RPLY</A>):</b> [msg]</span>"
admins << msg
/proc/Syndicate_announce(var/text , var/mob/Sender)
var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN)
msg = "<span class='adminnotice'><b><font color=crimson>SYNDICATE:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?_src_=holder;SyndicateReply=\ref[Sender]'>RPLY</A>):</b> [msg]</span>"
msg = "<span class='adminnotice'><b><font color=crimson>SYNDICATE:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminmoreinfo=\ref[Sender]'>?</A>) (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?_src_=holder;SyndicateReply=\ref[Sender]'>RPLY</A>):</b> [msg]</span>"
admins << msg
+21 -3
View File
@@ -449,13 +449,13 @@ Traitors and the like can also be revived with the previous role mostly intact.
/client/proc/cmd_admin_list_open_jobs()
set category = "Admin"
set name = "List free slots"
set name = "Manage Job Slots"
if (!holder)
src << "Only administrators may use this command."
return
holder.list_free_slots()
feedback_add_details("admin_verb","LFS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
holder.manage_free_slots()
feedback_add_details("admin_verb","MFS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_explosion(atom/O as obj|mob|turf in world)
set category = "Special Verbs"
@@ -766,3 +766,21 @@ Traitors and the like can also be revived with the previous role mostly intact.
usr << "Random events disabled"
message_admins("Admin [key_name_admin(usr)] has disabled random events.")
feedback_add_details("admin_verb","TRE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/reset_all_tcs()
set category = "Admin"
set name = "Reset Telecomms Scripts"
set desc = "Blanks all telecomms scripts from all telecomms servers"
if(!holder)
usr << "Admin only."
return
for(var/obj/machinery/telecomms/server/S in telecomms_list)
var/datum/TCS_Compiler/C = S.Compiler
S.rawcode = ""
C.Compile("")
for(var/obj/machinery/computer/telecomms/traffic/T in machines)
T.storedcode = ""
log_admin("[key_name(usr)] blanked all telecomms scripts.")
message_admins("[key_name_admin(usr)] blanked all telecomms scripts.")
feedback_add_details("admin_verb","RAT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -0,0 +1,31 @@
/client/proc/reestablish_db_connection()
set category = "Special Verbs"
set name = "Reestablish DB Connection"
if (!config.sql_enabled)
usr << "<span class='adminnotice'>The Database is not enabled!</span>"
return
if (dbcon && 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
dbcon.Disconnect()
failed_db_connections = 0
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","FRDB") //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","RDB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
failed_db_connections = 0
if (!establish_db_connection())
message_admins("Database connection failed: " + dbcon.ErrorMsg())
else
message_admins("Database connection re-established")