Merge branch 'master' of https://github.com/tgstation/-tg-station into SubSystems

Conflicts:
	code/game/gamemodes/setupgame.dm
	code/modules/mob/living/carbon/human/life.dm
	code/modules/reagents/Chemistry-Machinery.dm
This commit is contained in:
carnie
2015-01-04 01:52:14 +00:00
188 changed files with 3290 additions and 2205 deletions
+56 -6
View File
@@ -243,7 +243,8 @@ var/list/admin_verbs_hideable = list(
/client/proc/startSinglo,
/client/proc/fps,
/client/proc/cmd_admin_grantfullaccess,
/client/proc/cmd_admin_areatest
/client/proc/cmd_admin_areatest,
/client/proc/readmin
)
if(holder)
verbs.Remove(holder.rank.adds)
@@ -485,11 +486,11 @@ var/list/admin_verbs_hideable = list(
set category = "Admin"
if(holder)
if(alert("Confirm self-deadmin for the round? You can't re-admin yourself without someont promoting you.",,"Yes","No") == "Yes")
log_admin("[src] deadmined themself.")
message_admins("[src] deadmined themself.")
deadmin()
src << "<span class='interface'>You are now a normal player.</span>"
log_admin("[src] deadmined themself.")
message_admins("[src] deadmined themself.")
deadmin()
verbs += /client/proc/readmin
src << "<span class='interface'>You are now a normal player.</span>"
feedback_add_details("admin_verb","DAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/toggle_log_hrefs()
@@ -510,3 +511,52 @@ var/list/admin_verbs_hideable = list(
if(holder)
src.holder.output_ai_laws()
/client/proc/readmin()
set name = "Re-admin self"
set category = "Admin"
set desc = "Regain your admin powers."
var/list/rank_names = list()
for(var/datum/admin_rank/R in admin_ranks)
rank_names[R.name] = R
var/datum/admins/D = admin_datums[ckey]
var/rank = null
if(config.admin_legacy_system)
//load text from file
var/list/Lines = file2list("config/admins.txt")
for(var/line in Lines)
var/list/splitline = text2list(line, " = ")
if(splitline[1] == ckey)
if(splitline.len >= 2)
rank = ckeyEx(splitline[2])
break
continue
else
if(!dbcon.IsConnected())
message_admins("Warning, mysql database is not connected.")
src << "Warning, mysql database is not connected."
return
var/sql_ckey = sanitizeSQL(ckey)
var/DBQuery/query = dbcon.NewQuery("SELECT rank FROM [format_table_name("admin")] WHERE ckey = '[sql_ckey]'")
query.Execute()
while(query.NextRow())
rank = ckeyEx(query.item[1])
if(!D)
if(rank_names[rank] == null)
var/error_extra = ""
if(!config.admin_legacy_system)
error_extra = " Check mysql DB connection."
error("Error while re-adminning [src], admin rank ([rank]) does not exist.[error_extra]")
src << "Error while re-adminning, admin rank ([rank]) does not exist.[error_extra]"
return
D = new(rank_names[rank],ckey)
var/client/C = directory[ckey]
D.associate(C)
message_admins("[src] re-adminned themselves.")
log_admin("[src] re-adminned themselves.")
feedback_add_details("admin_verb","RAS")
verbs -= /client/proc/readmin
return
else
src << "You are already an admin."
verbs -= /client/proc/readmin
return