Merge branch 'master' into kick-confirmation

This commit is contained in:
TheSardele
2020-07-21 22:07:58 +02:00
committed by GitHub
1848 changed files with 96371 additions and 481610 deletions
+22 -22
View File
@@ -5,7 +5,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
if(!check_rights(R_BAN)) return
establish_db_connection()
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
return
var/serverip = "[world.internet_address]:[world.port]"
@@ -86,7 +86,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
message_admins("<font color='red'>[key_name_admin(usr)] attempted to add a ban based on a non-existent mob, with no ckey provided. Report this bug.",1)
return
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM [format_table_name("player")] WHERE ckey = '[ckey]'")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("player")] WHERE ckey = '[ckey]'")
query.Execute()
var/validckey = 0
if(query.NextRow())
@@ -127,7 +127,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
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)")
var/DBQuery/adm_query = GLOB.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)")
adm_query.Execute()
if(adm_query.NextRow())
var/adm_bans = text2num(adm_query.item[1])
@@ -136,7 +136,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
return
var/sql = "INSERT INTO [format_table_name("ban")] (`id`,`bantime`,`serverip`,`bantype`,`reason`,`job`,`duration`,`rounds`,`expiration_time`,`ckey`,`computerid`,`ip`,`a_ckey`,`a_computerid`,`a_ip`,`who`,`adminwho`,`edits`,`unbanned`,`unbanned_datetime`,`unbanned_ckey`,`unbanned_computerid`,`unbanned_ip`) VALUES (null, Now(), '[serverip]', '[bantype_str]', '[reason]', '[job]', [(duration)?"[duration]":"0"], [(rounds)?"[rounds]":"0"], Now() + INTERVAL [(duration>0) ? duration : 0] MINUTE, '[ckey]', '[computerid]', '[ip]', '[a_ckey]', '[a_computerid]', '[a_ip]', '[who]', '[adminwho]', '', null, null, null, null, null)"
var/DBQuery/query_insert = dbcon.NewQuery(sql)
var/DBQuery/query_insert = GLOB.dbcon.NewQuery(sql)
query_insert.Execute()
to_chat(usr, "<span class='notice'>Ban saved to database.</span>")
message_admins("[key_name_admin(usr)] has added a [bantype_str] for [ckey] [(job)?"([job])":""] [(duration > 0)?"([duration] minutes)":""] with the reason: \"[reason]\" to the ban database.",1)
@@ -146,7 +146,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
if(kickbannedckey)
if(banned_mob && banned_mob.client && banned_mob.client.ckey == banckey)
del(banned_mob.client)
qdel(banned_mob.client)
if(isjobban)
jobban_client_fullban(ckey, job)
@@ -201,17 +201,17 @@ datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "")
sql += " AND job = '[job]'"
establish_db_connection()
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
return
var/ban_id
var/ban_number = 0 //failsafe
var/DBQuery/query = dbcon.NewQuery(sql)
var/DBQuery/query = GLOB.dbcon.NewQuery(sql)
query.Execute()
while(query.NextRow())
ban_id = query.item[1]
ban_number++;
ban_number++
if(ban_number == 0)
to_chat(usr, "<span class='warning'>Database update failed due to no bans fitting the search criteria. If this is not a legacy ban you should contact the database admin.</span>")
@@ -241,7 +241,7 @@ datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null)
to_chat(usr, "Cancelled")
return
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, duration, reason, job FROM [format_table_name("ban")] WHERE id = [banid]")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, duration, reason, job FROM [format_table_name("ban")] WHERE id = [banid]")
query.Execute()
var/eckey = usr.ckey //Editing admin ckey
@@ -271,7 +271,7 @@ datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null)
to_chat(usr, "Cancelled")
return
var/DBQuery/update_query = dbcon.NewQuery("UPDATE [format_table_name("ban")] SET reason = '[value]', edits = CONCAT(edits,'- [eckey] changed ban reason from <cite><b>\\\"[reason]\\\"</b></cite> to <cite><b>\\\"[value]\\\"</b></cite><BR>') WHERE id = [banid]")
var/DBQuery/update_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("ban")] SET reason = '[value]', edits = CONCAT(edits,'- [eckey] changed ban reason from <cite><b>\\\"[reason]\\\"</b></cite> to <cite><b>\\\"[value]\\\"</b></cite><BR>') WHERE id = [banid]")
update_query.Execute()
message_admins("[key_name_admin(usr)] has edited a ban for [pckey]'s reason from [reason] to [value]",1)
if("duration")
@@ -281,7 +281,7 @@ datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null)
to_chat(usr, "Cancelled")
return
var/DBQuery/update_query = dbcon.NewQuery("UPDATE [format_table_name("ban")] SET duration = [value], edits = CONCAT(edits,'- [eckey] changed ban duration from [duration] to [value]<br>'), expiration_time = DATE_ADD(bantime, INTERVAL [value] MINUTE) WHERE id = [banid]")
var/DBQuery/update_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("ban")] SET duration = [value], edits = CONCAT(edits,'- [eckey] changed ban duration from [duration] to [value]<br>'), expiration_time = DATE_ADD(bantime, INTERVAL [value] MINUTE) WHERE id = [banid]")
message_admins("[key_name_admin(usr)] has edited a ban for [pckey]'s duration from [duration] to [value]",1)
update_query.Execute()
if("unban")
@@ -304,17 +304,17 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
var/sql = "SELECT ckey FROM [format_table_name("ban")] WHERE id = [id]"
establish_db_connection()
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
return
var/ban_number = 0 //failsafe
var/pckey
var/DBQuery/query = dbcon.NewQuery(sql)
var/DBQuery/query = GLOB.dbcon.NewQuery(sql)
query.Execute()
while(query.NextRow())
pckey = query.item[1]
ban_number++;
ban_number++
if(ban_number == 0)
to_chat(usr, "<span class='warning'>Database update failed due to a ban id not being present in the database.</span>")
@@ -334,7 +334,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
var/sql_update = "UPDATE [format_table_name("ban")] SET unbanned = 1, unbanned_datetime = Now(), unbanned_ckey = '[unban_ckey]', unbanned_computerid = '[unban_computerid]', unbanned_ip = '[unban_ip]' WHERE id = [id]"
message_admins("[key_name_admin(usr)] has lifted [pckey]'s ban.",1)
var/DBQuery/query_update = dbcon.NewQuery(sql_update)
var/DBQuery/query_update = GLOB.dbcon.NewQuery(sql_update)
query_update.Execute()
flag_account_for_forum_sync(pckey)
@@ -359,7 +359,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
if(!check_rights(R_BAN)) return
establish_db_connection()
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
to_chat(usr, "<span class='warning'>Failed to establish database connection</span>")
return
@@ -392,13 +392,13 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
output += "<option value=''>--</option>"
for(var/j in get_all_jobs())
output += "<option value='[j]'>[j]</option>"
for(var/j in nonhuman_positions)
for(var/j in GLOB.nonhuman_positions)
output += "<option value='[j]'>[j]</option>"
for(var/j in other_roles)
for(var/j in GLOB.other_roles)
output += "<option value='[j]'>[j]</option>"
for(var/j in list("commanddept","securitydept","engineeringdept","medicaldept","sciencedept","supportdept","nonhumandept"))
output += "<option value='[j]'>[j]</option>"
for(var/j in list("Syndicate") + antag_roles)
for(var/j in list("Syndicate") + GLOB.antag_roles)
output += "<option value='[j]'>[j]</option>"
output += "</select></td></tr></table>"
output += "<b>Reason:<br></b><textarea name='dbbanreason' cols='50'></textarea><br>"
@@ -498,7 +498,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
bantypesearch += "'PERMABAN' "
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, bantime, bantype, reason, job, duration, expiration_time, ckey, a_ckey, unbanned, unbanned_ckey, unbanned_datetime, edits, ip, computerid FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch] [ipsearch] [cidsearch] [bantypesearch] ORDER BY bantime DESC LIMIT 100")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT id, bantime, bantype, reason, job, duration, expiration_time, ckey, a_ckey, unbanned, unbanned_ckey, unbanned_datetime, edits, ip, computerid FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch] [ipsearch] [cidsearch] [bantypesearch] ORDER BY bantime DESC LIMIT 100")
select_query.Execute()
while(select_query.NextRow())
@@ -575,9 +575,9 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
usr << browse(output,"window=lookupbans;size=900x700")
/proc/flag_account_for_forum_sync(ckey)
if(!dbcon)
if(!GLOB.dbcon)
return
var/skey = sanitizeSQL(ckey)
var/sql = "UPDATE [format_table_name("player")] SET fupdate = 1 WHERE ckey = '[skey]'"
var/DBQuery/adm_query = dbcon.NewQuery(sql)
var/DBQuery/adm_query = GLOB.dbcon.NewQuery(sql)
adm_query.Execute()
+4 -4
View File
@@ -25,13 +25,13 @@ world/IsBanned(key, address, computer_id, type, check_ipintel = TRUE)
if (C && ckey == C.ckey && computer_id == C.computer_id && address == C.address)
return //don't recheck connected clients.
if((ckey in admin_datums) || (ckey in GLOB.deadmins))
var/datum/admins/A = admin_datums[ckey]
if((ckey in GLOB.admin_datums) || (ckey in GLOB.deadmins))
var/datum/admins/A = GLOB.admin_datums[ckey]
if(A && (A.rights & R_ADMIN))
admin = 1
//Guest Checking
if(!guests_allowed && IsGuestKey(key))
if(!GLOB.guests_allowed && IsGuestKey(key))
log_adminwarn("Failed Login: [key] [computer_id] [address] - Guests not allowed")
// message_admins("<span class='notice'>Failed Login: [key] - Guests not allowed</span>")
return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a BYOND account.")
@@ -82,7 +82,7 @@ world/IsBanned(key, address, computer_id, type, check_ipintel = TRUE)
if(computer_id)
cidquery = " OR computerid = '[computer_id]' "
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, ip, computerid, a_ckey, reason, expiration_time, duration, bantime, bantype FROM [format_table_name("ban")] WHERE (ckey = '[ckeytext]' [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR bantype = 'ADMIN_PERMABAN' OR ((bantype = 'TEMPBAN' OR bantype = 'ADMIN_TEMPBAN') AND expiration_time > Now())) AND isnull(unbanned)")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, ip, computerid, a_ckey, reason, expiration_time, duration, bantime, bantype FROM [format_table_name("ban")] WHERE (ckey = '[ckeytext]' [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR bantype = 'ADMIN_PERMABAN' OR ((bantype = 'TEMPBAN' OR bantype = 'ADMIN_TEMPBAN') AND expiration_time > Now())) AND isnull(unbanned)")
query.Execute()
+85 -88
View File
@@ -1,79 +1,76 @@
var/CMinutes = null
var/savefile/Banlist
GLOBAL_VAR(CMinutes)
GLOBAL_DATUM(banlist_savefile, /savefile)
GLOBAL_PROTECT(banlist_savefile) // Obvious reasons
/proc/CheckBan(var/ckey, var/id, var/address)
if(!Banlist) // if Banlist cannot be located for some reason
if(!GLOB.banlist_savefile) // if banlist_savefile cannot be located for some reason
LoadBans() // try to load the bans
if(!Banlist) // uh oh, can't find bans!
if(!GLOB.banlist_savefile) // uh oh, can't find bans!
return 0 // ABORT ABORT ABORT
. = list()
var/appeal
if(config && config.banappeals)
appeal = "\nFor more information on your ban, or to appeal, head to <a href='[config.banappeals]'>[config.banappeals]</a>"
Banlist.cd = "/base"
if( "[ckey][id]" in Banlist.dir )
Banlist.cd = "[ckey][id]"
if(Banlist["temp"])
if(!GetExp(Banlist["minutes"]))
GLOB.banlist_savefile.cd = "/base"
if( "[ckey][id]" in GLOB.banlist_savefile.dir )
GLOB.banlist_savefile.cd = "[ckey][id]"
if(GLOB.banlist_savefile["temp"])
if(!GetExp(GLOB.banlist_savefile["minutes"]))
ClearTempbans()
return 0
else
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]"
.["desc"] = "\nReason: [GLOB.banlist_savefile["reason"]]\nExpires: [GetExp(GLOB.banlist_savefile["minutes"])]\nBy: [GLOB.banlist_savefile["bannedby"]][appeal]"
else
Banlist.cd = "/base/[ckey][id]"
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: <B>PERMENANT</B>\nBy: [Banlist["bannedby"]][appeal]"
GLOB.banlist_savefile.cd = "/base/[ckey][id]"
.["desc"] = "\nReason: [GLOB.banlist_savefile["reason"]]\nExpires: <B>PERMENANT</B>\nBy: [GLOB.banlist_savefile["bannedby"]][appeal]"
.["reason"] = "ckey/id"
return .
else
for(var/A in Banlist.dir)
Banlist.cd = "/base/[A]"
for(var/A in GLOB.banlist_savefile.dir)
GLOB.banlist_savefile.cd = "/base/[A]"
var/matches
if( ckey == Banlist["key"] )
if( ckey == GLOB.banlist_savefile["key"] )
matches += "ckey"
if( id == Banlist["id"] )
if( id == GLOB.banlist_savefile["id"] )
if(matches)
matches += "/"
matches += "id"
if( address == Banlist["ip"] )
if( address == GLOB.banlist_savefile["ip"] )
if(matches)
matches += "/"
matches += "ip"
if(matches)
if(Banlist["temp"])
if(!GetExp(Banlist["minutes"]))
if(GLOB.banlist_savefile["temp"])
if(!GetExp(GLOB.banlist_savefile["minutes"]))
ClearTempbans()
return 0
else
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]"
.["desc"] = "\nReason: [GLOB.banlist_savefile["reason"]]\nExpires: [GetExp(GLOB.banlist_savefile["minutes"])]\nBy: [GLOB.banlist_savefile["bannedby"]][appeal]"
else
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: <B>PERMENANT</B>\nBy: [Banlist["bannedby"]][appeal]"
.["desc"] = "\nReason: [GLOB.banlist_savefile["reason"]]\nExpires: <B>PERMENANT</B>\nBy: [GLOB.banlist_savefile["bannedby"]][appeal]"
.["reason"] = matches
return .
return 0
/proc/UpdateTime() //No idea why i made this a proc.
CMinutes = (world.realtime / 10) / 60
GLOB.CMinutes = (world.realtime / 10) / 60
return 1
/hook/startup/proc/loadBans()
return LoadBans()
/proc/LoadBans()
Banlist = new("data/banlist.bdb")
GLOB.banlist_savefile = new("data/banlist.bdb")
log_admin("Loading Banlist")
if(!length(Banlist.dir)) log_admin("Banlist is empty.")
if(!length(GLOB.banlist_savefile.dir)) log_admin("Banlist is empty.")
if(!Banlist.dir.Find("base"))
if(!GLOB.banlist_savefile.dir.Find("base"))
log_admin("Banlist missing base dir.")
Banlist.dir.Add("base")
Banlist.cd = "/base"
else if(Banlist.dir.Find("base"))
Banlist.cd = "/base"
GLOB.banlist_savefile.dir.Add("base")
GLOB.banlist_savefile.cd = "/base"
else if(GLOB.banlist_savefile.dir.Find("base"))
GLOB.banlist_savefile.cd = "/base"
ClearTempbans()
return 1
@@ -81,17 +78,17 @@ var/savefile/Banlist
/proc/ClearTempbans()
UpdateTime()
Banlist.cd = "/base"
for(var/A in Banlist.dir)
Banlist.cd = "/base/[A]"
if(!Banlist["key"] || !Banlist["id"])
GLOB.banlist_savefile.cd = "/base"
for(var/A in GLOB.banlist_savefile.dir)
GLOB.banlist_savefile.cd = "/base/[A]"
if(!GLOB.banlist_savefile["key"] || !GLOB.banlist_savefile["id"])
RemoveBan(A)
log_admin("Invalid Ban.")
message_admins("Invalid Ban.")
continue
if(!Banlist["temp"]) continue
if(CMinutes >= Banlist["minutes"]) RemoveBan(A)
if(!GLOB.banlist_savefile["temp"]) continue
if(GLOB.CMinutes >= GLOB.banlist_savefile["minutes"]) RemoveBan(A)
return 1
@@ -102,23 +99,23 @@ var/savefile/Banlist
if(temp)
UpdateTime()
bantimestamp = CMinutes + minutes
bantimestamp = GLOB.CMinutes + minutes
Banlist.cd = "/base"
if( Banlist.dir.Find("[ckey][computerid]") )
GLOB.banlist_savefile.cd = "/base"
if( GLOB.banlist_savefile.dir.Find("[ckey][computerid]") )
to_chat(usr, "<span class='danger'>Ban already exists.</span>")
return 0
else
Banlist.dir.Add("[ckey][computerid]")
Banlist.cd = "/base/[ckey][computerid]"
Banlist["key"] << ckey
Banlist["id"] << computerid
Banlist["ip"] << address
Banlist["reason"] << reason
Banlist["bannedby"] << bannedby
Banlist["temp"] << temp
GLOB.banlist_savefile.dir.Add("[ckey][computerid]")
GLOB.banlist_savefile.cd = "/base/[ckey][computerid]"
GLOB.banlist_savefile["key"] << ckey
GLOB.banlist_savefile["id"] << computerid
GLOB.banlist_savefile["ip"] << address
GLOB.banlist_savefile["reason"] << reason
GLOB.banlist_savefile["bannedby"] << bannedby
GLOB.banlist_savefile["temp"] << temp
if(temp)
Banlist["minutes"] << bantimestamp
GLOB.banlist_savefile["minutes"] << bantimestamp
if(!temp)
add_note(ckey, "Permanently banned - [reason]", null, bannedby, 0)
else
@@ -129,12 +126,12 @@ var/savefile/Banlist
var/key
var/id
Banlist.cd = "/base/[foldername]"
Banlist["key"] >> key
Banlist["id"] >> id
Banlist.cd = "/base"
GLOB.banlist_savefile.cd = "/base/[foldername]"
GLOB.banlist_savefile["key"] >> key
GLOB.banlist_savefile["id"] >> id
GLOB.banlist_savefile.cd = "/base"
if(!Banlist.dir.Remove(foldername)) return 0
if(!GLOB.banlist_savefile.dir.Remove(foldername)) return 0
if(!usr)
log_admin("Ban Expired: [key]")
@@ -145,18 +142,18 @@ var/savefile/Banlist
message_admins("[key_name_admin(usr)] unbanned: [key]")
feedback_inc("ban_unban",1)
usr.client.holder.DB_ban_unban( ckey(key), BANTYPE_ANY_FULLBAN)
for(var/A in Banlist.dir)
Banlist.cd = "/base/[A]"
if(key == Banlist["key"] /*|| id == Banlist["id"]*/)
Banlist.cd = "/base"
Banlist.dir.Remove(A)
for(var/A in GLOB.banlist_savefile.dir)
GLOB.banlist_savefile.cd = "/base/[A]"
if(key == GLOB.banlist_savefile["key"] /*|| id == GLOB.banlist_savefile["id"]*/)
GLOB.banlist_savefile.cd = "/base"
GLOB.banlist_savefile.dir.Remove(A)
continue
return 1
/proc/GetExp(minutes as num)
UpdateTime()
var/exp = minutes - CMinutes
var/exp = minutes - GLOB.CMinutes
if(exp <= 0)
return 0
else
@@ -172,19 +169,19 @@ var/savefile/Banlist
/datum/admins/proc/unbanpanel()
var/count = 0
var/dat
Banlist.cd = "/base"
for(var/A in Banlist.dir)
GLOB.banlist_savefile.cd = "/base"
for(var/A in GLOB.banlist_savefile.dir)
count++
Banlist.cd = "/base/[A]"
GLOB.banlist_savefile.cd = "/base/[A]"
var/ref = UID()
var/key = Banlist["key"]
var/id = Banlist["id"]
var/ip = Banlist["ip"]
var/reason = Banlist["reason"]
var/by = Banlist["bannedby"]
var/key = GLOB.banlist_savefile["key"]
var/id = GLOB.banlist_savefile["id"]
var/ip = GLOB.banlist_savefile["ip"]
var/reason = GLOB.banlist_savefile["reason"]
var/by = GLOB.banlist_savefile["bannedby"]
var/expiry
if(Banlist["temp"])
expiry = GetExp(Banlist["minutes"])
if(GLOB.banlist_savefile["temp"])
expiry = GetExp(GLOB.banlist_savefile["minutes"])
if(!expiry) expiry = "Removal Pending"
else expiry = "Permaban"
@@ -207,26 +204,26 @@ var/savefile/Banlist
var/a = pick(1,0)
var/b = pick(1,0)
if(b)
Banlist.cd = "/base"
Banlist.dir.Add("trash[i]trashid[i]")
Banlist.cd = "/base/trash[i]trashid[i]"
Banlist["key"] << "trash[i]"
GLOB.banlist_savefile.cd = "/base"
GLOB.banlist_savefile.dir.Add("trash[i]trashid[i]")
GLOB.banlist_savefile.cd = "/base/trash[i]trashid[i]"
GLOB.banlist_savefile["key"] << "trash[i]"
else
Banlist.cd = "/base"
Banlist.dir.Add("[last]trashid[i]")
Banlist.cd = "/base/[last]trashid[i]"
Banlist["key"] << last
Banlist["id"] << "trashid[i]"
Banlist["reason"] << "Trashban[i]."
Banlist["temp"] << a
Banlist["minutes"] << CMinutes + rand(1,2000)
Banlist["bannedby"] << "trashmin"
GLOB.banlist_savefile.cd = "/base"
GLOB.banlist_savefile.dir.Add("[last]trashid[i]")
GLOB.banlist_savefile.cd = "/base/[last]trashid[i]"
GLOB.banlist_savefile["key"] << last
GLOB.banlist_savefile["id"] << "trashid[i]"
GLOB.banlist_savefile["reason"] << "Trashban[i]."
GLOB.banlist_savefile["temp"] << a
GLOB.banlist_savefile["minutes"] << GLOB.CMinutes + rand(1,2000)
GLOB.banlist_savefile["bannedby"] << "trashmin"
last = "trash[i]"
Banlist.cd = "/base"
GLOB.banlist_savefile.cd = "/base"
/proc/ClearAllBans()
Banlist.cd = "/base"
for(var/A in Banlist.dir)
GLOB.banlist_savefile.cd = "/base"
for(var/A in GLOB.banlist_savefile.dir)
RemoveBan(A)
+47 -47
View File
@@ -1,5 +1,5 @@
var/global/BSACooldown = 0
var/global/nologevent = 0
GLOBAL_VAR_INIT(BSACooldown, 0)
GLOBAL_VAR_INIT(nologevent, 0)
////////////////////////////////
/proc/message_admins(var/msg)
@@ -10,7 +10,7 @@ var/global/nologevent = 0
to_chat(C, msg)
/proc/msg_admin_attack(var/text, var/loglevel)
if(!nologevent)
if(!GLOB.nologevent)
var/rendered = "<span class=\"admin\"><span class=\"prefix\">ATTACK:</span> <span class=\"message\">[text]</span></span>"
for(var/client/C in GLOB.admins)
if(R_ADMIN & C.holder.rights)
@@ -72,7 +72,7 @@ var/global/nologevent = 0
body += "\[<A href='?_src_=holder;editrights=rank;ckey=[M.ckey]'>[M.client.holder ? M.client.holder.rank : "Player"]</A>\] "
body += "\[<A href='?_src_=holder;getplaytimewindow=[M.UID()]'>" + M.client.get_exp_type(EXP_TYPE_CREW) + " as [EXP_TYPE_CREW]</a>\]"
if(istype(M, /mob/new_player))
if(isnewplayer(M))
body += " <B>Hasn't Entered Game</B> "
else
body += " \[<A href='?_src_=holder;revive=[M.UID()]'>Heal</A>\] "
@@ -147,7 +147,7 @@ var/global/nologevent = 0
body += {" | <A href='?_src_=holder;cryossd=[M.UID()]'>Cryo</A> "}
if(M.client)
if(!istype(M, /mob/new_player))
if(!isnewplayer(M))
body += "<br><br>"
body += "<b>Transformation:</b>"
body += "<br>"
@@ -197,7 +197,7 @@ var/global/nologevent = 0
for(var/block=1;block<=DNA_SE_LENGTH;block++)
if(((block-1)%5)==0)
body += "</tr><tr><th>[block-1]</th>"
bname = assigned_blocks[block]
bname = GLOB.assigned_blocks[block]
body += "<td>"
if(bname)
var/bstate=M.dna.GetSEState(block)
@@ -306,7 +306,7 @@ var/global/nologevent = 0
<BR>Feed channels and stories entered through here will be uneditable and handled as official news by the rest of the units.
<BR>Note that this panel allows full freedom over the news network, there are no constrictions except the few basic ones. Don't break things!</FONT>
"}
if(news_network.wanted_issue)
if(GLOB.news_network.wanted_issue)
dat+= "<HR><A href='?src=[UID()];ac_view_wanted=1'>Read Wanted Issue</A>"
dat+= {"<HR><BR><A href='?src=[UID()];ac_create_channel=1'>Create Feed Channel</A>
@@ -316,7 +316,7 @@ var/global/nologevent = 0
"}
var/wanted_already = 0
if(news_network.wanted_issue)
if(GLOB.news_network.wanted_issue)
wanted_already = 1
dat+={"<HR><B>Feed Security functions:</B><BR>
@@ -327,10 +327,10 @@ var/global/nologevent = 0
"}
if(1)
dat+= "Station Feed Channels<HR>"
if( isemptylist(news_network.network_channels) )
if( isemptylist(GLOB.news_network.network_channels) )
dat+="<I>No active channels found...</I>"
else
for(var/datum/feed_channel/CHANNEL in news_network.network_channels)
for(var/datum/feed_channel/CHANNEL in GLOB.news_network.network_channels)
if(CHANNEL.is_admin_channel)
dat+="<B><FONT style='BACKGROUND-COLOR: LightGreen'><A href='?src=[UID()];ac_show_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A></FONT></B><BR>"
else
@@ -377,7 +377,7 @@ var/global/nologevent = 0
if(src.admincaster_feed_channel.channel_name =="" || src.admincaster_feed_channel.channel_name == "\[REDACTED\]")
dat+="<FONT COLOR='maroon'>•Invalid channel name.</FONT><BR>"
var/check = 0
for(var/datum/feed_channel/FC in news_network.network_channels)
for(var/datum/feed_channel/FC in GLOB.news_network.network_channels)
if(FC.channel_name == src.admincaster_feed_channel.channel_name)
check = 1
break
@@ -414,10 +414,10 @@ var/global/nologevent = 0
Keep in mind that users attempting to view a censored feed will instead see the \[REDACTED\] tag above it.</FONT>
<HR>Select Feed channel to get Stories from:<BR>
"}
if(isemptylist(news_network.network_channels))
if(isemptylist(GLOB.news_network.network_channels))
dat+="<I>No feed channels found active...</I><BR>"
else
for(var/datum/feed_channel/CHANNEL in news_network.network_channels)
for(var/datum/feed_channel/CHANNEL in GLOB.news_network.network_channels)
dat+="<A href='?src=[UID()];ac_pick_censor_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ""]<BR>"
dat+="<BR><A href='?src=[UID()];ac_setScreen=[0]'>Cancel</A>"
if(11)
@@ -427,10 +427,10 @@ var/global/nologevent = 0
morale, integrity or disciplinary behaviour. A D-Notice will render a channel unable to be updated by anyone, without deleting any feed
stories it might contain at the time. You can lift a D-Notice if you have the required access at any time.</FONT><HR>
"}
if(isemptylist(news_network.network_channels))
if(isemptylist(GLOB.news_network.network_channels))
dat+="<I>No feed channels found active...</I><BR>"
else
for(var/datum/feed_channel/CHANNEL in news_network.network_channels)
for(var/datum/feed_channel/CHANNEL in GLOB.news_network.network_channels)
dat+="<A href='?src=[UID()];ac_pick_d_notice=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ""]<BR>"
dat+="<BR><A href='?src=[UID()];ac_setScreen=[0]'>Back</A>"
@@ -470,7 +470,7 @@ var/global/nologevent = 0
dat+="<B>Wanted Issue Handler:</B>"
var/wanted_already = 0
var/end_param = 1
if(news_network.wanted_issue)
if(GLOB.news_network.wanted_issue)
wanted_already = 1
end_param = 2
if(wanted_already)
@@ -481,7 +481,7 @@ var/global/nologevent = 0
<A href='?src=[UID()];ac_set_wanted_desc=1'>Description</A>: [src.admincaster_feed_message.body] <BR>
"}
if(wanted_already)
dat+="<B>Wanted Issue created by:</B><FONT COLOR='green'> [news_network.wanted_issue.backup_author]</FONT><BR>"
dat+="<B>Wanted Issue created by:</B><FONT COLOR='green'> [GLOB.news_network.wanted_issue.backup_author]</FONT><BR>"
else
dat+="<B>Wanted Issue will be created under prosecutor:</B><FONT COLOR='green'> [src.admincaster_signature]</FONT><BR>"
dat+="<BR><A href='?src=[UID()];ac_submit_wanted=[end_param]'>[(wanted_already) ? ("Edit Issue") : ("Submit")]</A>"
@@ -507,13 +507,13 @@ var/global/nologevent = 0
"}
if(18)
dat+={"
<B><FONT COLOR ='maroon'>-- STATIONWIDE WANTED ISSUE --</B></FONT><BR><FONT SIZE=2>\[Submitted by: <FONT COLOR='green'>[news_network.wanted_issue.backup_author]</FONT>\]</FONT><HR>
<B>Criminal</B>: [news_network.wanted_issue.author]<BR>
<B>Description</B>: [news_network.wanted_issue.body]<BR>
<B><FONT COLOR ='maroon'>-- STATIONWIDE WANTED ISSUE --</B></FONT><BR><FONT SIZE=2>\[Submitted by: <FONT COLOR='green'>[GLOB.news_network.wanted_issue.backup_author]</FONT>\]</FONT><HR>
<B>Criminal</B>: [GLOB.news_network.wanted_issue.author]<BR>
<B>Description</B>: [GLOB.news_network.wanted_issue.body]<BR>
<B>Photo:</B>:
"}
if(news_network.wanted_issue.img)
usr << browse_rsc(news_network.wanted_issue.img, "tmp_photow.png")
if(GLOB.news_network.wanted_issue.img)
usr << browse_rsc(GLOB.news_network.wanted_issue.img, "tmp_photow.png")
dat+="<BR><img src='tmp_photow.png' width = '180'>"
else
dat+="None"
@@ -536,7 +536,7 @@ var/global/nologevent = 0
return
var/dat = "<B>Job Bans!</B><HR><table>"
for(var/t in jobban_keylist)
for(var/t in GLOB.jobban_keylist)
var/r = t
if( findtext(r,"##") )
r = copytext( r, 1, findtext(r,"##") )//removes the description
@@ -552,7 +552,7 @@ var/global/nologevent = 0
<center><B>Game Panel</B></center><hr>\n
<A href='?src=[UID()];c_mode=1'>Change Game Mode</A><br>
"}
if(master_mode == "secret")
if(GLOB.master_mode == "secret")
dat += "<A href='?src=[UID()];f_secret=1'>(Force Secret Mode)</A><br>"
dat += {"
@@ -714,8 +714,8 @@ var/global/nologevent = 0
if(!check_rights(R_SERVER))
return
enter_allowed = !( enter_allowed )
if(!( enter_allowed ))
GLOB.enter_allowed = !( GLOB.enter_allowed )
if(!( GLOB.enter_allowed ))
to_chat(world, "<B>New players may no longer enter the game.</B>")
else
to_chat(world, "<B>New players may now enter the game.</B>")
@@ -750,13 +750,13 @@ var/global/nologevent = 0
if(!check_rights(R_SERVER))
return
abandon_allowed = !( abandon_allowed )
if(abandon_allowed)
GLOB.abandon_allowed = !( GLOB.abandon_allowed )
if(GLOB.abandon_allowed)
to_chat(world, "<B>You may now respawn.</B>")
else
to_chat(world, "<B>You may no longer respawn :(</B>")
message_admins("[key_name_admin(usr)] toggled respawn to [abandon_allowed ? "On" : "Off"].", 1)
log_admin("[key_name(usr)] toggled respawn to [abandon_allowed ? "On" : "Off"].")
message_admins("[key_name_admin(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].", 1)
log_admin("[key_name(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].")
world.update_status()
feedback_add_details("admin_verb","TR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -768,9 +768,9 @@ var/global/nologevent = 0
if(!check_rights(R_EVENT))
return
aliens_allowed = !aliens_allowed
log_admin("[key_name(usr)] toggled aliens to [aliens_allowed].")
message_admins("[key_name_admin(usr)] toggled aliens [aliens_allowed ? "on" : "off"].")
GLOB.aliens_allowed = !GLOB.aliens_allowed
log_admin("[key_name(usr)] toggled aliens to [GLOB.aliens_allowed].")
message_admins("[key_name_admin(usr)] toggled aliens [GLOB.aliens_allowed ? "on" : "off"].")
feedback_add_details("admin_verb","TA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/delay()
@@ -786,13 +786,13 @@ var/global/nologevent = 0
log_admin("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].")
message_admins("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].", 1)
return //alert("Round end delayed", null, null, null, null, null)
if(going)
going = FALSE
if(SSticker.ticker_going)
SSticker.ticker_going = FALSE
SSticker.delay_end = TRUE
to_chat(world, "<b>The game start has been delayed.</b>")
log_admin("[key_name(usr)] delayed the game.")
else
going = TRUE
SSticker.ticker_going = TRUE
to_chat(world, "<b>The game will start soon.</b>")
log_admin("[key_name(usr)] removed the delay.")
feedback_add_details("admin_verb","DELAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -899,13 +899,13 @@ var/global/nologevent = 0
if(!check_rights(R_SERVER))
return
guests_allowed = !( guests_allowed )
if(!( guests_allowed ))
GLOB.guests_allowed = !( GLOB.guests_allowed )
if(!( GLOB.guests_allowed ))
to_chat(world, "<B>Guests may no longer enter the game.</B>")
else
to_chat(world, "<B>Guests may now enter the game.</B>")
log_admin("[key_name(usr)] toggled guests game entering [guests_allowed ? "" : "dis"]allowed.")
message_admins("<span class='notice'>[key_name_admin(usr)] toggled guests game entering [guests_allowed ? "" : "dis"]allowed.</span>", 1)
log_admin("[key_name(usr)] toggled guests game entering [GLOB.guests_allowed ? "" : "dis"]allowed.")
message_admins("<span class='notice'>[key_name_admin(usr)] toggled guests game entering [GLOB.guests_allowed ? "" : "dis"]allowed.</span>", 1)
feedback_add_details("admin_verb","TGU") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/output_ai_laws()
@@ -954,12 +954,12 @@ var/global/nologevent = 0
//ALL DONE
//*********************************************************************************************************
var/gamma_ship_location = 1 // 0 = station , 1 = space
GLOBAL_VAR_INIT(gamma_ship_location, 1) // 0 = station , 1 = space
/proc/move_gamma_ship()
var/area/fromArea
var/area/toArea
if(gamma_ship_location == 1)
if(GLOB.gamma_ship_location == 1)
fromArea = locate(/area/shuttle/gamma/space)
toArea = locate(/area/shuttle/gamma/station)
else
@@ -970,10 +970,10 @@ var/gamma_ship_location = 1 // 0 = station , 1 = space
for(var/obj/machinery/mech_bay_recharge_port/P in toArea)
P.update_recharge_turf()
if(gamma_ship_location)
gamma_ship_location = 0
if(GLOB.gamma_ship_location)
GLOB.gamma_ship_location = 0
else
gamma_ship_location = 1
GLOB.gamma_ship_location = 1
return
/proc/formatJumpTo(var/location,var/where="")
@@ -1004,13 +1004,13 @@ var/gamma_ship_location = 1 // 0 = station , 1 = space
/proc/kick_clients_in_lobby(message, kick_only_afk = 0)
var/list/kicked_client_names = list()
for(var/client/C in GLOB.clients)
if(istype(C.mob, /mob/new_player))
if(isnewplayer(C.mob))
if(kick_only_afk && !C.is_afk()) //Ignore clients who are not afk
continue
if(message)
to_chat(C, message)
kicked_client_names.Add("[C.ckey]")
del(C)
qdel(C)
return kicked_client_names
//returns 1 to let the dragdrop code know we are trapping this event
+3 -7
View File
@@ -11,10 +11,6 @@
/proc/investigate_subject2file(var/subject)
return file("[INVESTIGATE_DIR][subject].html")
/hook/startup/proc/resetInvestigate()
investigate_reset()
return 1
/proc/investigate_reset()
if(fdel(INVESTIGATE_DIR)) return 1
return 0
@@ -23,18 +19,18 @@
if(!message) return
var/F = investigate_subject2file(subject)
if(!F) return
investigate_log_subjects |= subject
GLOB.investigate_log_subjects |= subject
F << "<small>[time_stamp()] \ref[src] ([x],[y],[z])</small> || [src] [message]<br>"
/proc/log_investigate(message, subject)
if(!message) return
var/F = investigate_subject2file(subject)
if(!F) return
investigate_log_subjects |= subject
GLOB.investigate_log_subjects |= subject
F << "<small>[time_stamp()] || [message]<br>"
//ADMINVERBS
/client/proc/investigate_show( subject in investigate_log_subjects )
/client/proc/investigate_show( subject in GLOB.investigate_log_subjects )
set name = "Investigate"
set category = "Admin"
if(!holder) return
+10 -10
View File
@@ -3,7 +3,7 @@
set category = "Server"
if(!check_rights(R_SERVER))
return
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
return
var/memotask = input(usr,"Choose task.","Memo") in list("Show","Write","Edit","Remove")
@@ -16,13 +16,13 @@
return
if(!task)
return
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
return
var/sql_ckey = sanitizeSQL(src.ckey)
switch(task)
if("Write")
var/DBQuery/query_memocheck = dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")] WHERE ckey = '[sql_ckey]'")
var/DBQuery/query_memocheck = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")] WHERE ckey = '[sql_ckey]'")
if(!query_memocheck.Execute())
var/err = query_memocheck.ErrorMsg()
log_game("SQL ERROR obtaining ckey from memo table. Error : \[[err]\]\n")
@@ -35,7 +35,7 @@
return
memotext = sanitizeSQL(memotext)
var/timestamp = SQLtime()
var/DBQuery/query_memoadd = dbcon.NewQuery("INSERT INTO [format_table_name("memo")] (ckey, memotext, timestamp) VALUES ('[sql_ckey]', '[memotext]', '[timestamp]')")
var/DBQuery/query_memoadd = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("memo")] (ckey, memotext, timestamp) VALUES ('[sql_ckey]', '[memotext]', '[timestamp]')")
if(!query_memoadd.Execute())
var/err = query_memoadd.ErrorMsg()
log_game("SQL ERROR adding new memo. Error : \[[err]\]\n")
@@ -43,7 +43,7 @@
log_admin("[key_name(src)] has set a memo: [memotext]")
message_admins("[key_name_admin(src)] has set a memo:<br>[memotext]")
if("Edit")
var/DBQuery/query_memolist = dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")]")
var/DBQuery/query_memolist = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")]")
if(!query_memolist.Execute())
var/err = query_memolist.ErrorMsg()
log_game("SQL ERROR obtaining ckey from memo table. Error : \[[err]\]\n")
@@ -59,7 +59,7 @@
if(!target_ckey)
return
var/target_sql_ckey = sanitizeSQL(target_ckey)
var/DBQuery/query_memofind = dbcon.NewQuery("SELECT memotext FROM [format_table_name("memo")] WHERE ckey = '[target_sql_ckey]'")
var/DBQuery/query_memofind = GLOB.dbcon.NewQuery("SELECT memotext FROM [format_table_name("memo")] WHERE ckey = '[target_sql_ckey]'")
if(!query_memofind.Execute())
var/err = query_memofind.ErrorMsg()
log_game("SQL ERROR obtaining memotext from memo table. Error : \[[err]\]\n")
@@ -72,7 +72,7 @@
new_memo = sanitizeSQL(new_memo)
var/edit_text = "Edited by [sql_ckey] on [SQLtime()] from<br>[old_memo]<br>to<br>[new_memo]<hr>"
edit_text = sanitizeSQL(edit_text)
var/DBQuery/update_query = dbcon.NewQuery("UPDATE [format_table_name("memo")] SET memotext = '[new_memo]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE ckey = '[target_sql_ckey]'")
var/DBQuery/update_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("memo")] SET memotext = '[new_memo]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE ckey = '[target_sql_ckey]'")
if(!update_query.Execute())
var/err = update_query.ErrorMsg()
log_game("SQL ERROR editing memo. Error : \[[err]\]\n")
@@ -84,7 +84,7 @@
log_admin("[key_name(src)] has edited [target_sql_ckey]'s memo from \"[old_memo]\" to \"[new_memo]\"")
message_admins("[key_name_admin(src)] has edited [target_sql_ckey]'s memo from \"[old_memo]\" to \"[new_memo]\"")
if("Show")
var/DBQuery/query_memoshow = dbcon.NewQuery("SELECT ckey, memotext, timestamp, last_editor FROM [format_table_name("memo")]")
var/DBQuery/query_memoshow = GLOB.dbcon.NewQuery("SELECT ckey, memotext, timestamp, last_editor FROM [format_table_name("memo")]")
if(!query_memoshow.Execute())
var/err = query_memoshow.ErrorMsg()
log_game("SQL ERROR obtaining ckey, memotext, timestamp, last_editor from memo table. Error : \[[err]\]\n")
@@ -104,7 +104,7 @@
else if(!silent)
to_chat(src, "No memos found in database.")
if("Remove")
var/DBQuery/query_memodellist = dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")]")
var/DBQuery/query_memodellist = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")]")
if(!query_memodellist.Execute())
var/err = query_memodellist.ErrorMsg()
log_game("SQL ERROR obtaining ckey from memo table. Error : \[[err]\]\n")
@@ -120,7 +120,7 @@
if(!target_ckey)
return
var/target_sql_ckey = sanitizeSQL(target_ckey)
var/DBQuery/query_memodel = dbcon.NewQuery("DELETE FROM [format_table_name("memo")] WHERE ckey = '[target_sql_ckey]'")
var/DBQuery/query_memodel = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("memo")] WHERE ckey = '[target_sql_ckey]'")
if(!query_memodel.Execute())
var/err = query_memodel.ErrorMsg()
log_game("SQL ERROR removing memo. Error : \[[err]\]\n")
+32 -19
View File
@@ -1,8 +1,9 @@
var/list/admin_ranks = list() //list of all ranks with associated rights
GLOBAL_LIST_EMPTY(admin_ranks) //list of all ranks with associated rights
GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
//load our rank - > rights associations
/proc/load_admin_ranks()
admin_ranks.Cut()
GLOB.admin_ranks.Cut()
var/previous_rights = 0
@@ -43,29 +44,35 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
if("mod") rights |= R_MOD
if("mentor") rights |= R_MENTOR
if("proccall") rights |= R_PROCCALL
if("viewruntimes") rights |= R_VIEWRUNTIMES
admin_ranks[rank] = rights
GLOB.admin_ranks[rank] = rights
previous_rights = rights
#ifdef TESTING
var/msg = "Permission Sets Built:\n"
for(var/rank in admin_ranks)
msg += "\t[rank] - [admin_ranks[rank]]\n"
for(var/rank in GLOB.admin_ranks)
msg += "\t[rank] - [GLOB.admin_ranks[rank]]\n"
testing(msg)
#endif
/hook/startup/proc/loadAdmins()
load_admins()
return 1
/proc/load_admins()
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Admin reload blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to reload admins via advanced proc-call")
log_admin("[key_name(usr)] attempted to reload admins via advanced proc-call")
return
//clear the datums references
admin_datums.Cut()
GLOB.admin_datums.Cut()
for(var/client/C in GLOB.admins)
C.remove_admin_verbs()
C.holder = null
GLOB.admins.Cut()
// Remove all profiler access
for(var/A in world.GetConfig("admin"))
world.SetConfig("APP/admin", A, null)
if(config.admin_legacy_system)
load_admin_ranks()
@@ -91,11 +98,14 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
rank = ckeyEx(List[2])
//load permissions associated with this rank
var/rights = admin_ranks[rank]
var/rights = GLOB.admin_ranks[rank]
//create the admin datum and store it for later use
var/datum/admins/D = new /datum/admins(rank, rights, ckey)
if(D.rights & R_DEBUG || D.rights & R_VIEWRUNTIMES) // Grants profiler access to anyone with R_DEBUG or R_VIEWRUNTIMES
world.SetConfig("APP/admin", ckey, "role=admin")
//find the client for a ckey if they are connected and associate them with the new admin datum
D.associate(GLOB.directory[ckey])
@@ -103,13 +113,13 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
//The current admin system uses SQL
establish_db_connection()
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
log_world("Failed to connect to database in load_admins(). Reverting to legacy system.")
config.admin_legacy_system = 1
load_admins()
return
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, rank, level, flags FROM [format_table_name("admin")]")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, rank, level, flags FROM [format_table_name("admin")]")
query.Execute()
while(query.NextRow())
var/ckey = query.item[1]
@@ -120,9 +130,12 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
if(istext(rights)) rights = text2num(rights)
var/datum/admins/D = new /datum/admins(rank, rights, ckey)
if(D.rights & R_DEBUG || D.rights & R_VIEWRUNTIMES) // Grants profiler access to anyone with R_DEBUG or R_VIEWRUNTIMES
world.SetConfig("APP/admin", ckey, "role=admin")
//find the client for a ckey if they are connected and associate them with the new admin datum
D.associate(GLOB.directory[ckey])
if(!admin_datums)
if(!GLOB.admin_datums)
log_world("The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system.")
config.admin_legacy_system = 1
load_admins()
@@ -130,9 +143,9 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
#ifdef TESTING
var/msg = "Admins Built:\n"
for(var/ckey in admin_datums)
for(var/ckey in GLOB.admin_datums)
var/rank
var/datum/admins/D = admin_datums[ckey]
var/datum/admins/D = GLOB.admin_datums[ckey]
if(D) rank = D.rank
msg += "\t[ckey] - [rank]\n"
testing(msg)
@@ -140,12 +153,12 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
#ifdef TESTING
/client/verb/changerank(newrank in admin_ranks)
/client/verb/changerank(newrank in GLOB.admin_ranks)
if(holder)
holder.rank = newrank
holder.rights = admin_ranks[newrank]
holder.rights = GLOB.admin_ranks[newrank]
else
holder = new /datum/admins(newrank,admin_ranks[newrank],ckey)
holder = new /datum/admins(newrank,GLOB.admin_ranks[newrank],ckey)
remove_admin_verbs()
holder.associate(src)
+87 -78
View File
@@ -1,13 +1,13 @@
//admin verb groups - They can overlap if you so wish. Only one of each verb will exist in the verbs list regardless
var/list/admin_verbs_default = list(
GLOBAL_LIST_INIT(admin_verbs_default, list(
/client/proc/deadmin_self, /*destroys our own admin datum so we can play as a regular player*/
/client/proc/hide_verbs, /*hides all our adminverbs*/
/client/proc/toggleadminhelpsound,
/client/proc/togglementorhelpsound,
/client/proc/cmd_mentor_check_new_players,
/client/proc/cmd_mentor_check_player_exp /* shows players by playtime */
)
var/list/admin_verbs_admin = list(
))
GLOBAL_LIST_INIT(admin_verbs_admin, list(
/client/proc/check_antagonists, /*shows all antags*/
/datum/admins/proc/show_player_panel,
/client/proc/player_panel, /*shows an interface for all players, with links to various panels (old style)*/
@@ -26,6 +26,7 @@ var/list/admin_verbs_admin = list(
/client/proc/cmd_admin_subtle_message, /*send an message to somebody as a 'voice in their head'*/
/client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/
/client/proc/cmd_admin_check_contents, /*displays the contents of an instance*/
/client/proc/cmd_admin_open_logging_view,
/client/proc/getserverlogs, /*allows us to fetch server logs (diary) for other days*/
/client/proc/jumptocoord, /*we ghost and jump to a coordinate*/
/client/proc/Getmob, /*teleports a mob to our location*/
@@ -67,7 +68,6 @@ var/list/admin_verbs_admin = list(
/client/proc/empty_ai_core_toggle_latejoin,
/client/proc/aooc,
/client/proc/freeze,
/client/proc/freezemecha,
/client/proc/alt_check,
/client/proc/secrets,
/client/proc/change_human_appearance_admin, /* Allows an admin to change the basic appearance of human-based mobs */
@@ -79,20 +79,20 @@ var/list/admin_verbs_admin = list(
/client/proc/list_ssds_afks,
/client/proc/cmd_admin_headset_message,
/client/proc/spawn_floor_cluwne
)
var/list/admin_verbs_ban = list(
))
GLOBAL_LIST_INIT(admin_verbs_ban, list(
/client/proc/unban_panel,
/client/proc/jobbans,
/client/proc/stickybanpanel
)
var/list/admin_verbs_sounds = list(
))
GLOBAL_LIST_INIT(admin_verbs_sounds, list(
/client/proc/play_local_sound,
/client/proc/play_sound,
/client/proc/play_server_sound,
/client/proc/play_intercomm_sound,
/client/proc/stop_global_admin_sounds
)
var/list/admin_verbs_event = list(
))
GLOBAL_LIST_INIT(admin_verbs_event, list(
/client/proc/object_talk,
/client/proc/cmd_admin_dress,
/client/proc/cmd_admin_gib_self,
@@ -117,14 +117,14 @@ var/list/admin_verbs_event = list(
/client/proc/event_manager_panel,
/client/proc/modify_goals,
/client/proc/outfit_manager
)
))
var/list/admin_verbs_spawn = list(
GLOBAL_LIST_INIT(admin_verbs_spawn, list(
/datum/admins/proc/spawn_atom, /*allows us to spawn instances*/
/client/proc/respawn_character,
/client/proc/admin_deserialize
)
var/list/admin_verbs_server = list(
))
GLOBAL_LIST_INIT(admin_verbs_server, list(
/client/proc/ToRban,
/client/proc/Set_Holiday,
/datum/admins/proc/startnow,
@@ -144,8 +144,8 @@ var/list/admin_verbs_server = list(
/client/proc/toggle_antagHUD_restrictions,
/client/proc/set_ooc,
/client/proc/reset_ooc
)
var/list/admin_verbs_debug = list(
))
GLOBAL_LIST_INIT(admin_verbs_debug, list(
/client/proc/cmd_admin_list_open_jobs,
/client/proc/Debug2,
/client/proc/cmd_debug_make_powernets,
@@ -172,21 +172,21 @@ var/list/admin_verbs_debug = list(
/client/proc/admin_serialize,
/client/proc/jump_to_ruin,
/client/proc/toggle_medal_disable,
)
var/list/admin_verbs_possess = list(
))
GLOBAL_LIST_INIT(admin_verbs_possess, list(
/proc/possess,
/proc/release
)
var/list/admin_verbs_permissions = list(
))
GLOBAL_LIST_INIT(admin_verbs_permissions, list(
/client/proc/edit_admin_permissions,
/client/proc/create_poll,
/client/proc/big_brother
)
var/list/admin_verbs_rejuv = list(
))
GLOBAL_LIST_INIT(admin_verbs_rejuv, list(
/client/proc/respawn_character,
/client/proc/cmd_admin_rejuvenate
)
var/list/admin_verbs_mod = list(
))
GLOBAL_LIST_INIT(admin_verbs_mod, list(
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
/client/proc/cmd_admin_pm_panel, /*admin-pm list*/
/client/proc/cmd_admin_pm_by_key_panel, /*admin-pm list by key*/
@@ -199,8 +199,8 @@ var/list/admin_verbs_mod = list(
/datum/admins/proc/show_player_panel,
/client/proc/jobbans,
/client/proc/debug_variables /*allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify*/
)
var/list/admin_verbs_mentor = list(
))
GLOBAL_LIST_INIT(admin_verbs_mentor, list(
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
/client/proc/cmd_admin_pm_panel, /*admin-pm list*/
/client/proc/cmd_admin_pm_by_key_panel, /*admin-pm list by key*/
@@ -208,20 +208,20 @@ var/list/admin_verbs_mentor = list(
/client/proc/toggleMentorTicketLogs,
/client/proc/cmd_mentor_say /* mentor say*/
// cmd_mentor_say is added/removed by the toggle_mentor_chat verb
)
var/list/admin_verbs_proccall = list(
))
GLOBAL_LIST_INIT(admin_verbs_proccall, list(
/client/proc/callproc,
/client/proc/callproc_datum,
/client/proc/SDQL2_query
)
var/list/admin_verbs_ticket = list(
))
GLOBAL_LIST_INIT(admin_verbs_ticket, list(
/client/proc/openAdminTicketUI,
/client/proc/toggleticketlogs,
/client/proc/openMentorTicketUI,
/client/proc/toggleMentorTicketLogs,
/client/proc/resolveAllAdminTickets,
/client/proc/resolveAllMentorTickets
)
))
/client/proc/on_holder_add()
if(chatOutput && chatOutput.loaded)
@@ -229,62 +229,71 @@ var/list/admin_verbs_ticket = list(
/client/proc/add_admin_verbs()
if(holder)
verbs += admin_verbs_default
// If they have ANYTHING OTHER THAN ONLY VIEW RUNTIMES (65536), then give them the default admin verbs
if(holder.rights != R_VIEWRUNTIMES)
verbs += GLOB.admin_verbs_default
if(holder.rights & R_BUILDMODE)
verbs += /client/proc/togglebuildmodeself
if(holder.rights & R_ADMIN)
verbs += admin_verbs_admin
verbs += admin_verbs_ticket
verbs += GLOB.admin_verbs_admin
verbs += GLOB.admin_verbs_ticket
spawn(1)
control_freak = 0
if(holder.rights & R_BAN)
verbs += admin_verbs_ban
verbs += GLOB.admin_verbs_ban
if(holder.rights & R_EVENT)
verbs += admin_verbs_event
verbs += GLOB.admin_verbs_event
if(holder.rights & R_SERVER)
verbs += admin_verbs_server
verbs += GLOB.admin_verbs_server
if(holder.rights & R_DEBUG)
verbs += admin_verbs_debug
verbs += GLOB.admin_verbs_debug
spawn(1)
control_freak = 0 // Setting control_freak to 0 allows you to use the Profiler and other client-side tools
if(holder.rights & R_POSSESS)
verbs += admin_verbs_possess
verbs += GLOB.admin_verbs_possess
if(holder.rights & R_PERMISSIONS)
verbs += admin_verbs_permissions
verbs += GLOB.admin_verbs_permissions
if(holder.rights & R_STEALTH)
verbs += /client/proc/stealth
if(holder.rights & R_REJUVINATE)
verbs += admin_verbs_rejuv
verbs += GLOB.admin_verbs_rejuv
if(holder.rights & R_SOUNDS)
verbs += admin_verbs_sounds
verbs += GLOB.admin_verbs_sounds
if(holder.rights & R_SPAWN)
verbs += admin_verbs_spawn
verbs += GLOB.admin_verbs_spawn
if(holder.rights & R_MOD)
verbs += admin_verbs_mod
verbs += GLOB.admin_verbs_mod
if(holder.rights & R_MENTOR)
verbs += admin_verbs_mentor
verbs += GLOB.admin_verbs_mentor
if(holder.rights & R_PROCCALL)
verbs += admin_verbs_proccall
verbs += GLOB.admin_verbs_proccall
if(holder.rights & R_VIEWRUNTIMES)
verbs += /client/proc/view_runtimes
spawn(1) // This setting exposes the profiler for people with R_VIEWRUNTIMES. They must still have it set in cfg/admin.txt
control_freak = 0
/client/proc/remove_admin_verbs()
verbs.Remove(
admin_verbs_default,
GLOB.admin_verbs_default,
/client/proc/togglebuildmodeself,
admin_verbs_admin,
admin_verbs_ban,
admin_verbs_event,
admin_verbs_server,
admin_verbs_debug,
admin_verbs_possess,
admin_verbs_permissions,
GLOB.admin_verbs_admin,
GLOB.admin_verbs_ban,
GLOB.admin_verbs_event,
GLOB.admin_verbs_server,
GLOB.admin_verbs_debug,
GLOB.admin_verbs_possess,
GLOB.admin_verbs_permissions,
/client/proc/stealth,
admin_verbs_rejuv,
admin_verbs_sounds,
admin_verbs_spawn,
admin_verbs_mod,
admin_verbs_mentor,
admin_verbs_proccall,
admin_verbs_show_debug_verbs,
GLOB.admin_verbs_rejuv,
GLOB.admin_verbs_sounds,
GLOB.admin_verbs_spawn,
GLOB.admin_verbs_mod,
GLOB.admin_verbs_mentor,
GLOB.admin_verbs_proccall,
GLOB.admin_verbs_show_debug_verbs,
/client/proc/readmin,
admin_verbs_ticket
GLOB.admin_verbs_ticket
)
/client/proc/hide_verbs()
@@ -328,7 +337,7 @@ var/list/admin_verbs_ticket = list(
ghost.reenter_corpse()
log_admin("[key_name(usr)] re-entered their body")
feedback_add_details("admin_verb","P") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
else if(istype(mob,/mob/new_player))
else if(isnewplayer(mob))
to_chat(src, "<font color='red'>Error: Aghost: Can't admin-ghost whilst in the lobby. Join or observe first.</font>")
else
//ghostize
@@ -514,14 +523,14 @@ var/list/admin_verbs_ticket = list(
return
if(!warned_ckey || !istext(warned_ckey)) return
if(warned_ckey in admin_datums)
if(warned_ckey in GLOB.admin_datums)
to_chat(usr, "<font color='red'>Error: warn(): You can't warn admins.</font>")
return
var/datum/preferences/D
var/client/C = GLOB.directory[warned_ckey]
if(C) D = C.prefs
else D = preferences_datums[warned_ckey]
else D = GLOB.preferences_datums[warned_ckey]
if(!D)
to_chat(src, "<font color='red'>Error: warn(): No such ckey found.</font>")
@@ -533,7 +542,7 @@ var/list/admin_verbs_ticket = list(
message_admins("[key_name_admin(src)] has warned [key_name_admin(C)] resulting in a [AUTOBANTIME] minute ban")
log_admin("[key_name(src)] has warned [key_name(C)] resulting in a [AUTOBANTIME] minute ban")
to_chat(C, "<font color='red'><BIG><B>You have been autobanned due to a warning by [ckey].</B></BIG><br>This is a temporary ban, it will be removed in [AUTOBANTIME] minutes.")
del(C)
qdel(C)
else
message_admins("[key_name_admin(src)] has warned [warned_ckey] resulting in a [AUTOBANTIME] minute ban")
log_admin("[key_name(src)] has warned [warned_ckey] resulting in a [AUTOBANTIME] minute ban")
@@ -601,7 +610,7 @@ var/list/admin_verbs_ticket = list(
var/list/spell_list = list()
var/type_length = length("/obj/effect/proc_holder/spell") + 2
for(var/A in spells)
for(var/A in GLOB.spells)
spell_list[copytext("[A]", type_length)] = A
var/obj/effect/proc_holder/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in spell_list
if(!S)
@@ -620,7 +629,7 @@ var/list/admin_verbs_ticket = list(
set category = "Event"
set name = "Give Disease"
set desc = "Gives a Disease to a mob."
var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in diseases
var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in GLOB.diseases
if(!D) return
T.ForceContractDisease(new D)
feedback_add_details("admin_verb","GD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -694,7 +703,7 @@ var/list/admin_verbs_ticket = list(
set category = "Admin"
set desc = "Regain your admin powers."
var/datum/admins/D = admin_datums[ckey]
var/datum/admins/D = GLOB.admin_datums[ckey]
var/rank = null
if(config.admin_legacy_system)
//load text from file
@@ -707,26 +716,26 @@ var/list/admin_verbs_ticket = list(
break
continue
else
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
message_admins("Warning, MySQL database is not connected.")
to_chat(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]'")
var/DBQuery/query = GLOB.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(config.admin_legacy_system)
if(admin_ranks[rank] == null)
if(GLOB.admin_ranks[rank] == null)
error("Error while re-adminning [src], admin rank ([rank]) does not exist.")
to_chat(src, "Error while re-adminning, admin rank ([rank]) does not exist.")
return
D = new(rank, admin_ranks[rank], ckey)
D = new(rank, GLOB.admin_ranks[rank], ckey)
else
var/sql_ckey = sanitizeSQL(ckey)
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, rank, flags FROM [format_table_name("admin")] WHERE ckey = '[sql_ckey]'")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, rank, flags FROM [format_table_name("admin")] WHERE ckey = '[sql_ckey]'")
query.Execute()
while(query.NextRow())
var/admin_ckey = query.item[1]
@@ -791,7 +800,7 @@ var/list/admin_verbs_ticket = list(
if(!S) return
var/datum/nano_module/law_manager/L = new(S)
L.ui_interact(usr, state = admin_state)
L.ui_interact(usr, state = GLOB.admin_state)
log_and_message_admins("has opened [S]'s law manager.")
feedback_add_details("admin_verb","MSL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -817,7 +826,7 @@ var/list/admin_verbs_ticket = list(
return
if(holder)
admin_log_and_message_admins("is altering the appearance of [H].")
log_and_message_admins("is altering the appearance of [H].")
H.change_appearance(APPEARANCE_ALL, usr, usr, check_species_whitelist = 0)
feedback_add_details("admin_verb","CHAA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -848,10 +857,10 @@ var/list/admin_verbs_ticket = list(
switch(alert("Do you wish for [H] to be allowed to select non-whitelisted races?","Alter Mob Appearance","Yes","No","Cancel"))
if("Yes")
admin_log_and_message_admins("has allowed [H] to change [H.p_their()] appearance, without whitelisting of races.")
log_and_message_admins("has allowed [H] to change [H.p_their()] appearance, without whitelisting of races.")
H.change_appearance(APPEARANCE_ALL, H.loc, check_species_whitelist = 0)
if("No")
admin_log_and_message_admins("has allowed [H] to change [H.p_their()] appearance, with whitelisting of races.")
log_and_message_admins("has allowed [H] to change [H.p_their()] appearance, with whitelisting of races.")
H.change_appearance(APPEARANCE_ALL, H.loc, check_species_whitelist = 1)
feedback_add_details("admin_verb","CMAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+18 -18
View File
@@ -1,22 +1,22 @@
//ban people from using custom names and appearances. that'll show 'em.
var/appearanceban_runonce //Updates legacy bans with new info
var/appearance_keylist[0] //to store the keys
GLOBAL_VAR(appearanceban_runonce) //Updates legacy bans with new info
GLOBAL_LIST_EMPTY(appearance_keylist) //to store the keys
/proc/appearance_fullban(mob/M, reason)
if(!M || !M.key) return
appearance_keylist.Add(text("[M.ckey] ## [reason]"))
GLOB.appearance_keylist.Add(text("[M.ckey] ## [reason]"))
appearance_savebanfile()
/proc/appearance_client_fullban(ckey)
if(!ckey) return
appearance_keylist.Add(text("[ckey]"))
GLOB.appearance_keylist.Add(text("[ckey]"))
appearance_savebanfile()
//returns a reason if M is banned, returns 0 otherwise
/proc/appearance_isbanned(mob/M)
if(M)
for(var/s in appearance_keylist)
for(var/s in GLOB.appearance_keylist)
if(findtext(s, "[M.ckey]") == 1)
var/startpos = findtext(s, "## ") + 3
if(startpos && startpos < length(s))
@@ -43,12 +43,12 @@ DEBUG
/proc/appearance_loadbanfile()
if(config.ban_legacy_system)
var/savefile/S=new("data/appearance_full.ban")
S["keys[0]"] >> appearance_keylist
S["keys[0]"] >> GLOB.appearance_keylist
log_admin("Loading appearance_rank")
S["runonce"] >> appearanceban_runonce
S["runonce"] >> GLOB.appearanceban_runonce
if(!length(appearance_keylist))
appearance_keylist=list()
if(!length(GLOB.appearance_keylist))
GLOB.appearance_keylist=list()
log_admin("appearance_keylist was empty")
else
if(!establish_db_connection())
@@ -58,17 +58,17 @@ DEBUG
return
//appearance bans
var/DBQuery/query = dbcon.NewQuery("SELECT ckey FROM [format_table_name("ban")] WHERE bantype = 'APPEARANCE_BAN' AND NOT unbanned = 1")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("ban")] WHERE bantype = 'APPEARANCE_BAN' AND NOT unbanned = 1")
query.Execute()
while(query.NextRow())
var/ckey = query.item[1]
appearance_keylist.Add("[ckey]")
GLOB.appearance_keylist.Add("[ckey]")
/proc/appearance_savebanfile()
var/savefile/S=new("data/appearance_full.ban")
to_chat(S["keys[0]"], appearance_keylist)
to_chat(S["keys[0]"], GLOB.appearance_keylist)
/proc/appearance_unban(mob/M)
appearance_remove("[M.ckey]")
@@ -76,18 +76,18 @@ DEBUG
/proc/appearance_updatelegacybans()
if(!appearanceban_runonce)
if(!GLOB.appearanceban_runonce)
log_admin("Updating appearancefile!")
// Updates bans.. Or fixes them. Either way.
for(var/T in appearance_keylist)
for(var/T in GLOB.appearance_keylist)
if(!T) continue
appearanceban_runonce++ //don't run this update again
GLOB.appearanceban_runonce++ //don't run this update again
/proc/appearance_remove(X)
for(var/i = 1; i <= length(appearance_keylist); i++)
if( findtext(appearance_keylist[i], "[X]") )
appearance_keylist.Remove(appearance_keylist[i])
for(var/i = 1; i <= length(GLOB.appearance_keylist); i++)
if( findtext(GLOB.appearance_keylist[i], "[X]") )
GLOB.appearance_keylist.Remove(GLOB.appearance_keylist[i])
appearance_savebanfile()
return 1
return 0
+31 -35
View File
@@ -1,21 +1,21 @@
var/jobban_runonce // Updates legacy bans with new info
var/jobban_keylist[0] // Linear list of jobban strings, kept around for the legacy system
var/jobban_assoclist[0] // Associative list, for efficiency
GLOBAL_VAR(jobban_runonce) // Updates legacy bans with new info
GLOBAL_LIST_INIT(jobban_keylist, new()) // Linear list of jobban strings, kept around for the legacy system
GLOBAL_LIST_INIT(jobban_assoclist, new()) // Associative list, for efficiency
// Matches string-based jobbans into ckey, rank, and reason groups
var/regex/jobban_regex = regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## (.+))?")
GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## (.+))?"))
/proc/jobban_assoc_insert(ckey, rank, reason)
if(!ckey || !rank)
return
if(!jobban_assoclist[ckey])
jobban_assoclist[ckey] = list()
jobban_assoclist[ckey][rank] = reason || "Reason Unspecified"
if(!GLOB.jobban_assoclist[ckey])
GLOB.jobban_assoclist[ckey] = list()
GLOB.jobban_assoclist[ckey][rank] = reason || "Reason Unspecified"
/proc/jobban_fullban(mob/M, rank, reason)
if(!M || !M.key)
return
jobban_keylist.Add(text("[M.ckey] - [rank] ## [reason]"))
GLOB.jobban_keylist.Add(text("[M.ckey] - [rank] ## [reason]"))
jobban_assoc_insert(M.ckey, rank, reason)
if(config.ban_legacy_system)
jobban_savebanfile()
@@ -23,7 +23,7 @@ var/regex/jobban_regex = regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## (.+))?")
/proc/jobban_client_fullban(ckey, rank)
if(!ckey || !rank)
return
jobban_keylist.Add(text("[ckey] - [rank]"))
GLOB.jobban_keylist.Add(text("[ckey] - [rank]"))
jobban_assoc_insert(ckey, rank)
if(config.ban_legacy_system)
jobban_savebanfile()
@@ -37,8 +37,8 @@ var/regex/jobban_regex = regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## (.+))?")
if(IsGuestKey(M.key))
return "Guest Job-ban"
if(jobban_assoclist[M.ckey])
return jobban_assoclist[M.ckey][rank]
if(GLOB.jobban_assoclist[M.ckey])
return GLOB.jobban_assoclist[M.ckey][rank]
else
return 0
@@ -56,24 +56,20 @@ DEBUG
jobban_loadbanfile()
*/
/hook/startup/proc/loadJobBans()
jobban_loadbanfile()
return 1
/proc/jobban_loadbanfile()
if(config.ban_legacy_system)
var/savefile/S=new("data/job_full.ban")
S["keys[0]"] >> jobban_keylist
S["keys[0]"] >> GLOB.jobban_keylist
log_admin("Loading jobban_rank")
S["runonce"] >> jobban_runonce
S["runonce"] >> GLOB.jobban_runonce
if(!length(jobban_keylist))
jobban_keylist=list()
if(!length(GLOB.jobban_keylist))
GLOB.jobban_keylist=list()
log_admin("jobban_keylist was empty")
for(var/s in jobban_keylist)
if(jobban_regex.Find(s))
jobban_assoc_insert(jobban_regex.group[1], jobban_regex.group[2], jobban_regex.group[3])
for(var/s in GLOB.jobban_keylist)
if(GLOB.jobban_regex.Find(s))
jobban_assoc_insert(GLOB.jobban_regex.group[1], GLOB.jobban_regex.group[2], GLOB.jobban_regex.group[3])
else
log_runtime(EXCEPTION("Skipping malformed job ban: [s]"))
else
@@ -84,10 +80,10 @@ DEBUG
return
//Job permabans
var/DBQuery/permabans = dbcon.NewQuery("SELECT ckey, job FROM [format_table_name("ban")] WHERE bantype = 'JOB_PERMABAN' AND isnull(unbanned)")
var/DBQuery/permabans = GLOB.dbcon.NewQuery("SELECT ckey, job FROM [format_table_name("ban")] WHERE bantype = 'JOB_PERMABAN' AND isnull(unbanned)")
permabans.Execute()
// Job tempbans
var/DBQuery/tempbans = dbcon.NewQuery("SELECT ckey, job FROM [format_table_name("ban")] WHERE bantype = 'JOB_TEMPBAN' AND isnull(unbanned) AND expiration_time > Now()")
var/DBQuery/tempbans = GLOB.dbcon.NewQuery("SELECT ckey, job FROM [format_table_name("ban")] WHERE bantype = 'JOB_TEMPBAN' AND isnull(unbanned) AND expiration_time > Now()")
tempbans.Execute()
while(TRUE)
@@ -102,12 +98,12 @@ DEBUG
else
break
jobban_keylist.Add("[ckey] - [job]")
GLOB.jobban_keylist.Add("[ckey] - [job]")
jobban_assoc_insert(ckey, job)
/proc/jobban_savebanfile()
var/savefile/S=new("data/job_full.ban")
S["keys[0]"] << jobban_keylist
S["keys[0]"] << GLOB.jobban_keylist
/proc/jobban_unban(mob/M, rank)
jobban_remove("[M.ckey] - [rank]")
@@ -120,19 +116,19 @@ DEBUG
/proc/jobban_remove(X)
for(var/i = 1; i <= length(jobban_keylist); i++)
if( findtext(jobban_keylist[i], "[X]") )
for(var/i = 1; i <= length(GLOB.jobban_keylist); i++)
if( findtext(GLOB.jobban_keylist[i], "[X]") )
// This need to be here, instead of jobban_unban, due to direct calls to jobban_remove
if(jobban_regex.Find(X))
var/ckey = jobban_regex.group[1]
var/rank = jobban_regex.group[2]
if(jobban_assoclist[ckey] && jobban_assoclist[ckey][rank])
jobban_assoclist[ckey] -= rank
if(GLOB.jobban_regex.Find(X))
var/ckey = GLOB.jobban_regex.group[1]
var/rank = GLOB.jobban_regex.group[2]
if(GLOB.jobban_assoclist[ckey] && GLOB.jobban_assoclist[ckey][rank])
GLOB.jobban_assoclist[ckey] -= rank
else
log_runtime(EXCEPTION("Attempted to remove non-existent job ban: [X]"))
else
log_runtime(EXCEPTION("Failed to remove malformed job ban from associative list: [X]"))
jobban_keylist.Remove(jobban_keylist[i])
GLOB.jobban_keylist.Remove(GLOB.jobban_keylist[i])
if(config.ban_legacy_system)
jobban_savebanfile()
return 1
@@ -152,7 +148,7 @@ DEBUG
else
//using the SQL ban system
var/is_actually_banned = FALSE
var/DBQuery/select_query = dbcon.NewQuery("SELECT bantime, bantype, reason, job, duration, expiration_time, a_ckey FROM [format_table_name("ban")] WHERE ckey like '[ckey]' AND ((bantype like 'JOB_TEMPBAN' AND expiration_time > Now()) OR (bantype like 'JOB_PERMABAN')) AND isnull(unbanned) ORDER BY bantime DESC LIMIT 100")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT bantime, bantype, reason, job, duration, expiration_time, a_ckey FROM [format_table_name("ban")] WHERE ckey like '[ckey]' AND ((bantype like 'JOB_TEMPBAN' AND expiration_time > Now()) OR (bantype like 'JOB_PERMABAN')) AND isnull(unbanned) ORDER BY bantime DESC LIMIT 100")
select_query.Execute()
while(select_query.NextRow())
+5 -5
View File
@@ -1,9 +1,9 @@
/var/create_mob_html = null
GLOBAL_VAR(create_mob_html)
/datum/admins/proc/create_mob(var/mob/user)
if(!create_mob_html)
if(!GLOB.create_mob_html)
var/mobjs = null
mobjs = jointext(typesof(/mob), ";")
create_mob_html = file2text('html/create_object.html')
create_mob_html = replacetext(create_mob_html, "null /* object types */", "\"[mobjs]\"")
GLOB.create_mob_html = file2text('html/create_object.html')
GLOB.create_mob_html = replacetext(GLOB.create_mob_html, "null /* object types */", "\"[mobjs]\"")
user << browse(replacetext(create_mob_html, "/* ref src */", UID()), "window=create_mob;size=425x475")
user << browse(replacetext(GLOB.create_mob_html, "/* ref src */", UID()), "window=create_mob;size=425x475")
+9 -9
View File
@@ -1,23 +1,23 @@
var/create_object_html = null
var/list/create_object_forms = list(/obj, /obj/structure, /obj/machinery, /obj/effect, /obj/item, /obj/mecha, /obj/item/clothing, /obj/item/stack, /obj/item/reagent_containers, /obj/item/gun)
GLOBAL_VAR(create_object_html)
GLOBAL_LIST_INIT(create_object_forms, list(/obj, /obj/structure, /obj/machinery, /obj/effect, /obj/item, /obj/mecha, /obj/item/clothing, /obj/item/stack, /obj/item/reagent_containers, /obj/item/gun))
/datum/admins/proc/create_object(var/mob/user)
if(!create_object_html)
if(!GLOB.create_object_html)
var/objectjs = null
objectjs = jointext(typesof(/obj), ";")
create_object_html = file2text('html/create_object.html')
create_object_html = replacetext(create_object_html, "null /* object types */", "\"[objectjs]\"")
GLOB.create_object_html = file2text('html/create_object.html')
GLOB.create_object_html = replacetext(GLOB.create_object_html, "null /* object types */", "\"[objectjs]\"")
user << browse(replacetext(create_object_html, "/* ref src */", UID()), "window=create_object;size=425x475")
user << browse(replacetext(GLOB.create_object_html, "/* ref src */", UID()), "window=create_object;size=425x475")
/datum/admins/proc/quick_create_object(var/mob/user)
var/path = input("Select the path of the object you wish to create.", "Path", /obj) in create_object_forms
var/html_form = create_object_forms[path]
var/path = input("Select the path of the object you wish to create.", "Path", /obj) in GLOB.create_object_forms
var/html_form = GLOB.create_object_forms[path]
if(!html_form)
var/objectjs = jointext(typesof(path), ";")
html_form = file2text('html/create_object.html')
html_form = replacetext(html_form, "null /* object types */", "\"[objectjs]\"")
create_object_forms[path] = html_form
GLOB.create_object_forms[path] = html_form
user << browse(replacetext(html_form, "/* ref src */", UID()), "window=qco[path];size=425x475")
+12 -12
View File
@@ -1,15 +1,15 @@
/client/proc/create_poll()
set name = "Create Server Poll"
set category = "Server"
if(!check_rights(R_SERVER))
if(!check_rights(R_SERVER))
return
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
return
create_poll_window()
/client/proc/create_poll_window(var/errormessage = "")
if(!check_rights(R_SERVER))
if(!check_rights(R_SERVER))
return
var/output={"<!DOCTYPE html>
<html>
@@ -75,7 +75,7 @@ function onload() {
<form name='createpoll' action='byond://' method='post' style='padding-left:30px;padding-right:30px;padding-top:10px'>
<input type='hidden' name='createpollnumoptions' id='createpollnumoptions' value='0'>
<table><tr><td style='width:50%' style="vertical-align:top"><div id='polloptions'><div id='polloptionsinner'>
</div>
<input type='button' onclick='add_option()' value="Add Option"></input>
<input type='button' onclick='del_option()' value="Delete Option"></input>
@@ -99,7 +99,7 @@ function onload() {
src << browse(output, "window=createplayerpoll;size=950x500")
/client/proc/create_poll_function(href_list)
if(!check_rights(R_SERVER))
if(!check_rights(R_SERVER))
return
var/polltype = href_list["createpoll"]
if(polltype != POLLTYPE_OPTION && polltype != POLLTYPE_TEXT && polltype != POLLTYPE_RATING && polltype != POLLTYPE_MULTI)
@@ -122,15 +122,15 @@ function onload() {
create_poll_window("<font color='red'>Question cannot be blank.</font>")
return
question = sanitizeSQL(question)
var/starttime
var/endtime
var/DBQuery/query = dbcon.NewQuery("SELECT Now() AS starttime, ADDDATE(Now(), INTERVAL [poll_len] DAY) AS endtime")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT Now() AS starttime, ADDDATE(Now(), INTERVAL [poll_len] DAY) AS endtime")
query.Execute()
while(query.NextRow())
starttime = query.item[1]
endtime = query.item[2]
var/pollquery = "INSERT INTO [format_table_name("poll_question")] (polltype, starttime, endtime, question, adminonly, multiplechoiceoptions, createdby_ckey, createdby_ip) VALUES ('[polltype]', '[starttime]', '[endtime]', '[question]', '[adminonly]', '[choice_amount]', '[sql_ckey]', '[address]')"
var/idquery = "SELECT id FROM [format_table_name("poll_question")] WHERE question = '[question]' AND starttime = '[starttime]' AND endtime = '[endtime]' AND createdby_ckey = '[sql_ckey]' AND createdby_ip = '[address]'"
var/list/option_queries = list()
@@ -175,15 +175,15 @@ function onload() {
if(descmax)
descmax = sanitizeSQL(descmax)
option_queries += "INSERT INTO [format_table_name("poll_option")] (pollid, text, percentagecalc, minval, maxval, descmin, descmid, descmax) VALUES ('{POLLID}', '[option]', '[percentagecalc]', '[minval]', '[maxval]', '[descmin]', '[descmid]', '[descmax]')"
query = dbcon.NewQuery(pollquery)
query = GLOB.dbcon.NewQuery(pollquery)
if(!query.Execute())
var/err = query.ErrorMsg()
create_poll_window("<font color='red'>An SQL error has occured while creating your poll</font>")
log_game("SQL ERROR adding new poll question to table. Error : \[[err]\]\n")
return
var/pollid = 0
query = dbcon.NewQuery(idquery)
query = GLOB.dbcon.NewQuery(idquery)
if(!query.Execute())
var/err = query.ErrorMsg()
create_poll_window("<font color='red'>An SQL error has occured while creating your poll</font>")
@@ -192,7 +192,7 @@ function onload() {
if(query.NextRow())
pollid = text2num(query.item[1])
for(var/querytext in option_queries)
query = dbcon.NewQuery(replacetext(idquery, "{POLLID}", pollid))
query = GLOB.dbcon.NewQuery(replacetext(idquery, "{POLLID}", pollid))
if(!query.Execute())
var/err = query.ErrorMsg()
create_poll_window("<font color='red'>An SQL error has occured while creating your poll</font>")
+5 -5
View File
@@ -1,9 +1,9 @@
/var/create_turf_html = null
GLOBAL_VAR(create_turf_html)
/datum/admins/proc/create_turf(var/mob/user)
if(!create_turf_html)
if(!GLOB.create_turf_html)
var/turfjs = null
turfjs = jointext(typesof(/turf), ";")
create_turf_html = file2text('html/create_object.html')
create_turf_html = replacetext(create_turf_html, "null /* object types */", "\"[turfjs]\"")
GLOB.create_turf_html = file2text('html/create_object.html')
GLOB.create_turf_html = replacetext(GLOB.create_turf_html, "null /* object types */", "\"[turfjs]\"")
user << browse(replacetext(create_turf_html, "/* ref src */", UID()), "window=create_turf;size=425x475")
user << browse(replacetext(GLOB.create_turf_html, "/* ref src */", UID()), "window=create_turf;size=425x475")
+29 -3
View File
@@ -1,4 +1,5 @@
var/list/admin_datums = list()
GLOBAL_LIST_EMPTY(admin_datums)
GLOBAL_PROTECT(admin_datums) // This is protected because we dont want people making their own admin ranks, for obvious reasons
/datum/admins
var/rank = "Temporary Admin"
@@ -15,6 +16,11 @@ var/list/admin_datums = list()
var/admincaster_signature //What you'll sign the newsfeeds as
/datum/admins/New(initial_rank = "Temporary Admin", initial_rights = 0, ckey)
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Admin rank creation blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to create a new admin rank via advanced proc-call")
log_admin("[key_name(usr)] attempted to edit feedback a new admin rank via advanced proc-call")
return
if(!ckey)
error("Admin datum created without a ckey argument. Datum has been deleted")
qdel(src)
@@ -22,13 +28,23 @@ var/list/admin_datums = list()
admincaster_signature = "Nanotrasen Officer #[rand(0,9)][rand(0,9)][rand(0,9)]"
rank = initial_rank
rights = initial_rights
admin_datums[ckey] = src
GLOB.admin_datums[ckey] = src
/datum/admins/Destroy()
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Admin rank deletion blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to delete an admin rank via advanced proc-call")
log_admin("[key_name(usr)] attempted to delete an admin rank via advanced proc-call")
return
..()
return QDEL_HINT_HARDDEL_NOW
/datum/admins/proc/associate(client/C)
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Rank association blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to associate an admin rank to a new client via advanced proc-call")
log_admin("[key_name(usr)] attempted to associate an admin rank to a new client via advanced proc-call")
return
if(istype(C))
owner = C
owner.holder = src
@@ -38,6 +54,11 @@ var/list/admin_datums = list()
GLOB.admins |= C
/datum/admins/proc/disassociate()
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Rank disassociation blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to disassociate an admin rank from a client via advanced proc-call")
log_admin("[key_name(usr)] attempted to disassociate an admin rank from a client via advanced proc-call")
return
if(owner)
GLOB.admins -= owner
owner.remove_admin_verbs()
@@ -87,7 +108,12 @@ you will have to do something like if(client.holder.rights & R_ADMIN) yourself.
return 0
/client/proc/deadmin()
admin_datums -= ckey
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Deadmin blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to de-admin a client via advanced proc-call")
log_admin("[key_name(usr)] attempted to de-admin a client via advanced proc-call")
return
GLOB.admin_datums -= ckey
if(holder)
holder.disassociate()
qdel(holder)
+9 -9
View File
@@ -34,9 +34,9 @@
cachedintel.cache = TRUE
return cachedintel
if(dbcon.IsConnected())
if(GLOB.dbcon.IsConnected())
var/rating_bad = config.ipintel_rating_bad
var/DBQuery/query_get_ip_intel = dbcon.NewQuery({"
var/DBQuery/query_get_ip_intel = GLOB.dbcon.NewQuery({"
SELECT date, intel, TIMESTAMPDIFF(MINUTE,date,NOW())
FROM [format_table_name("ipintel")]
WHERE
@@ -67,8 +67,8 @@
res.intel = ip_intel_query(ip)
if(updatecache && res.intel >= 0)
SSipintel.cache[ip] = res
if(dbcon.IsConnected())
var/DBQuery/query_add_ip_intel = dbcon.NewQuery("INSERT INTO [format_table_name("ipintel")] (ip, intel) VALUES (INET_ATON('[ip]'), [res.intel]) ON DUPLICATE KEY UPDATE intel = VALUES(intel), date = NOW()")
if(GLOB.dbcon.IsConnected())
var/DBQuery/query_add_ip_intel = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("ipintel")] (ip, intel) VALUES (INET_ATON('[ip]'), [res.intel]) ON DUPLICATE KEY UPDATE intel = VALUES(intel), date = NOW()")
query_add_ip_intel.Execute()
qdel(query_add_ip_intel)
@@ -139,7 +139,7 @@
return FALSE
if(!config.ipintel_whitelist)
return FALSE
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
return FALSE
if(!ipintel_badip_check(t_ip))
return FALSE
@@ -160,7 +160,7 @@
rating_bad = sanitizeSQL(rating_bad)
valid_hours = sanitizeSQL(valid_hours)
var/check_sql = {"SELECT * FROM [format_table_name("ipintel")] WHERE ip = INET_ATON('[target_ip]') AND intel >= [rating_bad] AND (date + INTERVAL [valid_hours] HOUR) > NOW()"}
var/DBQuery/query_get_ip_intel = dbcon.NewQuery(check_sql)
var/DBQuery/query_get_ip_intel = GLOB.dbcon.NewQuery(check_sql)
if(!query_get_ip_intel.Execute())
log_debug("ipintel_badip_check reports failed query execution")
qdel(query_get_ip_intel)
@@ -175,7 +175,7 @@
if(!config.ipintel_whitelist)
return FALSE
var/target_sql_ckey = ckey(target_ckey)
var/DBQuery/query_whitelist_check = dbcon.NewQuery("SELECT * FROM [format_table_name("vpn_whitelist")] WHERE ckey = '[target_sql_ckey]'")
var/DBQuery/query_whitelist_check = GLOB.dbcon.NewQuery("SELECT * FROM [format_table_name("vpn_whitelist")] WHERE ckey = '[target_sql_ckey]'")
if(!query_whitelist_check.Execute())
var/err = query_whitelist_check.ErrorMsg()
log_debug("SQL ERROR on proc/vpn_whitelist_check for ckey '[target_sql_ckey]'. Error : \[[err]\]\n")
@@ -190,7 +190,7 @@
if(!reason_string)
return FALSE
reason_string = sanitizeSQL(reason_string)
var/DBQuery/query_whitelist_add = dbcon.NewQuery("INSERT INTO [format_table_name("vpn_whitelist")] (ckey,reason) VALUES ('[target_sql_ckey]','[reason_string]')")
var/DBQuery/query_whitelist_add = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("vpn_whitelist")] (ckey,reason) VALUES ('[target_sql_ckey]','[reason_string]')")
if(!query_whitelist_add.Execute())
var/err = query_whitelist_add.ErrorMsg()
log_debug("SQL ERROR on proc/vpn_whitelist_add for ckey '[target_sql_ckey]'. Error : \[[err]\]\n")
@@ -199,7 +199,7 @@
/proc/vpn_whitelist_remove(target_ckey)
var/target_sql_ckey = ckey(target_ckey)
var/DBQuery/query_whitelist_remove = dbcon.NewQuery("DELETE FROM [format_table_name("vpn_whitelist")] WHERE ckey = '[target_sql_ckey]'")
var/DBQuery/query_whitelist_remove = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("vpn_whitelist")] WHERE ckey = '[target_sql_ckey]'")
if(!query_whitelist_remove.Execute())
var/err = query_whitelist_remove.ErrorMsg()
log_debug("SQL ERROR on proc/vpn_whitelist_remove for ckey '[target_sql_ckey]'. Error : \[[err]\]\n")
@@ -25,8 +25,8 @@
</tr>
"}
for(var/adm_ckey in admin_datums)
var/datum/admins/D = admin_datums[adm_ckey]
for(var/adm_ckey in GLOB.admin_datums)
var/datum/admins/D = GLOB.admin_datums[adm_ckey]
if(!D) continue
var/rank = D.rank ? D.rank : "*none*"
var/rights = rights2text(D.rights," ")
@@ -62,7 +62,7 @@
establish_db_connection()
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
to_chat(usr, "<span class='warning'>Failed to establish database connection</span>")
return
@@ -77,7 +77,7 @@
if(!istext(adm_ckey) || !istext(new_rank))
return
var/DBQuery/select_query = dbcon.NewQuery("SELECT id FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'")
select_query.Execute()
var/new_admin = 1
@@ -88,20 +88,25 @@
flag_account_for_forum_sync(adm_ckey)
if(new_admin)
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO [format_table_name("admin")] (`id`, `ckey`, `rank`, `level`, `flags`) VALUES (null, '[adm_ckey]', '[new_rank]', -1, 0)")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("admin")] (`id`, `ckey`, `rank`, `level`, `flags`) VALUES (null, '[adm_ckey]', '[new_rank]', -1, 0)")
insert_query.Execute()
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Added new admin [adm_ckey] to rank [new_rank]');")
var/DBQuery/log_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Added new admin [adm_ckey] to rank [new_rank]');")
log_query.Execute()
to_chat(usr, "<span class='notice'>New admin added.</span>")
else
if(!isnull(admin_id) && isnum(admin_id))
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE [format_table_name("admin")] SET rank = '[new_rank]' WHERE id = [admin_id]")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("admin")] SET rank = '[new_rank]' WHERE id = [admin_id]")
insert_query.Execute()
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Edited the rank of [adm_ckey] to [new_rank]');")
var/DBQuery/log_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Edited the rank of [adm_ckey] to [new_rank]');")
log_query.Execute()
to_chat(usr, "<span class='notice'>Admin rank changed.</span>")
/datum/admins/proc/log_admin_permission_modification(var/adm_ckey, var/new_permission)
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Admin edit blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to edit admin ranks via advanced proc-call")
log_admin("[key_name(usr)] attempted to edit admin ranks via advanced proc-call")
return
if(config.admin_legacy_system)
return
@@ -112,7 +117,7 @@
return
establish_db_connection()
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
to_chat(usr, "<span class='warning'>Failed to establish database connection</span>")
return
@@ -130,7 +135,7 @@
if(!istext(adm_ckey) || !isnum(new_permission))
return
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, flags FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT id, flags FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'")
select_query.Execute()
var/admin_id
@@ -144,27 +149,27 @@
flag_account_for_forum_sync(adm_ckey)
if(admin_rights & new_permission) //This admin already has this permission, so we are removing it.
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE [format_table_name("admin")] SET flags = [admin_rights & ~new_permission] WHERE id = [admin_id]")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("admin")] SET flags = [admin_rights & ~new_permission] WHERE id = [admin_id]")
insert_query.Execute()
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Removed permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]');")
var/DBQuery/log_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Removed permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]');")
log_query.Execute()
to_chat(usr, "<span class='notice'>Permission removed.</span>")
else //This admin doesn't have this permission, so we are adding it.
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE [format_table_name("admin")] SET flags = '[admin_rights | new_permission]' WHERE id = [admin_id]")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("admin")] SET flags = '[admin_rights | new_permission]' WHERE id = [admin_id]")
insert_query.Execute()
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Added permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]')")
var/DBQuery/log_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Added permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]')")
log_query.Execute()
to_chat(usr, "<span class='notice'>Permission added.</span>")
/datum/admins/proc/updateranktodb(ckey,newrank)
establish_db_connection()
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
return
if(!check_rights(R_PERMISSIONS))
return
var/sql_ckey = sanitizeSQL(ckey)
var/sql_admin_rank = sanitizeSQL(newrank)
var/DBQuery/query_update = dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastadminrank = '[sql_admin_rank]' WHERE ckey = '[sql_ckey]'")
var/DBQuery/query_update = GLOB.dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastadminrank = '[sql_admin_rank]' WHERE ckey = '[sql_ckey]'")
query_update.Execute()
flag_account_for_forum_sync(sql_ckey)
+30 -12
View File
@@ -2,6 +2,10 @@
/datum/admins/proc/player_panel_new()//The new one
if(!usr.client.holder)
return
// This stops the panel from being invoked by mentors who press F7.
if(!check_rights(R_ADMIN))
message_admins("[key_name_admin(usr)] attempted to invoke player panel without admin rights. If this is a mentor, its a chance they accidentally hit F7. If this is NOT a mentor, there is a high chance an exploit is being used")
return
var/dat = "<html><head><title>Admin Player Panel</title></head>"
//javascript, the part that does most of the work~
@@ -264,7 +268,7 @@
else
M_job = "Living"
else if(istype(M,/mob/new_player))
else if(isnewplayer(M))
M_job = "New player"
else if(isobserver(M))
@@ -352,7 +356,7 @@
dat += "<td>[M.real_name]</td>"
else if(istype(M, /mob/living/silicon/pai))
dat += "<td>pAI</td>"
else if(istype(M, /mob/new_player))
else if(isnewplayer(M))
dat += "<td>New Player</td>"
else if(isobserver(M))
dat += "<td>Ghost</td>"
@@ -392,14 +396,16 @@
var/logout_status
logout_status = M.client ? "" : " <i>(logged out)</i>"
var/dname = M.real_name
var/area/A = get_area(M)
if(!dname)
dname = M
return {"<tr><td><a href='?src=[UID()];adminplayeropts=[M.UID()]'>[dname]</a><b>[caption]</b>[logout_status][M.stat == 2 ? " <b><font color=red>(DEAD)</font></b>" : ""]</td>
<td><A href='?src=[usr.UID()];priv_msg=[M.client ? M.client.UID() : null]'>PM</A></td>[close ? "</tr>" : ""]"}
return {"<tr><td><a href='?src=[UID()];adminplayeropts=[M.UID()]'>[dname]</a><b>[caption]</b>[logout_status][istype(A, /area/security/permabrig) ? "<b><font color=red> (PERMA) </b></font>" : ""][M.stat == 2 ? " <b><font color=red>(DEAD)</font></b>" : ""]</td>
<td><A href='?src=[usr.UID()];priv_msg=[M.client ? M.client.UID() : null]'>PM</A> [ADMIN_FLW(M, "FLW")] </td>[close ? "</tr>" : ""]"}
/datum/admins/proc/check_antagonists()
if(!check_rights(R_ADMIN)) return
if(!check_rights(R_ADMIN))
return
if(SSticker && SSticker.current_state >= GAME_STATE_PLAYING)
var/dat = "<html><head><title>Round Status</title></head><body><h1><B>Round Status</B></h1>"
dat += "Current Game Mode: <B>[SSticker.mode.name]</B><BR>"
@@ -465,7 +471,7 @@
if(GAMEMODE_IS_BLOB)
var/datum/game_mode/blob/mode = SSticker.mode
dat += "<br><table cellspacing=5><tr><td><B>Blob</B></td><td></td><td></td></tr>"
dat += "<tr><td><i>Progress: [blobs.len]/[mode.blobwincount]</i></td></tr>"
dat += "<tr><td><i>Progress: [GLOB.blobs.len]/[mode.blobwincount]</i></td></tr>"
for(var/datum/mind/blob in mode.infected_crew)
var/mob/M = blob.current
@@ -475,7 +481,7 @@
else
dat += "<tr><td><i>Blob not found!</i></td></tr>"
dat += "</table>"
if(SSticker.mode.blob_overminds.len)
dat += check_role_table("Blob Overminds", SSticker.mode.blob_overminds)
@@ -485,6 +491,9 @@
if(SSticker.mode.wizards.len)
dat += check_role_table("Wizards", SSticker.mode.wizards)
if(SSticker.mode.apprentices.len)
dat += check_role_table("Apprentices", SSticker.mode.apprentices)
if(SSticker.mode.raiders.len)
dat += check_role_table("Raiders", SSticker.mode.raiders)
@@ -492,7 +501,7 @@
dat += check_role_table("Ninjas", ticker.mode.ninjas)*/
if(SSticker.mode.cult.len)
dat += check_role_table("Cultists", SSticker.mode.cult, 0)
dat += check_role_table("Cultists", SSticker.mode.cult)
dat += "<br> use <a href='?src=[UID()];cult_mindspeak=[UID()]'>Cult Mindspeak</a>"
if(GAMEMODE_IS_CULT)
var/datum/game_mode/cult/cult_round = SSticker.mode
@@ -541,9 +550,9 @@
if(SSticker.mode.eventmiscs.len)
dat += check_role_table("Event Roles", SSticker.mode.eventmiscs)
if(ts_spiderlist.len)
if(GLOB.ts_spiderlist.len)
var/list/spider_minds = list()
for(var/mob/living/simple_animal/hostile/poison/terror_spider/S in ts_spiderlist)
for(var/mob/living/simple_animal/hostile/poison/terror_spider/S in GLOB.ts_spiderlist)
if(S.ckey)
spider_minds += S.mind
if(spider_minds.len)
@@ -551,10 +560,10 @@
var/count_eggs = 0
var/count_spiderlings = 0
for(var/obj/structure/spider/eggcluster/terror_eggcluster/E in ts_egg_list)
for(var/obj/structure/spider/eggcluster/terror_eggcluster/E in GLOB.ts_egg_list)
if(is_station_level(E.z))
count_eggs += E.spiderling_number
for(var/obj/structure/spider/spiderling/terror_spiderling/L in ts_spiderling_list)
for(var/obj/structure/spider/spiderling/terror_spiderling/L in GLOB.ts_spiderling_list)
if(!L.stillborn && is_station_level(L.z))
count_spiderlings += 1
dat += "<table cellspacing=5><TR><TD>Growing TS on-station: [count_eggs] egg[count_eggs != 1 ? "s" : ""], [count_spiderlings] spiderling[count_spiderlings != 1 ? "s" : ""]. </TD></TR></TABLE>"
@@ -562,6 +571,15 @@
if(SSticker.mode.ert.len)
dat += check_role_table("ERT", SSticker.mode.ert)
//list active security force count, so admins know how bad things are
var/list/sec_list = check_active_security_force()
dat += "<br><table cellspacing=5><tr><td><b>Security</b></td><td></td></tr>"
dat += "<tr><td>Total: </td><td>[sec_list[1]]</td>"
dat += "<tr><td>Active: </td><td>[sec_list[2]]</td>"
dat += "<tr><td>Dead: </td><td>[sec_list[3]]</td>"
dat += "<tr><td>Antag: </td><td>[sec_list[4]]</td>"
dat += "</table>"
dat += "</body></html>"
usr << browse(dat, "window=roundstatus;size=400x500")
else
+3 -3
View File
@@ -27,8 +27,8 @@
<B>Bombs</b><br>
[check_rights(R_SERVER, 0) ? "&nbsp;&nbsp;<A href='?src=[UID()];secretsfun=togglebombcap'>Toggle bomb cap</A><br>" : "<br>"]
<B>Lists</b><br>
<A href='?src=[UID()];secretsadmin=list_signalers'>Show last [length(lastsignalers)] signalers</A>&nbsp;&nbsp;
<A href='?src=[UID()];secretsadmin=list_lawchanges'>Show last [length(lawchanges)] law changes</A><BR>
<A href='?src=[UID()];secretsadmin=list_signalers'>Show last [length(GLOB.lastsignalers)] signalers</A>&nbsp;&nbsp;
<A href='?src=[UID()];secretsadmin=list_lawchanges'>Show last [length(GLOB.lawchanges)] law changes</A><BR>
<A href='?src=[UID()];secretsadmin=DNA'>List DNA (Blood)</A>&nbsp;&nbsp;
<A href='?src=[UID()];secretsadmin=fingerprints'>List Fingerprints</A><BR>
<B>Power</b><br>
@@ -105,7 +105,7 @@
<A href='?src=[UID()];secretsfun=monkey'>Turn all humans into monkeys</A><BR>
<A href='?src=[UID()];secretsfun=fakeguns'>Make all items look like guns</A><BR>
<A href='?src=[UID()];secretsfun=prisonwarp'>Warp all Players to Prison</A><BR>
<A href='?src=[UID()];secretsfun=retardify'>Make all players retarded</A><BR>
<A href='?src=[UID()];secretsfun=stupify'>Make all players stupid</A><BR>
<b>Misc</b><br>
<A href='?src=[UID()];secretsfun=sec_classic1'>Remove firesuits, grilles, and pods</A>&nbsp;&nbsp;
<A href='?src=[UID()];secretsfun=tripleAI'>Triple AI mode (needs to be used in the lobby)</A><BR>
+16 -12
View File
@@ -1,7 +1,7 @@
/proc/add_note(target_ckey, notetext, timestamp, adminckey, logged = 1, server, checkrights = 1)
if(checkrights && !check_rights(R_ADMIN|R_MOD))
return
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
return
@@ -13,7 +13,7 @@
else
target_ckey = ckey(target_ckey)
var/DBQuery/query_find_ckey = dbcon.NewQuery("SELECT ckey, exp FROM [format_table_name("player")] WHERE ckey = '[target_ckey]'")
var/DBQuery/query_find_ckey = GLOB.dbcon.NewQuery("SELECT ckey, exp FROM [format_table_name("player")] WHERE ckey = '[target_ckey]'")
if(!query_find_ckey.Execute())
var/err = query_find_ckey.ErrorMsg()
log_game("SQL ERROR obtaining ckey from player table. Error : \[[err]\]\n")
@@ -46,7 +46,7 @@
if(config && config.server_name)
server = config.server_name
server = sanitizeSQL(server)
var/DBQuery/query_noteadd = dbcon.NewQuery("INSERT INTO [format_table_name("notes")] (ckey, timestamp, notetext, adminckey, server, crew_playtime) VALUES ('[target_ckey]', '[timestamp]', '[notetext]', '[admin_sql_ckey]', '[server]', '[crew_number]')")
var/DBQuery/query_noteadd = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("notes")] (ckey, timestamp, notetext, adminckey, server, crew_playtime) VALUES ('[target_ckey]', '[timestamp]', '[notetext]', '[admin_sql_ckey]', '[server]', '[crew_number]')")
if(!query_noteadd.Execute())
var/err = query_noteadd.ErrorMsg()
log_game("SQL ERROR adding new note to table. Error : \[[err]\]\n")
@@ -62,13 +62,13 @@
var/ckey
var/notetext
var/adminckey
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
return
if(!note_id)
return
note_id = text2num(note_id)
var/DBQuery/query_find_note_del = dbcon.NewQuery("SELECT ckey, notetext, adminckey FROM [format_table_name("notes")] WHERE id = [note_id]")
var/DBQuery/query_find_note_del = GLOB.dbcon.NewQuery("SELECT ckey, notetext, adminckey FROM [format_table_name("notes")] WHERE id = [note_id]")
if(!query_find_note_del.Execute())
var/err = query_find_note_del.ErrorMsg()
log_game("SQL ERROR obtaining ckey, notetext, adminckey from player table. Error : \[[err]\]\n")
@@ -77,7 +77,7 @@
ckey = query_find_note_del.item[1]
notetext = query_find_note_del.item[2]
adminckey = query_find_note_del.item[3]
var/DBQuery/query_del_note = dbcon.NewQuery("DELETE FROM [format_table_name("notes")] WHERE id = [note_id]")
var/DBQuery/query_del_note = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("notes")] WHERE id = [note_id]")
if(!query_del_note.Execute())
var/err = query_del_note.ErrorMsg()
log_game("SQL ERROR removing note from table. Error : \[[err]\]\n")
@@ -89,7 +89,7 @@
/proc/edit_note(note_id)
if(!check_rights(R_ADMIN|R_MOD))
return
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
return
if(!note_id)
@@ -97,7 +97,7 @@
note_id = text2num(note_id)
var/target_ckey
var/sql_ckey = usr.ckey
var/DBQuery/query_find_note_edit = dbcon.NewQuery("SELECT ckey, notetext, adminckey FROM [format_table_name("notes")] WHERE id = [note_id]")
var/DBQuery/query_find_note_edit = GLOB.dbcon.NewQuery("SELECT ckey, notetext, adminckey FROM [format_table_name("notes")] WHERE id = [note_id]")
if(!query_find_note_edit.Execute())
var/err = query_find_note_edit.ErrorMsg()
log_game("SQL ERROR obtaining notetext from notes table. Error : \[[err]\]\n")
@@ -112,7 +112,7 @@
new_note = sanitizeSQL(new_note)
var/edit_text = "Edited by [sql_ckey] on [SQLtime()] from \"[old_note]\" to \"[new_note]\"<hr>"
edit_text = sanitizeSQL(edit_text)
var/DBQuery/query_update_note = dbcon.NewQuery("UPDATE [format_table_name("notes")] SET notetext = '[new_note]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE id = [note_id]")
var/DBQuery/query_update_note = GLOB.dbcon.NewQuery("UPDATE [format_table_name("notes")] SET notetext = '[new_note]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE id = [note_id]")
if(!query_update_note.Execute())
var/err = query_update_note.ErrorMsg()
log_game("SQL ERROR editing note. Error : \[[err]\]\n")
@@ -139,7 +139,7 @@
output = navbar
if(target_ckey)
var/target_sql_ckey = ckey(target_ckey)
var/DBQuery/query_get_notes = dbcon.NewQuery("SELECT id, timestamp, notetext, adminckey, last_editor, server, crew_playtime FROM [format_table_name("notes")] WHERE ckey = '[target_sql_ckey]' ORDER BY timestamp")
var/DBQuery/query_get_notes = GLOB.dbcon.NewQuery("SELECT id, timestamp, notetext, adminckey, last_editor, server, crew_playtime FROM [format_table_name("notes")] WHERE ckey = '[target_sql_ckey]' ORDER BY timestamp")
if(!query_get_notes.Execute())
var/err = query_get_notes.ErrorMsg()
log_game("SQL ERROR obtaining ckey, notetext, adminckey, last_editor, server, crew_playtime from notes table. Error : \[[err]\]\n")
@@ -181,14 +181,18 @@
search = "^\[^\[:alpha:\]\]"
else
search = "^[index]"
var/DBQuery/query_list_notes = dbcon.NewQuery("SELECT DISTINCT ckey FROM [format_table_name("notes")] WHERE ckey REGEXP '[search]' ORDER BY ckey")
var/DBQuery/query_list_notes = GLOB.dbcon.NewQuery("SELECT DISTINCT ckey FROM [format_table_name("notes")] WHERE ckey REGEXP '[search]' ORDER BY ckey")
if(!query_list_notes.Execute())
var/err = query_list_notes.ErrorMsg()
log_game("SQL ERROR obtaining ckey from notes table. Error : \[[err]\]\n")
return
to_chat(usr, "<span class='notice'>Started regex note search for [search]. Please wait for results...</span>")
message_admins("[usr.ckey] has started a note search with the following regex: [search] | CPU usage may be higher.")
while(query_list_notes.NextRow())
index_ckey = query_list_notes.item[1]
output += "<a href='?_src_=holder;shownoteckey=[index_ckey]'>[index_ckey]</a><br>"
CHECK_TICK
message_admins("The note search started by [usr.ckey] has complete. CPU should return to normal.")
else
output += "<center><a href='?_src_=holder;addnoteempty=1'>\[Add Note\]</a></center>"
output += ruler
@@ -196,7 +200,7 @@
/proc/show_player_info_irc(var/key as text)
var/target_sql_ckey = ckey(key)
var/DBQuery/query_get_notes = dbcon.NewQuery("SELECT timestamp, notetext, adminckey, server, crew_playtime FROM [format_table_name("notes")] WHERE ckey = '[target_sql_ckey]' ORDER BY timestamp")
var/DBQuery/query_get_notes = GLOB.dbcon.NewQuery("SELECT timestamp, notetext, adminckey, server, crew_playtime FROM [format_table_name("notes")] WHERE ckey = '[target_sql_ckey]' ORDER BY timestamp")
if(!query_get_notes.Execute())
var/err = query_get_notes.ErrorMsg()
log_game("SQL ERROR obtaining timestamp, notetext, adminckey, server, crew_playtime from notes table. Error : \[[err]\]\n")
+163 -155
View File
@@ -183,7 +183,7 @@
if(task == "add")
var/new_ckey = ckey(clean_input("New admin's ckey","Admin ckey", null))
if(!new_ckey) return
if(new_ckey in admin_datums)
if(new_ckey in GLOB.admin_datums)
to_chat(usr, "<font color='red'>Error: Topic 'editrights': [new_ckey] is already an admin</font>")
return
adm_ckey = new_ckey
@@ -194,12 +194,12 @@
to_chat(usr, "<font color='red'>Error: Topic 'editrights': No valid ckey</font>")
return
var/datum/admins/D = admin_datums[adm_ckey]
var/datum/admins/D = GLOB.admin_datums[adm_ckey]
if(task == "remove")
if(alert("Are you sure you want to remove [adm_ckey]?","Message","Yes","Cancel") == "Yes")
if(!D) return
admin_datums -= adm_ckey
GLOB.admin_datums -= adm_ckey
D.disassociate()
updateranktodb(adm_ckey, "player")
@@ -209,8 +209,8 @@
else if(task == "rank")
var/new_rank
if(admin_ranks.len)
new_rank = input("Please select a rank", "New rank", null, null) as null|anything in (admin_ranks|"*New Rank*")
if(GLOB.admin_ranks.len)
new_rank = input("Please select a rank", "New rank", null, null) as null|anything in (GLOB.admin_ranks|"*New Rank*")
else
new_rank = input("Please select a rank", "New rank", null, null) as null|anything in list("Mentor", "Trial Admin", "Game Admin", "*New Rank*")
@@ -227,15 +227,15 @@
to_chat(usr, "<font color='red'>Error: Topic 'editrights': Invalid rank</font>")
return
if(config.admin_legacy_system)
if(admin_ranks.len)
if(new_rank in admin_ranks)
rights = admin_ranks[new_rank] //we typed a rank which already exists, use its rights
if(GLOB.admin_ranks.len)
if(new_rank in GLOB.admin_ranks)
rights = GLOB.admin_ranks[new_rank] //we typed a rank which already exists, use its rights
else
admin_ranks[new_rank] = 0 //add the new rank to admin_ranks
GLOB.admin_ranks[new_rank] = 0 //add the new rank to admin_ranks
else
if(config.admin_legacy_system)
new_rank = ckeyEx(new_rank)
rights = admin_ranks[new_rank] //we input an existing rank, use its rights
rights = GLOB.admin_ranks[new_rank] //we input an existing rank, use its rights
if(D)
D.disassociate() //remove adminverbs and unlink from client
@@ -308,7 +308,7 @@
var/timer = input("Enter new shuttle duration (seconds):","Edit Shuttle Timeleft", SSshuttle.emergency.timeLeft() ) as num
SSshuttle.emergency.setTimer(timer*10)
log_admin("[key_name(usr)] edited the Emergency Shuttle's timeleft to [timer] seconds")
minor_announcement.Announce("The emergency shuttle will reach its destination in [round(SSshuttle.emergency.timeLeft(600))] minutes.")
GLOB.minor_announcement.Announce("The emergency shuttle will reach its destination in [round(SSshuttle.emergency.timeLeft(600))] minutes.")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] edited the Emergency Shuttle's timeleft to [timer] seconds</span>")
href_list["secrets"] = "check_antagonist"
@@ -369,8 +369,8 @@
if(!check_rights(R_BAN)) return
var/banfolder = href_list["unbanf"]
Banlist.cd = "/base/[banfolder]"
var/key = Banlist["key"]
GLOB.banlist_savefile.cd = "/base/[banfolder]"
var/key = GLOB.banlist_savefile["key"]
if(alert(usr, "Are you sure you want to unban [key]?", "Confirmation", "Yes", "No") == "Yes")
if(RemoveBan(banfolder))
unbanpanel()
@@ -388,14 +388,14 @@
var/reason
var/banfolder = href_list["unbane"]
Banlist.cd = "/base/[banfolder]"
var/reason2 = Banlist["reason"]
var/temp = Banlist["temp"]
GLOB.banlist_savefile.cd = "/base/[banfolder]"
var/reason2 = GLOB.banlist_savefile["reason"]
var/temp = GLOB.banlist_savefile["temp"]
var/minutes = Banlist["minutes"]
var/minutes = GLOB.banlist_savefile["minutes"]
var/banned_key = Banlist["key"]
Banlist.cd = "/base"
var/banned_key = GLOB.banlist_savefile["key"]
GLOB.banlist_savefile.cd = "/base"
var/duration
@@ -403,12 +403,12 @@
if("Yes")
temp = 1
var/mins = 0
if(minutes > CMinutes)
mins = minutes - CMinutes
if(minutes > GLOB.CMinutes)
mins = minutes - GLOB.CMinutes
mins = input(usr,"How long (in minutes)? (Default: 1440)","Ban time",mins ? mins : 1440) as num|null
if(!mins) return
mins = min(525599,mins)
minutes = CMinutes + mins
minutes = GLOB.CMinutes + mins
duration = GetExp(minutes)
reason = input(usr,"Please state the reason","Reason",reason2) as message|null
if(!reason) return
@@ -421,12 +421,12 @@
log_admin("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]")
ban_unban_log_save("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]")
message_admins("<span class='notice'>[key_name_admin(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]</span>", 1)
Banlist.cd = "/base/[banfolder]"
to_chat(Banlist["reason"], reason)
to_chat(Banlist["temp"], temp)
to_chat(Banlist["minutes"], minutes)
to_chat(Banlist["bannedby"], usr.ckey)
Banlist.cd = "/base"
GLOB.banlist_savefile.cd = "/base/[banfolder]"
to_chat(GLOB.banlist_savefile["reason"], reason)
to_chat(GLOB.banlist_savefile["temp"], temp)
to_chat(GLOB.banlist_savefile["minutes"], minutes)
to_chat(GLOB.banlist_savefile["bannedby"], usr.ckey)
GLOB.banlist_savefile.cd = "/base"
feedback_inc("ban_edit",1)
unbanpanel()
@@ -512,8 +512,8 @@
//Regular jobs
//Command (Blue)
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
jobs += "<tr align='center' bgcolor='ccccff'><th colspan='[length(command_positions)]'><a href='?src=[UID()];jobban3=commanddept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Command Positions</a></th></tr><tr align='center'>"
for(var/jobPos in command_positions)
jobs += "<tr align='center' bgcolor='ccccff'><th colspan='[length(GLOB.command_positions)]'><a href='?src=[UID()];jobban3=commanddept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Command Positions</a></th></tr><tr align='center'>"
for(var/jobPos in GLOB.command_positions)
if(!jobPos) continue
var/datum/job/job = SSjobs.GetJob(jobPos)
if(!job) continue
@@ -533,8 +533,8 @@
//Security (Red)
counter = 0
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
jobs += "<tr bgcolor='ffddf0'><th colspan='[length(security_positions)]'><a href='?src=[UID()];jobban3=securitydept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Security Positions</a></th></tr><tr align='center'>"
for(var/jobPos in security_positions)
jobs += "<tr bgcolor='ffddf0'><th colspan='[length(GLOB.security_positions)]'><a href='?src=[UID()];jobban3=securitydept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Security Positions</a></th></tr><tr align='center'>"
for(var/jobPos in GLOB.security_positions)
if(!jobPos) continue
var/datum/job/job = SSjobs.GetJob(jobPos)
if(!job) continue
@@ -554,8 +554,8 @@
//Engineering (Yellow)
counter = 0
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
jobs += "<tr bgcolor='fff5cc'><th colspan='[length(engineering_positions)]'><a href='?src=[UID()];jobban3=engineeringdept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Engineering Positions</a></th></tr><tr align='center'>"
for(var/jobPos in engineering_positions)
jobs += "<tr bgcolor='fff5cc'><th colspan='[length(GLOB.engineering_positions)]'><a href='?src=[UID()];jobban3=engineeringdept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Engineering Positions</a></th></tr><tr align='center'>"
for(var/jobPos in GLOB.engineering_positions)
if(!jobPos) continue
var/datum/job/job = SSjobs.GetJob(jobPos)
if(!job) continue
@@ -575,8 +575,8 @@
//Medical (White)
counter = 0
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
jobs += "<tr bgcolor='ffeef0'><th colspan='[length(medical_positions)]'><a href='?src=[UID()];jobban3=medicaldept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Medical Positions</a></th></tr><tr align='center'>"
for(var/jobPos in medical_positions)
jobs += "<tr bgcolor='ffeef0'><th colspan='[length(GLOB.medical_positions)]'><a href='?src=[UID()];jobban3=medicaldept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Medical Positions</a></th></tr><tr align='center'>"
for(var/jobPos in GLOB.medical_positions)
if(!jobPos) continue
var/datum/job/job = SSjobs.GetJob(jobPos)
if(!job) continue
@@ -596,8 +596,8 @@
//Science (Purple)
counter = 0
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
jobs += "<tr bgcolor='e79fff'><th colspan='[length(science_positions)]'><a href='?src=[UID()];jobban3=sciencedept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Science Positions</a></th></tr><tr align='center'>"
for(var/jobPos in science_positions)
jobs += "<tr bgcolor='e79fff'><th colspan='[length(GLOB.science_positions)]'><a href='?src=[UID()];jobban3=sciencedept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Science Positions</a></th></tr><tr align='center'>"
for(var/jobPos in GLOB.science_positions)
if(!jobPos) continue
var/datum/job/job = SSjobs.GetJob(jobPos)
if(!job) continue
@@ -617,8 +617,8 @@
//Support (Grey)
counter = 0
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
jobs += "<tr bgcolor='dddddd'><th colspan='[length(support_positions)]'><a href='?src=[UID()];jobban3=supportdept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Support Positions</a></th></tr><tr align='center'>"
for(var/jobPos in support_positions)
jobs += "<tr bgcolor='dddddd'><th colspan='[length(GLOB.support_positions)]'><a href='?src=[UID()];jobban3=supportdept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Support Positions</a></th></tr><tr align='center'>"
for(var/jobPos in GLOB.support_positions)
if(!jobPos) continue
var/datum/job/job = SSjobs.GetJob(jobPos)
if(!job) continue
@@ -638,8 +638,8 @@
//Non-Human (Green)
counter = 0
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
jobs += "<tr bgcolor='ccffcc'><th colspan='[length(nonhuman_positions)+1]'><a href='?src=[UID()];jobban3=nonhumandept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Non-human Positions</a></th></tr><tr align='center'>"
for(var/jobPos in nonhuman_positions)
jobs += "<tr bgcolor='ccffcc'><th colspan='[length(GLOB.nonhuman_positions)+1]'><a href='?src=[UID()];jobban3=nonhumandept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Non-human Positions</a></th></tr><tr align='center'>"
for(var/jobPos in GLOB.nonhuman_positions)
if(!jobPos) continue
var/datum/job/job = SSjobs.GetJob(jobPos)
if(!job) continue
@@ -675,7 +675,7 @@
jobs += "<tr bgcolor='ffeeaa'><th colspan='10'><a href='?src=[UID()];jobban3=Syndicate;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Antagonist Positions</a></th></tr><tr align='center'>"
counter = 0
for(var/role in antag_roles)
for(var/role in GLOB.antag_roles)
if(jobban_isbanned(M, role) || isbanned_dept)
jobs += "<td width='20%'><a href='?src=[UID()];jobban3=[role];jobban4=[M.UID()];dbbanaddckey=[M.ckey]'><font color=red>[replacetext(role, " ", "&nbsp")]</font></a></td>"
else
@@ -692,7 +692,7 @@
jobs += "<tr bgcolor='ccccff'><th colspan='10'>Other</th></tr><tr align='center'>"
counter = 0
for(var/role in other_roles)
for(var/role in GLOB.other_roles)
if(jobban_isbanned(M, role) || isbanned_dept)
jobs += "<td width='20%'><a href='?src=[UID()];jobban3=[role];jobban4=[M.UID()];dbbanaddckey=[M.ckey]'><font color=red>[replacetext(role, " ", "&nbsp")]</font></a></td>"
else
@@ -707,8 +707,8 @@
//Whitelisted positions
counter = 0
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
jobs += "<tr bgcolor='dddddd'><th colspan='[length(whitelisted_positions)]'><a href='?src=[UID()];jobban3=whitelistdept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Whitelisted Positions</a></th></tr><tr align='center'>"
for(var/jobPos in whitelisted_positions)
jobs += "<tr bgcolor='dddddd'><th colspan='[length(GLOB.whitelisted_positions)]'><a href='?src=[UID()];jobban3=whitelistdept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Whitelisted Positions</a></th></tr><tr align='center'>"
for(var/jobPos in GLOB.whitelisted_positions)
if(!jobPos) continue
var/datum/job/job = SSjobs.GetJob(jobPos)
if(!job) continue
@@ -754,50 +754,50 @@
var/list/joblist = list()
switch(href_list["jobban3"])
if("commanddept")
for(var/jobPos in command_positions)
for(var/jobPos in GLOB.command_positions)
if(!jobPos) continue
var/datum/job/temp = SSjobs.GetJob(jobPos)
if(!temp) continue
joblist += temp.title
if("securitydept")
for(var/jobPos in security_positions)
for(var/jobPos in GLOB.security_positions)
if(!jobPos) continue
var/datum/job/temp = SSjobs.GetJob(jobPos)
if(!temp) continue
joblist += temp.title
if("engineeringdept")
for(var/jobPos in engineering_positions)
for(var/jobPos in GLOB.engineering_positions)
if(!jobPos) continue
var/datum/job/temp = SSjobs.GetJob(jobPos)
if(!temp) continue
joblist += temp.title
if("medicaldept")
for(var/jobPos in medical_positions)
for(var/jobPos in GLOB.medical_positions)
if(!jobPos) continue
var/datum/job/temp = SSjobs.GetJob(jobPos)
if(!temp) continue
joblist += temp.title
if("sciencedept")
for(var/jobPos in science_positions)
for(var/jobPos in GLOB.science_positions)
if(!jobPos) continue
var/datum/job/temp = SSjobs.GetJob(jobPos)
if(!temp) continue
joblist += temp.title
if("supportdept")
for(var/jobPos in support_positions)
for(var/jobPos in GLOB.support_positions)
if(!jobPos) continue
var/datum/job/temp = SSjobs.GetJob(jobPos)
if(!temp) continue
joblist += temp.title
if("nonhumandept")
joblist += "pAI"
for(var/jobPos in nonhuman_positions)
for(var/jobPos in GLOB.nonhuman_positions)
if(!jobPos) continue
var/datum/job/temp = SSjobs.GetJob(jobPos)
if(!temp) continue
joblist += temp.title
if("whitelistdept")
for(var/jobPos in whitelisted_positions)
for(var/jobPos in GLOB.whitelisted_positions)
if(!jobPos) continue
var/datum/job/temp = SSjobs.GetJob(jobPos)
if(!temp) continue
@@ -957,7 +957,7 @@
else if(href_list["noteedits"])
var/note_id = sanitizeSQL("[href_list["noteedits"]]")
var/DBQuery/query_noteedits = dbcon.NewQuery("SELECT edits FROM [format_table_name("notes")] WHERE id = '[note_id]'")
var/DBQuery/query_noteedits = GLOB.dbcon.NewQuery("SELECT edits FROM [format_table_name("notes")] WHERE id = '[note_id]'")
if(!query_noteedits.Execute())
var/err = query_noteedits.ErrorMsg()
log_game("SQL ERROR obtaining edits from notes table. Error : \[[err]\]\n")
@@ -1015,8 +1015,7 @@
log_admin("[key_name(usr)] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
message_admins("<span class='notice'>[key_name_admin(usr)] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.</span>")
del(M.client)
//qdel(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends.
qdel(M.client)
if("No")
var/reason = input(usr,"Please state the reason","Reason") as message|null
if(!reason)
@@ -1036,8 +1035,7 @@
feedback_inc("ban_perma",1)
DB_ban_record(BANTYPE_PERMA, M, -1, reason)
del(M.client)
//qdel(M)
qdel(M.client)
if("Cancel")
return
@@ -1077,7 +1075,7 @@
else if(href_list["watcheditlog"])
var/target_ckey = sanitizeSQL("[href_list["watcheditlog"]]")
var/DBQuery/query_watchedits = dbcon.NewQuery("SELECT edits FROM [format_table_name("watch")] WHERE ckey = '[target_ckey]'")
var/DBQuery/query_watchedits = GLOB.dbcon.NewQuery("SELECT edits FROM [format_table_name("watch")] WHERE ckey = '[target_ckey]'")
if(!query_watchedits.Execute())
var/err = query_watchedits.ErrorMsg()
log_game("SQL ERROR obtaining edits from watch table. Error : \[[err]\]\n")
@@ -1110,7 +1108,7 @@
dat += {"<A href='?src=[UID()];c_mode2=[mode]'>[config.mode_names[mode]]</A><br>"}
dat += {"<A href='?src=[UID()];c_mode2=secret'>Secret</A><br>"}
dat += {"<A href='?src=[UID()];c_mode2=random'>Random</A><br>"}
dat += {"Now: [master_mode]"}
dat += {"Now: [GLOB.master_mode]"}
usr << browse(dat, "window=c_mode")
else if(href_list["f_secret"])
@@ -1118,13 +1116,13 @@
if(SSticker && SSticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
if(master_mode != "secret")
if(GLOB.master_mode != "secret")
return alert(usr, "The game mode has to be secret!", null, null, null, null)
var/dat = {"<B>What game mode do you want to force secret to be? Use this if you want to change the game mode, but want the players to believe it's secret. This will only work if the current game mode is secret.</B><HR>"}
for(var/mode in config.modes)
dat += {"<A href='?src=[UID()];f_secret2=[mode]'>[config.mode_names[mode]]</A><br>"}
dat += {"<A href='?src=[UID()];f_secret2=secret'>Random (default)</A><br>"}
dat += {"Now: [secret_force_mode]"}
dat += {"Now: [GLOB.secret_force_mode]"}
usr << browse(dat, "window=f_secret")
else if(href_list["c_mode2"])
@@ -1132,12 +1130,12 @@
if(SSticker && SSticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
master_mode = href_list["c_mode2"]
log_admin("[key_name(usr)] set the mode as [master_mode].")
message_admins("<span class='notice'>[key_name_admin(usr)] set the mode as [master_mode].</span>", 1)
to_chat(world, "<span class='boldnotice'>The mode is now: [master_mode]</span>")
GLOB.master_mode = href_list["c_mode2"]
log_admin("[key_name(usr)] set the mode as [GLOB.master_mode].")
message_admins("<span class='notice'>[key_name_admin(usr)] set the mode as [GLOB.master_mode].</span>", 1)
to_chat(world, "<span class='boldnotice'>The mode is now: [GLOB.master_mode]</span>")
Game() // updates the main game menu
world.save_mode(master_mode)
world.save_mode(GLOB.master_mode)
.(href, list("c_mode"=1))
else if(href_list["f_secret2"])
@@ -1145,11 +1143,11 @@
if(SSticker && SSticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
if(master_mode != "secret")
if(GLOB.master_mode != "secret")
return alert(usr, "The game mode has to be secret!", null, null, null, null)
secret_force_mode = href_list["f_secret2"]
log_admin("[key_name(usr)] set the forced secret mode as [secret_force_mode].")
message_admins("<span class='notice'>[key_name_admin(usr)] set the forced secret mode as [secret_force_mode].</span>", 1)
GLOB.secret_force_mode = href_list["f_secret2"]
log_admin("[key_name(usr)] set the forced secret mode as [GLOB.secret_force_mode].")
message_admins("<span class='notice'>[key_name_admin(usr)] set the forced secret mode as [GLOB.secret_force_mode].</span>", 1)
Game() // updates the main game menu
.(href, list("f_secret"=1))
@@ -1235,7 +1233,7 @@
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai")
return
var/turf/prison_cell = pick(prisonwarp)
var/turf/prison_cell = pick(GLOB.prisonwarp)
if(!prison_cell) return
var/obj/structure/closet/secure_closet/brig/locker = new /obj/structure/closet/secure_closet/brig(prison_cell)
@@ -1315,7 +1313,7 @@
M.Paralyse(5)
sleep(5)
M.loc = pick(tdome1)
M.loc = pick(GLOB.tdome1)
spawn(50)
to_chat(M, "<span class='notice'>You have been sent to the Thunderdome.</span>")
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 1)")
@@ -1345,7 +1343,7 @@
M.Paralyse(5)
sleep(5)
M.loc = pick(tdome2)
M.loc = pick(GLOB.tdome2)
spawn(50)
to_chat(M, "<span class='notice'>You have been sent to the Thunderdome.</span>")
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 2)")
@@ -1367,7 +1365,7 @@
M.Paralyse(5)
sleep(5)
M.loc = pick(tdomeadmin)
M.loc = pick(GLOB.tdomeadmin)
spawn(50)
to_chat(M, "<span class='notice'>You have been sent to the Thunderdome.</span>")
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Admin.)")
@@ -1401,7 +1399,7 @@
observer.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(observer), slot_shoes)
M.Paralyse(5)
sleep(5)
M.loc = pick(tdomeobserve)
M.loc = pick(GLOB.tdomeobserve)
spawn(50)
to_chat(M, "<span class='notice'>You have been sent to the Thunderdome.</span>")
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Observer.)")
@@ -1423,7 +1421,7 @@
M.Paralyse(5)
sleep(5)
M.loc = pick(aroomwarp)
M.loc = pick(GLOB.aroomwarp)
spawn(50)
to_chat(M, "<span class='notice'>You have been sent to the <b>Admin Room!</b>.</span>")
log_admin("[key_name(usr)] has sent [key_name(M)] to the Admin Room")
@@ -1511,7 +1509,7 @@
if(!check_rights(R_SPAWN)) return
var/mob/M = locateUID(href_list["makeanimal"])
if(istype(M, /mob/new_player))
if(isnewplayer(M))
to_chat(usr, "This cannot be used on instances of type /mob/new_player")
return
if(alert(usr, "Confirm make animal?",, "Yes", "No") != "Yes")
@@ -1671,13 +1669,13 @@
if(alert(owner, "Are you sure you wish to hit [key_name(M)] with Bluespace Artillery?", "Confirm Firing?" , "Yes" , "No") != "Yes")
return
if(BSACooldown)
if(GLOB.BSACooldown)
to_chat(owner, "Standby. Reload cycle in progress. Gunnery crews ready in five seconds!")
return
BSACooldown = 1
GLOB.BSACooldown = 1
spawn(50)
BSACooldown = 0
GLOB.BSACooldown = 0
to_chat(M, "You've been hit by bluespace artillery!")
log_admin("[key_name(M)] has been hit by Bluespace Artillery fired by [key_name(owner)]")
@@ -1791,7 +1789,7 @@
var/logmsg = null
switch(blessing)
if("To Arrivals")
M.forceMove(pick(latejoin))
M.forceMove(pick(GLOB.latejoin))
to_chat(M, "<span class='userdanger'>You are abruptly pulled through space!</span>")
logmsg = "a teleport to arrivals."
if("Moderate Heal")
@@ -1807,13 +1805,13 @@
H.reagents.add_reagent("spaceacillin", 20)
logmsg = "a heal over time."
if("Permanent Regeneration")
H.dna.SetSEState(REGENERATEBLOCK, 1)
genemutcheck(H, REGENERATEBLOCK, null, MUTCHK_FORCED)
H.dna.SetSEState(GLOB.regenerateblock, 1)
genemutcheck(H, GLOB.regenerateblock, null, MUTCHK_FORCED)
H.update_mutations()
H.gene_stability = 100
logmsg = "permanent regeneration."
if("Super Powers")
var/list/default_genes = list(REGENERATEBLOCK, BREATHLESSBLOCK, COLDBLOCK)
var/list/default_genes = list(GLOB.regenerateblock, GLOB.breathlessblock, GLOB.coldblock)
for(var/gene in default_genes)
H.dna.SetSEState(gene, 1)
genemutcheck(H, gene, null, MUTCHK_FORCED)
@@ -1909,11 +1907,13 @@
ptypes += "Crew Traitor"
ptypes += "Floor Cluwne"
ptypes += "Shamebrero"
ptypes += "Dust"
var/punishment = input(owner, "How would you like to smite [M]?", "Its good to be baaaad...", "") as null|anything in ptypes
if(!(punishment in ptypes))
return
var/logmsg = null
switch(punishment)
// These smiting types are valid for all living mobs
if("Lightning bolt")
M.electrocute_act(5, "Lightning Bolt", safety = TRUE, override = TRUE)
playsound(get_turf(M), 'sound/magic/lightningshock.ogg', 50, 1, -1)
@@ -1931,6 +1931,7 @@
M.gib(FALSE)
logmsg = "gibbed."
// These smiting types are only valid for ishuman() mobs
if("Brain Damage")
H.adjustBrainLoss(75)
logmsg = "75 brain damage."
@@ -1978,38 +1979,34 @@
logmsg = "hunter."
if("Crew Traitor")
if(!H.mind)
to_chat(usr, "<span class='warning'><i>This mob has no mind!</i></span>")
to_chat(usr, "<span class='warning'>ERROR: This mob ([H]) has no mind!</span>")
return
var/list/possible_traitors = list()
for(var/mob/living/player in GLOB.living_mob_list)
for(var/mob/living/player in GLOB.alive_mob_list)
if(player.client && player.mind && player.stat != DEAD && player != H)
if(ishuman(player) && !player.mind.special_role)
if(player.client && (ROLE_TRAITOR in player.client.prefs.be_special) && !jobban_isbanned(player, ROLE_TRAITOR) && !jobban_isbanned(player, "Syndicate"))
possible_traitors += player.mind
for(var/datum/mind/player in possible_traitors)
if(player.current)
if(ismindshielded(player.current))
possible_traitors -= player
if(possible_traitors.len)
var/datum/mind/newtraitormind = pick(possible_traitors)
var/datum/objective/assassinate/kill_objective = new()
kill_objective.target = H.mind
kill_objective.owner = newtraitormind
kill_objective.explanation_text = "Assassinate [H.mind], the [H.mind.assigned_role]"
H.mind.objectives += kill_objective
kill_objective.explanation_text = "Assassinate [H.mind.name], the [H.mind.assigned_role]"
newtraitormind.objectives += kill_objective
var/datum/antagonist/traitor/T = new()
T.give_objectives = FALSE
to_chat(newtraitormind, "<span class='danger'>ATTENTION:</span> It is time to pay your debt to the Syndicate...")
to_chat(newtraitormind, "<B>Goal: <span class='danger'>KILL [H.real_name]</span>, currently in [get_area(H.loc)]</B>")
to_chat(newtraitormind.current, "<span class='danger'>ATTENTION:</span> It is time to pay your debt to the Syndicate...")
to_chat(newtraitormind.current, "<B>Goal: <span class='danger'>KILL [H.real_name]</span>, currently in [get_area(H.loc)]</B>")
newtraitormind.add_antag_datum(T)
else
to_chat(usr, "ERROR: Failed to create a traitor.")
to_chat(usr, "<span class='warning'>ERROR: Unable to find any valid candidate to send after [H].</span>")
return
logmsg = "crew traitor."
if("Floor Cluwne")
var/turf/T = get_turf(M)
var/mob/living/simple_animal/hostile/floor_cluwne/FC = new /mob/living/simple_animal/hostile/floor_cluwne(T)
@@ -2022,6 +2019,9 @@
var/obj/item/clothing/head/sombrero/shamebrero/S = new(H.loc)
H.equip_to_slot_or_del(S, slot_head)
logmsg = "shamebrero"
if("Dust")
H.dust()
logmsg = "dust"
if(logmsg)
log_admin("[key_name(owner)] smited [key_name(M)] with: [logmsg]")
message_admins("[key_name_admin(owner)] smited [key_name_admin(M)] with: [logmsg]")
@@ -2060,7 +2060,7 @@
P.name = "Central Command - paper"
var/stypes = list("Handle it yourselves!","Illegible fax","Fax not signed","Not Right Now","You are wasting our time", "Keep up the good work", "ERT Instructions")
var/stype = input(src.owner, "Which type of standard reply do you wish to send to [H]?","Choose your paperwork", "") as null|anything in stypes
var/tmsg = "<font face='Verdana' color='black'><center><img src = 'ntlogo.png'><BR><BR><BR><font size='4'><B>Nanotrasen Science Station [using_map.station_short]</B></font><BR><BR><BR><font size='4'>NAS Trurl Communications Department Report</font></center><BR><BR>"
var/tmsg = "<font face='Verdana' color='black'><center><img src = 'ntlogo.png'><BR><BR><BR><font size='4'><B>Nanotrasen Science Station [GLOB.using_map.station_short]</B></font><BR><BR><BR><font size='4'>NAS Trurl Communications Department Report</font></center><BR><BR>"
if(stype == "Handle it yourselves!")
tmsg += "Greetings, esteemed crewmember. Your fax has been <B><I>DECLINED</I></B> automatically by NAS Trurl Fax Registration.<BR><BR>Please proceed in accordance with Standard Operating Procedure and/or Space Law. You are fully trained to handle this situation without Central Command intervention.<BR><BR><i><small>This is an automatic message.</small>"
else if(stype == "Illegible fax")
@@ -2138,7 +2138,7 @@
var/input = input(src.owner, "Please enter a reason for denying [key_name(H)]'s ERT request.","Outgoing message from CentComm", "")
if(!input) return
ert_request_answered = TRUE
GLOB.ert_request_answered = TRUE
to_chat(src.owner, "You sent [input] to [H] via a secure channel.")
log_admin("[src.owner] denied [key_name(H)]'s ERT request with the message [input].")
to_chat(H, "<span class = 'specialnoticebold'>Incoming priority transmission from Central Command. Message as follows,</span><span class = 'specialnotice'> Your ERT request has been denied for the following reasons: [input].</span>")
@@ -2198,17 +2198,23 @@
var/reply_to = locate(href_list["replyto"])
var/destination
var/notify
var/obj/item/paper/P = new /obj/item/paper(null) //hopefully the null loc won't cause trouble for us
var/obj/item/paper/P
var/use_letterheard = alert("Use letterhead? If so, do not add your own header or a footer. Type and format only your actual message.",,"Nanotrasen","Syndicate", "No")
switch(use_letterheard)
if("Nanotrasen")
P = new /obj/item/paper/central_command(null)
if("Syndicate")
P = new /obj/item/paper/syndicate(null)
if("No")
P = new /obj/item/paper(null)
if(!fax)
var/list/departmentoptions = alldepartments + hidden_departments + "All Departments"
var/list/departmentoptions = GLOB.alldepartments + GLOB.hidden_departments + "All Departments"
destination = input(usr, "To which department?", "Choose a department", "") as null|anything in departmentoptions
if(!destination)
qdel(P)
return
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes)
if(destination != "All Departments" && F.department == destination)
fax = F
@@ -2304,7 +2310,7 @@
to_chat(src.owner, "<span class='warning'>Message transmission failed.</span>")
return
else
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes)
if(is_station_level(F.z))
spawn(0)
if(!F.receivefax(P))
@@ -2545,7 +2551,7 @@
else if(href_list["memoeditlist"])
if(!check_rights(R_SERVER)) return
var/sql_key = sanitizeSQL("[href_list["memoeditlist"]]")
var/DBQuery/query_memoedits = dbcon.NewQuery("SELECT edits FROM [format_table_name("memo")] WHERE (ckey = '[sql_key]')")
var/DBQuery/query_memoedits = GLOB.dbcon.NewQuery("SELECT edits FROM [format_table_name("memo")] WHERE (ckey = '[sql_key]')")
if(!query_memoedits.Execute())
var/err = query_memoedits.ErrorMsg()
log_game("SQL ERROR obtaining edits from memo table. Error : \[[err]\]\n")
@@ -2620,19 +2626,19 @@
if(!(SSticker && SSticker.mode))
to_chat(usr, "Please wait until the game starts! Not sure how it will work otherwise.")
return
gravity_is_on = !gravity_is_on
GLOB.gravity_is_on = !GLOB.gravity_is_on
for(var/area/A in world)
A.gravitychange(gravity_is_on,A)
A.gravitychange(GLOB.gravity_is_on,A)
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","Grav")
if(gravity_is_on)
if(GLOB.gravity_is_on)
log_admin("[key_name(usr)] toggled gravity on.", 1)
message_admins("<span class='notice'>[key_name_admin(usr)] toggled gravity on.</span>", 1)
event_announcement.Announce("Gravity generators are again functioning within normal parameters. Sorry for any inconvenience.")
GLOB.event_announcement.Announce("Gravity generators are again functioning within normal parameters. Sorry for any inconvenience.")
else
log_admin("[key_name(usr)] toggled gravity off.", 1)
message_admins("<span class='notice'>[key_name_admin(usr)] toggled gravity off.</span>", 1)
event_announcement.Announce("Feedback surge detected in mass-distributions systems. Artifical gravity has been disabled whilst the system reinitializes. Further failures may result in a gravitational collapse and formation of blackholes. Have a nice day.")
GLOB.event_announcement.Announce("Feedback surge detected in mass-distributions systems. Artifical gravity has been disabled whilst the system reinitializes. Further failures may result in a gravitational collapse and formation of blackholes. Have a nice day.")
if("power")
feedback_inc("admin_secrets_fun_used",1)
@@ -2662,7 +2668,7 @@
for(var/mob/living/carbon/human/H in GLOB.mob_list)
var/turf/loc = find_loc(H)
var/security = 0
if(!is_station_level(loc.z) || prisonwarped.Find(H))
if(!is_station_level(loc.z) || GLOB.prisonwarped.Find(H))
//don't warp them if they aren't ready or are already there
continue
@@ -2687,13 +2693,13 @@
W.layer = initial(W.layer)
W.plane = initial(W.plane)
//teleport person to cell
H.loc = pick(prisonwarp)
H.loc = pick(GLOB.prisonwarp)
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(H), slot_shoes)
else
//teleport security person
H.loc = pick(prisonsecuritywarp)
prisonwarped += H
H.loc = pick(GLOB.prisonsecuritywarp)
GLOB.prisonwarped += H
if("traitor_all")
if(!SSticker)
alert("The game hasn't started yet!")
@@ -2720,21 +2726,21 @@
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","BC")
var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be between 4 and 128)", "New Bomb Cap", MAX_EX_LIGHT_RANGE) as num|null
var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be between 4 and 128)", "New Bomb Cap", GLOB.max_ex_light_range) as num|null
if(newBombCap < 4)
return
if(newBombCap > 128)
newBombCap = 128
MAX_EX_DEVASTATION_RANGE = round(newBombCap/4)
MAX_EX_HEAVY_RANGE = round(newBombCap/2)
MAX_EX_LIGHT_RANGE = newBombCap
GLOB.max_ex_devastation_range = round(newBombCap/4)
GLOB.max_ex_heavy_range = round(newBombCap/2)
GLOB.max_ex_light_range = newBombCap
//I don't know why these are their own variables, but fuck it, they are.
MAX_EX_FLASH_RANGE = newBombCap
MAX_EX_FLAME_RANGE = newBombCap
GLOB.max_ex_flash_range = newBombCap
GLOB.max_ex_flame_range = newBombCap
message_admins("<span class='boldannounce'>[key_name_admin(usr)] changed the bomb cap to [MAX_EX_DEVASTATION_RANGE], [MAX_EX_HEAVY_RANGE], [MAX_EX_LIGHT_RANGE]</span>")
log_admin("[key_name(usr)] changed the bomb cap to [MAX_EX_DEVASTATION_RANGE], [MAX_EX_HEAVY_RANGE], [MAX_EX_LIGHT_RANGE]")
message_admins("<span class='boldannounce'>[key_name_admin(usr)] changed the bomb cap to [GLOB.max_ex_devastation_range], [GLOB.max_ex_heavy_range], [GLOB.max_ex_light_range]</span>")
log_admin("[key_name(usr)] changed the bomb cap to [GLOB.max_ex_devastation_range], [GLOB.max_ex_heavy_range], [GLOB.max_ex_light_range]")
if("flicklights")
feedback_inc("admin_secrets_fun_used",1)
@@ -2809,13 +2815,13 @@
return
SSweather.run_weather(/datum/weather/ash_storm)
message_admins("[key_name_admin(usr)] spawned an ash storm on the mining level")
if("retardify")
if("stupify")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","RET")
for(var/mob/living/carbon/human/H in GLOB.player_list)
to_chat(H, "<span class='danger'>You suddenly feel stupid.</span>")
H.setBrainLoss(60)
message_admins("[key_name_admin(usr)] made everybody retarded")
message_admins("[key_name_admin(usr)] made everybody stupid")
if("fakeguns")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","FG")
@@ -2842,7 +2848,7 @@
if(is_station_level(W.z) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison))
W.req_access = list()
message_admins("[key_name_admin(usr)] activated Egalitarian Station mode")
event_announcement.Announce("Centcomm airlock control override activated. Please take this time to get acquainted with your coworkers.", new_sound = 'sound/AI/commandreport.ogg')
GLOB.event_announcement.Announce("Centcomm airlock control override activated. Please take this time to get acquainted with your coworkers.", new_sound = 'sound/AI/commandreport.ogg')
if("onlyone")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","OO")
@@ -2962,13 +2968,13 @@
var/ok = 0
switch(href_list["secretsadmin"])
if("list_signalers")
var/dat = "<B>Showing last [length(lastsignalers)] signalers.</B><HR>"
for(var/sig in lastsignalers)
var/dat = "<B>Showing last [length(GLOB.lastsignalers)] signalers.</B><HR>"
for(var/sig in GLOB.lastsignalers)
dat += "[sig]<BR>"
usr << browse(dat, "window=lastsignalers;size=800x500")
if("list_lawchanges")
var/dat = "<B>Showing last [length(lawchanges)] law changes.</B><HR>"
for(var/sig in lawchanges)
var/dat = "<B>Showing last [length(GLOB.lawchanges)] law changes.</B><HR>"
for(var/sig in GLOB.lawchanges)
dat += "[sig]<BR>"
usr << browse(dat, "window=lawchanges;size=800x500")
if("list_job_debug")
@@ -3050,9 +3056,9 @@
switch(href_list["secretscoder"])
if("spawn_objects")
var/dat = "<B>Admin Log<HR></B>"
for(var/l in admin_log)
for(var/l in GLOB.admin_log)
dat += "<li>[l]</li>"
if(!admin_log.len)
if(!GLOB.admin_log.len)
dat += "No-one has done anything this round!"
usr << browse(dat, "window=admin_log")
if("maint_ACCESS_BRIG")
@@ -3089,7 +3095,7 @@
else if(href_list["ac_submit_new_channel"])
var/check = 0
for(var/datum/feed_channel/FC in news_network.network_channels)
for(var/datum/feed_channel/FC in GLOB.news_network.network_channels)
if(FC.channel_name == src.admincaster_feed_channel.channel_name)
check = 1
break
@@ -3104,14 +3110,14 @@
newChannel.locked = src.admincaster_feed_channel.locked
newChannel.is_admin_channel = 1
feedback_inc("newscaster_channels",1)
news_network.network_channels += newChannel //Adding channel to the global network
GLOB.news_network.network_channels += newChannel //Adding channel to the global network
log_admin("[key_name_admin(usr)] created command feed channel: [src.admincaster_feed_channel.channel_name]!")
src.admincaster_screen=5
src.access_news_network()
else if(href_list["ac_set_channel_receiving"])
var/list/available_channels = list()
for(var/datum/feed_channel/F in news_network.network_channels)
for(var/datum/feed_channel/F in GLOB.news_network.network_channels)
available_channels += F.channel_name
src.admincaster_feed_channel.channel_name = adminscrub(input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels )
src.access_news_network()
@@ -3131,13 +3137,13 @@
newMsg.body = src.admincaster_feed_message.body
newMsg.is_admin_message = 1
feedback_inc("newscaster_stories",1)
for(var/datum/feed_channel/FC in news_network.network_channels)
for(var/datum/feed_channel/FC in GLOB.news_network.network_channels)
if(FC.channel_name == src.admincaster_feed_channel.channel_name)
FC.messages += newMsg //Adding message to the network's appropriate feed_channel
break
src.admincaster_screen=4
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allNewscasters)
NEWSCASTER.newsAlert(src.admincaster_feed_channel.channel_name)
log_admin("[key_name_admin(usr)] submitted a feed story to channel: [src.admincaster_feed_channel.channel_name]!")
@@ -3161,12 +3167,12 @@
else if(href_list["ac_menu_wanted"])
var/already_wanted = 0
if(news_network.wanted_issue)
if(GLOB.news_network.wanted_issue)
already_wanted = 1
if(already_wanted)
src.admincaster_feed_message.author = news_network.wanted_issue.author
src.admincaster_feed_message.body = news_network.wanted_issue.body
src.admincaster_feed_message.author = GLOB.news_network.wanted_issue.author
src.admincaster_feed_message.body = GLOB.news_network.wanted_issue.body
src.admincaster_screen = 14
src.access_news_network()
@@ -3195,15 +3201,15 @@
WANTED.body = src.admincaster_feed_message.body //Wanted desc
WANTED.backup_author = src.admincaster_signature //Submitted by
WANTED.is_admin_message = 1
news_network.wanted_issue = WANTED
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
GLOB.news_network.wanted_issue = WANTED
for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allNewscasters)
NEWSCASTER.newsAlert()
NEWSCASTER.update_icon()
src.admincaster_screen = 15
else
news_network.wanted_issue.author = src.admincaster_feed_message.author
news_network.wanted_issue.body = src.admincaster_feed_message.body
news_network.wanted_issue.backup_author = src.admincaster_feed_message.backup_author
GLOB.news_network.wanted_issue.author = src.admincaster_feed_message.author
GLOB.news_network.wanted_issue.body = src.admincaster_feed_message.body
GLOB.news_network.wanted_issue.backup_author = src.admincaster_feed_message.backup_author
src.admincaster_screen = 19
log_admin("[key_name_admin(usr)] issued a Station-wide Wanted Notification for [src.admincaster_feed_message.author]!")
src.access_news_network()
@@ -3211,8 +3217,8 @@
else if(href_list["ac_cancel_wanted"])
var/choice = alert("Please confirm Wanted Issue removal","Network Security Handler","Confirm","Cancel")
if(choice=="Confirm")
news_network.wanted_issue = null
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
GLOB.news_network.wanted_issue = null
for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allNewscasters)
NEWSCASTER.update_icon()
src.admincaster_screen=17
src.access_news_network()
@@ -3337,7 +3343,7 @@
var/isbn = sanitizeSQL(href_list["library_book_id"])
if(href_list["view_library_book"])
var/DBQuery/query_view_book = dbcon.NewQuery("SELECT content, title FROM [format_table_name("library")] WHERE id=[isbn]")
var/DBQuery/query_view_book = GLOB.dbcon.NewQuery("SELECT content, title FROM [format_table_name("library")] WHERE id=[isbn]")
if(!query_view_book.Execute())
var/err = query_view_book.ErrorMsg()
log_game("SQL ERROR viewing book. Error : \[[err]\]\n")
@@ -3362,7 +3368,7 @@
return
else if(href_list["unflag_library_book"])
var/DBQuery/query_unflag_book = dbcon.NewQuery("UPDATE [format_table_name("library")] SET flagged = 0 WHERE id=[isbn]")
var/DBQuery/query_unflag_book = GLOB.dbcon.NewQuery("UPDATE [format_table_name("library")] SET flagged = 0 WHERE id=[isbn]")
if(!query_unflag_book.Execute())
var/err = query_unflag_book.ErrorMsg()
log_game("SQL ERROR unflagging book. Error : \[[err]\]\n")
@@ -3372,7 +3378,7 @@
message_admins("[key_name_admin(usr)] has unflagged the book [isbn].")
else if(href_list["delete_library_book"])
var/DBQuery/query_delbook = dbcon.NewQuery("DELETE FROM [format_table_name("library")] WHERE id=[isbn]")
var/DBQuery/query_delbook = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("library")] WHERE id=[isbn]")
if(!query_delbook.Execute())
var/err = query_delbook.ErrorMsg()
log_game("SQL ERROR deleting book. Error : \[[err]\]\n")
@@ -3385,11 +3391,12 @@
src.view_flagged_books()
// Force unlink a discord key
// TODO: Delete this
else if(href_list["force_discord_unlink"])
if(!check_rights(R_ADMIN))
return
var/target_ckey = href_list["force_discord_unlink"]
var/DBQuery/admin_unlink_discord_id = dbcon.NewQuery("DELETE FROM [format_table_name("discord")] WHERE ckey = '[target_ckey]'")
var/DBQuery/admin_unlink_discord_id = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("discord")] WHERE ckey = '[target_ckey]'")
if(!admin_unlink_discord_id.Execute())
var/err = admin_unlink_discord_id.ErrorMsg()
log_game("SQL ERROR while admin-unlinking discord account. Error : \[[err]\]\n")
@@ -3445,7 +3452,7 @@
return
var/datum/mind/hunter_mind = new /datum/mind(key_of_hunter)
hunter_mind.active = 1
var/mob/living/carbon/human/hunter_mob = new /mob/living/carbon/human(pick(latejoin))
var/mob/living/carbon/human/hunter_mob = new /mob/living/carbon/human(pick(GLOB.latejoin))
hunter_mind.transfer_to(hunter_mob)
hunter_mob.equipOutfit(O, FALSE)
var/obj/item/pinpointer/advpinpointer/N = new /obj/item/pinpointer/advpinpointer(hunter_mob)
@@ -3454,6 +3461,7 @@
N.mode = 2
N.target = H
N.point_at(N.target)
N.modelocked = TRUE
if(!locate(/obj/item/implant/dust, hunter_mob))
var/obj/item/implant/dust/D = new /obj/item/implant/dust(hunter_mob)
D.implant(hunter_mob)
@@ -3471,11 +3479,11 @@
hunter_mind.objectives += protect_objective
SSticker.mode.traitors |= hunter_mob.mind
to_chat(hunter_mob, "<span class='danger'>ATTENTION:</span> You are now on a mission!")
to_chat(hunter_mob, "<B>Goal: <span class='danger'>[killthem ? "MURDER" : "PROTECT"] [H.real_name]</span>, currently in [get_area(H.loc)]. </B>");
to_chat(hunter_mob, "<B>Goal: <span class='danger'>[killthem ? "MURDER" : "PROTECT"] [H.real_name]</span>, currently in [get_area(H.loc)]. </B>")
if(killthem)
to_chat(hunter_mob, "<B>If you kill [H.p_them()], [H.p_they()] cannot be revived.</B>");
to_chat(hunter_mob, "<B>If you kill [H.p_them()], [H.p_they()] cannot be revived.</B>")
hunter_mob.mind.special_role = SPECIAL_ROLE_TRAITOR
var/datum/atom_hud/antag/tatorhud = huds[ANTAG_HUD_TRAITOR]
var/datum/atom_hud/antag/tatorhud = GLOB.huds[ANTAG_HUD_TRAITOR]
tatorhud.join_hud(hunter_mob)
set_antag_hud(hunter_mob, "hudsyndicate")
+3 -3
View File
@@ -430,7 +430,7 @@
else if(expression[start + 1] == "\[" && islist(v))
var/list/L = v
var/index = SDQL_expression(source, expression[start + 2])
if(isnum(index) && (!IsInteger(index) || L.len < index))
if(isnum(index) && (!ISINTEGER(index) || L.len < index))
to_chat(world, "<span class='danger'>Invalid list index: [index]</span>")
return null
return L[index]
@@ -444,9 +444,9 @@
if(object == world) // Global proc.
procname = "/proc/[procname]"
return call(procname)(arglist(new_args))
return (WrapAdminProcCall(GLOBAL_PROC, procname, new_args))
return call(object, procname)(arglist(new_args))
return (WrapAdminProcCall(object, procname, new_args))
/proc/SDQL2_tokenize(query_text)
+3 -3
View File
@@ -1,7 +1,7 @@
//This is a list of words which are ignored by the parser when comparing message contents for names. MUST BE IN LOWER CASE!
var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","alien","as")
GLOBAL_LIST_INIT(adminhelp_ignored_words, list("unknown","the","a","an","of","monkey","alien","as"))
/client/verb/adminhelp()
set category = "Admin"
@@ -66,7 +66,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
for(var/original_word in msglist)
var/word = ckey(original_word)
if(word)
if(!(word in adminhelp_ignored_words))
if(!(word in GLOB.adminhelp_ignored_words))
if(word == "ai")
ai_found = 1
else
@@ -165,7 +165,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
var/admin_number_ignored = 0 //Holds the number of admins without +BAN (so admins who are not really admins)
var/admin_number_decrease = 0 //Holds the number of admins with are afk, ignored or both
for(var/client/X in GLOB.admins)
admin_number_total++;
admin_number_total++
var/invalid = 0
if(requiredflags != 0 && !check_rights_for(X, requiredflags))
admin_number_ignored++
+3 -3
View File
@@ -19,7 +19,7 @@
var/list/client/targets[0]
for(var/client/T)
if(T.mob)
if(istype(T.mob, /mob/new_player))
if(isnewplayer(T.mob))
targets["(New Player) - [T]"] = T
else if(istype(T.mob, /mob/dead/observer))
targets["[T.mob.name](Ghost) - [T]"] = T
@@ -42,7 +42,7 @@
var/list/client/targets[0]
for(var/client/T)
if(T.mob)
if(istype(T.mob, /mob/new_player))
if(isnewplayer(T.mob))
targets["[T] - (New Player)"] = T
else if(istype(T.mob, /mob/dead/observer))
targets["[T] - [T.mob.name](Ghost)"] = T
@@ -261,7 +261,7 @@
/datum/pm_tracker
var/current_title = ""
var/open = FALSE
var/list/pms = list()
var/list/datum/pm_convo/pms = list()
var/show_archived = FALSE
var/window_id = "pms_window"
+5 -5
View File
@@ -20,7 +20,7 @@
/client/proc/get_admin_say()
var/msg = input(src, null, "asay \"text\"") as text|null
cmd_admin_say(msg)
/client/proc/cmd_mentor_say(msg as text)
set category = "Admin"
set name = "Msay"
@@ -59,12 +59,12 @@
var/enabling
var/msay = /client/proc/cmd_mentor_say
if(msay in admin_verbs_mentor)
if(msay in GLOB.admin_verbs_mentor)
enabling = FALSE
admin_verbs_mentor -= msay
GLOB.admin_verbs_mentor -= msay
else
enabling = TRUE
admin_verbs_mentor += msay
GLOB.admin_verbs_mentor += msay
for(var/client/C in GLOB.admins)
if(check_rights(R_ADMIN|R_MOD, 0, C.mob))
@@ -78,5 +78,5 @@
C.verbs -= msay
to_chat(C, "<b>Mentor chat has been disabled.</b>")
admin_log_and_message_admins("toggled mentor chat [enabling ? "on" : "off"].")
log_and_message_admins("toggled mentor chat [enabling ? "on" : "off"].")
feedback_add_details("admin_verb", "TMC")
+1 -1
View File
@@ -6,7 +6,7 @@
<br>Additionally make an attempt to introduce new players to the server
<HR>"}
if(dbcon.IsConnected())
if(GLOB.dbcon.IsConnected())
for(var/client/C in GLOB.clients)
dat += "<p>[C.ckey] (Player Age: <font color = 'red'>[C.player_age]</font>) - <b>[C.computer_id]</b> / <b>[C.address]</b><br>"
if(C.related_accounts_cid.len)
+5 -5
View File
@@ -1,7 +1,6 @@
/client/proc/atmosscan()
set category = "Mapping"
set name = "Check Piping"
set background = 1
if(!src.holder)
to_chat(src, "Only administrators may use this command.")
return
@@ -12,23 +11,24 @@
to_chat(usr, "Checking for disconnected pipes...")
//all plumbing - yes, some things might get stated twice, doesn't matter.
for(var/obj/machinery/atmospherics/plumbing in world)
for(var/thing in SSair.atmos_machinery)
var/obj/machinery/atmospherics/plumbing = thing
if(plumbing.nodealert)
to_chat(usr, "Unconnected [plumbing.name] located at [plumbing.x],[plumbing.y],[plumbing.z] ([get_area(plumbing.loc)])")
//Manifolds
for(var/obj/machinery/atmospherics/pipe/manifold/pipe in world)
for(var/obj/machinery/atmospherics/pipe/manifold/pipe in SSair.atmos_machinery)
if(!pipe.node1 || !pipe.node2 || !pipe.node3)
to_chat(usr, "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")
//Pipes
for(var/obj/machinery/atmospherics/pipe/simple/pipe in world)
for(var/obj/machinery/atmospherics/pipe/simple/pipe in SSair.atmos_machinery)
if(!pipe.node1 || !pipe.node2)
to_chat(usr, "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")
to_chat(usr, "Checking for overlapping pipes...")
for(var/turf/T in world)
for(var/dir in cardinal)
for(var/dir in GLOB.cardinal)
var/list/check = list(0, 0, 0)
var/done = 0
for(var/obj/machinery/atmospherics/pipe in T)
+6 -6
View File
@@ -7,9 +7,9 @@
to_chat(src, "Only administrators may use this command.")
return
var/input = input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg) as message|null
var/input = input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", GLOB.custom_event_msg) as message|null
if(!input || input == "")
custom_event_msg = null
GLOB.custom_event_msg = null
log_admin("[key_name(usr)] has cleared the custom event text.")
message_admins("[key_name_admin(usr)] has cleared the custom event text.")
return
@@ -17,11 +17,11 @@
log_admin("[key_name(usr)] has changed the custom event text.")
message_admins("[key_name_admin(usr)] has changed the custom event text.")
custom_event_msg = input
GLOB.custom_event_msg = input
to_chat(world, "<h1 class='alert'>Custom Event</h1>")
to_chat(world, "<h2 class='alert'>A custom event is starting. OOC Info:</h2>")
to_chat(world, "<span class='alert'>[html_encode(custom_event_msg)]</span>")
to_chat(world, "<span class='alert'>[html_encode(GLOB.custom_event_msg)]</span>")
to_chat(world, "<br>")
// normal verb for players to view info
@@ -29,12 +29,12 @@
set category = "OOC"
set name = "Custom Event Info"
if(!custom_event_msg || custom_event_msg == "")
if(!GLOB.custom_event_msg || GLOB.custom_event_msg == "")
to_chat(src, "There currently is no known custom event taking place.")
to_chat(src, "Keep in mind: it is possible that an admin has not properly set this.")
return
to_chat(src, "<h1 class='alert'>Custom Event</h1>")
to_chat(src, "<h2 class='alert'>A custom event is taking place. OOC Info:</h2>")
to_chat(src, "<span class='alert'>[html_encode(custom_event_msg)]</span>")
to_chat(src, "<span class='alert'>[html_encode(GLOB.custom_event_msg)]</span>")
to_chat(src, "<br>")
+96 -45
View File
@@ -5,12 +5,12 @@
if(!check_rights(R_DEBUG))
return
if(Debug2)
Debug2 = 0
if(GLOB.debug2)
GLOB.debug2 = 0
message_admins("[key_name_admin(src)] toggled debugging off.")
log_admin("[key_name(src)] toggled debugging off.")
else
Debug2 = 1
GLOB.debug2 = 1
message_admins("[key_name_admin(src)] toggled debugging on.")
log_admin("[key_name(src)] toggled debugging on.")
@@ -85,18 +85,80 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
return
message_admins("[key_name_admin(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
log_admin("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
returnval = call(target,procname)(arglist(lst)) // Pass the lst as an argument list to the proc
returnval = WrapAdminProcCall(target, procname, lst) // Pass the lst as an argument list to the proc
else
//this currently has no hascall protection. wasn't able to get it working.
message_admins("[key_name_admin(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]")
log_admin("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]")
returnval = call(procname)(arglist(lst)) // Pass the lst as an argument list to the proc
returnval = WrapAdminProcCall(GLOBAL_PROC, procname, lst) // Pass the lst as an argument list to the proc
to_chat(usr, "<font color='blue'>[procname] returned: [!isnull(returnval) ? returnval : "null"]</font>")
feedback_add_details("admin_verb","APC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
// All these vars are related to proc call protection
// If you add more of these, for the love of fuck, protect them
/// Who is currently calling procs
GLOBAL_VAR(AdminProcCaller)
GLOBAL_PROTECT(AdminProcCaller)
/// How many procs have been called
GLOBAL_VAR_INIT(AdminProcCallCount, 0)
GLOBAL_PROTECT(AdminProcCallCount)
/// UID of the admin who last called
GLOBAL_VAR(LastAdminCalledTargetUID)
GLOBAL_PROTECT(LastAdminCalledTargetUID)
/// Last target to have a proc called on it
GLOBAL_VAR(LastAdminCalledTarget)
GLOBAL_PROTECT(LastAdminCalledTarget)
/// Last proc called
GLOBAL_VAR(LastAdminCalledProc)
GLOBAL_PROTECT(LastAdminCalledProc)
/// List to handle proc call spam prevention
GLOBAL_LIST_EMPTY(AdminProcCallSpamPrevention)
GLOBAL_PROTECT(AdminProcCallSpamPrevention)
// Wrapper for proccalls where the datum is flagged as vareditted
/proc/WrapAdminProcCall(datum/target, procname, list/arguments)
if(target && procname == "Del")
to_chat(usr, "Calling Del() is not allowed")
return
if(target != GLOBAL_PROC && !target.CanProcCall(procname))
to_chat(usr, "Proccall on [target.type]/proc/[procname] is disallowed!")
return
var/current_caller = GLOB.AdminProcCaller
var/ckey = usr ? usr.client.ckey : GLOB.AdminProcCaller
if(!ckey)
CRASH("WrapAdminProcCall with no ckey: [target] [procname] [english_list(arguments)]")
if(current_caller && current_caller != ckey)
if(!GLOB.AdminProcCallSpamPrevention[ckey])
to_chat(usr, "<span class='adminnotice'>Another set of admin called procs are still running, your proc will be run after theirs finish.</span>")
GLOB.AdminProcCallSpamPrevention[ckey] = TRUE
UNTIL(!GLOB.AdminProcCaller)
to_chat(usr, "<span class='adminnotice'>Running your proc</span>")
GLOB.AdminProcCallSpamPrevention -= ckey
else
UNTIL(!GLOB.AdminProcCaller)
GLOB.LastAdminCalledProc = procname
if(target != GLOBAL_PROC)
GLOB.LastAdminCalledTargetUID = target.UID()
GLOB.AdminProcCaller = ckey //if this runtimes, too bad for you
++GLOB.AdminProcCallCount
. = world.WrapAdminProcCall(target, procname, arguments)
if(--GLOB.AdminProcCallCount == 0)
GLOB.AdminProcCaller = null
//adv proc call this, ya nerds
/world/proc/WrapAdminProcCall(datum/target, procname, list/arguments)
if(target == GLOBAL_PROC)
return call(procname)(arglist(arguments))
else if(target != world)
return call(target, procname)(arglist(arguments))
else
to_chat(usr, "<span class='boldannounce'>Call to world/proc/[procname] blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to call world/proc/[procname] with arguments: [english_list(arguments)]")
log_admin("[key_name(usr)] attempted to call world/proc/[procname] with arguments: [english_list(arguments)]l")
/proc/IsAdminAdvancedProcCall()
#ifdef TESTING
@@ -131,7 +193,7 @@ GLOBAL_PROTECT(AdminProcCaller)
log_admin("[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]")
spawn()
var/returnval = call(A,procname)(arglist(lst)) // Pass the lst as an argument list to the proc
var/returnval = WrapAdminProcCall(A, procname, lst) // Pass the lst as an argument list to the proc
to_chat(src, "<span class='notice'>[procname] returned: [!isnull(returnval) ? returnval : "null"]</span>")
feedback_add_details("admin_verb","DPC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -251,7 +313,7 @@ GLOBAL_PROTECT(AdminProcCaller)
alert("That mob doesn't seem to exist, close the panel and try again.")
return
if(istype(M, /mob/new_player))
if(isnewplayer(M))
alert("The mob must not be a new_player.")
return
@@ -291,9 +353,9 @@ GLOBAL_PROTECT(AdminProcCaller)
pai.real_name = pai.name
pai.key = choice.key
card.setPersonality(pai)
for(var/datum/paiCandidate/candidate in paiController.pai_candidates)
for(var/datum/paiCandidate/candidate in GLOB.paiController.pai_candidates)
if(candidate.key == choice.key)
paiController.pai_candidates.Remove(candidate)
GLOB.paiController.pai_candidates.Remove(candidate)
feedback_add_details("admin_verb","MPAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_alienize(var/mob/M in GLOB.mob_list)
@@ -382,7 +444,7 @@ GLOBAL_PROTECT(AdminProcCaller)
if(!check_rights(R_DEBUG))
return
//This gets a confirmation check because it's way easier to accidentally hit this and delete things than it is with del-all
//This gets a confirmation check because it's way easier to accidentally hit this and delete things than it is with qdel-all
var/confirm = alert("This will delete ALL Singularities and Tesla orbs except for any that are on away mission z-levels or the centcomm z-level. Are you sure you want to delete them?", "Confirm Panic Button", "Yes", "No")
if(confirm != "Yes")
return
@@ -428,7 +490,7 @@ GLOBAL_PROTECT(AdminProcCaller)
id.icon_state = "gold"
id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access()
else
var/obj/item/card/id/id = new/obj/item/card/id(M);
var/obj/item/card/id/id = new/obj/item/card/id(M)
id.icon_state = "gold"
id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access()
id.registered_name = H.real_name
@@ -487,7 +549,8 @@ GLOBAL_PROTECT(AdminProcCaller)
for(var/area/A in world)
areas_all |= A.type
for(var/obj/machinery/power/apc/APC in world)
for(var/thing in GLOB.apcs)
var/obj/machinery/power/apc/APC = thing
var/area/A = get_area(APC)
if(!A)
continue
@@ -496,7 +559,8 @@ GLOBAL_PROTECT(AdminProcCaller)
else
areas_with_multiple_APCs |= A.type
for(var/obj/machinery/alarm/alarm in world)
for(var/thing in GLOB.air_alarms)
var/obj/machinery/alarm/alarm = thing
var/area/A = get_area(alarm)
if(!A)
continue
@@ -505,31 +569,31 @@ GLOBAL_PROTECT(AdminProcCaller)
else
areas_with_multiple_air_alarms |= A.type
for(var/obj/machinery/requests_console/RC in world)
for(var/obj/machinery/requests_console/RC in GLOB.machines)
var/area/A = get_area(RC)
if(!A)
continue
areas_with_RC |= A.type
for(var/obj/machinery/light/L in world)
for(var/obj/machinery/light/L in GLOB.machines)
var/area/A = get_area(L)
if(!A)
continue
areas_with_light |= A.type
for(var/obj/machinery/light_switch/LS in world)
for(var/obj/machinery/light_switch/LS in GLOB.machines)
var/area/A = get_area(LS)
if(!A)
continue
areas_with_LS |= A.type
for(var/obj/item/radio/intercom/I in world)
for(var/obj/item/radio/intercom/I in GLOB.global_radios)
var/area/A = get_area(I)
if(!A)
continue
areas_with_intercom |= A.type
for(var/obj/machinery/camera/C in world)
for(var/obj/machinery/camera/C in GLOB.machines)
var/area/A = get_area(C)
if(!A)
continue
@@ -716,23 +780,25 @@ GLOBAL_PROTECT(AdminProcCaller)
if(!check_rights(R_DEBUG))
return
switch(input("Which list?") in list("Players","Admins","Mobs","Living Mobs","Dead Mobs","Silicons","Clients","Respawnable Mobs"))
switch(input("Which list?") in list("Players", "Admins", "Mobs", "Living Mobs", "Alive Mobs", "Dead Mobs", "Silicons", "Clients", "Respawnable Mobs"))
if("Players")
to_chat(usr, jointext(GLOB.player_list,","))
to_chat(usr, jointext(GLOB.player_list, ","))
if("Admins")
to_chat(usr, jointext(GLOB.admins,","))
to_chat(usr, jointext(GLOB.admins, ","))
if("Mobs")
to_chat(usr, jointext(GLOB.mob_list,","))
to_chat(usr, jointext(GLOB.mob_list, ","))
if("Living Mobs")
to_chat(usr, jointext(GLOB.living_mob_list,","))
to_chat(usr, jointext(GLOB.mob_living_list, ","))
if("Alive Mobs")
to_chat(usr, jointext(GLOB.alive_mob_list, ","))
if("Dead Mobs")
to_chat(usr, jointext(GLOB.dead_mob_list,","))
to_chat(usr, jointext(GLOB.dead_mob_list, ","))
if("Silicons")
to_chat(usr, jointext(GLOB.silicon_mob_list,","))
to_chat(usr, jointext(GLOB.silicon_mob_list, ","))
if("Clients")
to_chat(usr, jointext(GLOB.clients,","))
to_chat(usr, jointext(GLOB.clients, ","))
if("Respawnable Mobs")
to_chat(usr, jointext(GLOB.respawnable_list,","))
to_chat(usr, jointext(GLOB.respawnable_list, ","))
/client/proc/cmd_display_del_log()
set category = "Debug"
@@ -806,36 +872,21 @@ GLOBAL_PROTECT(AdminProcCaller)
genemutcheck(M,block,null,MUTCHK_FORCED)
M.update_mutations()
var/state="[M.dna.GetSEState(block)?"on":"off"]"
var/blockname=assigned_blocks[block]
var/blockname=GLOB.assigned_blocks[block]
message_admins("[key_name_admin(src)] has toggled [M.key]'s [blockname] block [state]!")
log_admin("[key_name(src)] has toggled [M.key]'s [blockname] block [state]!")
else
alert("Invalid mob")
/client/proc/reload_nanoui_resources()
set category = "Debug"
set name = "Reload NanoUI Resources"
set desc = "Force the client to redownload NanoUI Resources"
// Close open NanoUIs.
SSnanoui.close_user_uis(usr)
// Re-load the assets.
var/datum/asset/assets = get_asset_datum(/datum/asset/nanoui)
assets.register()
// Clear the user's cache so they get resent.
usr.client.cache = list()
/client/proc/view_runtimes()
set category = "Debug"
set name = "View Runtimes"
set desc = "Open the Runtime Viewer"
if(!check_rights(R_DEBUG))
if(!check_rights(R_DEBUG|R_VIEWRUNTIMES))
return
error_cache.showTo(usr)
GLOB.error_cache.showTo(usr)
/client/proc/jump_to_ruin()
set category = "Debug"
+6 -8
View File
@@ -15,12 +15,10 @@
if(T.active_hotspot)
burning = 1
to_chat(usr, "<span class='notice'>@[target.x],[target.y]: O:[GM.oxygen] T:[GM.toxins] N:[GM.nitrogen] C:[GM.carbon_dioxide] w [GM.temperature] Kelvin, [GM.return_pressure()] kPa [(burning)?("<span class='warning'>BURNING</span>"):(null)]</span>")
for(var/datum/gas/trace_gas in GM.trace_gases)
to_chat(usr, "[trace_gas.type]: [trace_gas.moles]")
to_chat(usr, "<span class='notice'>@[target.x],[target.y]: O:[GM.oxygen] T:[GM.toxins] N:[GM.nitrogen] C:[GM.carbon_dioxide] N2O: [GM.sleeping_agent] Agent B: [GM.agent_b] w [GM.temperature] Kelvin, [GM.return_pressure()] kPa [(burning)?("<span class='warning'>BURNING</span>"):(null)]</span>")
message_admins("[key_name_admin(usr)] has checked the air status of [T]")
log_admin("[key_name(usr)] has checked the air status of [T]")
message_admins("[key_name_admin(usr)] has checked the air status of [target]")
log_admin("[key_name(usr)] has checked the air status of [target]")
feedback_add_details("admin_verb","DAST") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -85,7 +83,7 @@
var/output = "<b>Radio Report</b><hr>"
for(var/fq in SSradio.frequencies)
output += "<b>Freq: [fq]</b><br>"
var/list/datum/radio_frequency/fqs = SSradio.frequencies[fq]
var/datum/radio_frequency/fqs = SSradio.frequencies[fq]
if(!fqs)
output += "&nbsp;&nbsp;<b>ERROR</b><br>"
continue
@@ -131,7 +129,7 @@
return
to_chat(usr, "<b>Jobbans active in this round.</b>")
for(var/t in jobban_keylist)
for(var/t in GLOB.jobban_keylist)
to_chat(usr, "[t]")
message_admins("[key_name_admin(usr)] has printed the jobban log")
@@ -150,7 +148,7 @@
return
to_chat(usr, "<b>Jobbans active in this round.</b>")
for(var/t in jobban_keylist)
for(var/t in GLOB.jobban_keylist)
if(findtext(t, filter))
to_chat(usr, "[t]")
+67 -89
View File
@@ -5,121 +5,99 @@
//////Allows admin's to right click on any mob/mech and freeze them in place.///
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
var/global/list/frozen_mob_list = list()
/client/proc/freeze(var/mob/living/M as mob in GLOB.mob_list)
GLOBAL_LIST_EMPTY(frozen_atom_list) // A list of admin-frozen atoms.
/client/proc/freeze(atom/movable/M)
set name = "Freeze"
set category = null
if(!check_rights(R_ADMIN))
return
if(!istype(M))
return
M.admin_Freeze(src)
if(M in frozen_mob_list)
M.admin_unFreeze(src)
else
M.admin_Freeze(src)
/// Created here as a base proc. Override as needed for any type of object or mob you want able to be frozen.
/atom/movable/proc/admin_Freeze(client/admin)
to_chat(admin, "<span class='warning'>Freeze is not able to be called on this type of object.</span")
return
///mob freeze procs
/mob/living/var/frozen = null //used for preventing attacks on admin-frozen mobs
/mob/living/var/admin_prev_sleeping = 0 //used for keeping track of previous sleeping value with admin freeze
/mob/living
/// Used for preventing attacks on admin-frozen mobs.
var/frozen = null
/// Used for keeping track of previous sleeping value with admin freeze.
var/admin_prev_sleeping = 0
/mob/living/proc/admin_Freeze(client/admin, skip_overlays = FALSE)
if(istype(admin))
to_chat(src, "<b><font color= red>You have been frozen by [admin]</b></font>")
message_admins("<span class='notice'>[key_name_admin(admin)]</span> froze [key_name_admin(src)]")
log_admin("[key_name(admin)] froze [key_name(src)]")
/mob/living/admin_Freeze(client/admin, skip_overlays = FALSE, mech = null)
if(!istype(admin))
return
var/obj/effect/overlay/adminoverlay/AO = new
if(skip_overlays)
overlays += AO
if(!(src in GLOB.frozen_atom_list))
GLOB.frozen_atom_list += src
anchored = TRUE
canmove = FALSE
admin_prev_sleeping = sleeping
AdjustSleeping(20000)
frozen = AO
if(!(src in frozen_mob_list))
frozen_mob_list += src
var/obj/effect/overlay/adminoverlay/AO = new
if(skip_overlays)
overlays += AO
/mob/living/proc/admin_unFreeze(client/admin, skip_overlays = FALSE)
if(istype(admin))
to_chat(src, "<b><font color= red>You have been unfrozen by [admin]</b></font>")
message_admins("<span class='notice'>[key_name_admin(admin)] unfroze [key_name_admin(src)]</span>")
log_admin("[key_name(admin)] unfroze [key_name(src)]")
anchored = TRUE
canmove = FALSE
admin_prev_sleeping = sleeping
AdjustSleeping(20000)
frozen = AO
if(skip_overlays)
overlays -= frozen
else
GLOB.frozen_atom_list -= src
anchored = FALSE
canmove = TRUE
frozen = null
SetSleeping(admin_prev_sleeping)
admin_prev_sleeping = null
if(src in frozen_mob_list)
frozen_mob_list -= src
if(skip_overlays)
overlays -= frozen
anchored = FALSE
canmove = TRUE
frozen = null
SetSleeping(admin_prev_sleeping)
admin_prev_sleeping = null
to_chat(src, "<b><font color= red>You have been [frozen ? "frozen" : "unfrozen"] by [admin]</b></font>")
message_admins("<span class='notice'>[key_name_admin(admin)] [frozen ? "froze" : "unfroze"] [key_name_admin(src)] [mech ? "in a [mech]" : ""]</span>")
log_admin("[key_name(admin)] [frozen ? "froze" : "unfroze"] [key_name(src)] [mech ? "in a [mech]" : ""]")
update_icons()
return frozen
/mob/living/simple_animal/slime/admin_Freeze(admin)
..(admin)
adjustHealth(1000) //arbitrary large value
/mob/living/simple_animal/slime/admin_unFreeze(admin)
..(admin)
revive()
if(..()) // The result of the parent call here will be the value of the mob's `frozen` variable after they get (un)frozen.
adjustHealth(1000) //arbitrary large value
else
revive()
/mob/living/simple_animal/var/admin_prev_health = null
/mob/living/simple_animal/admin_Freeze(admin)
..(admin)
admin_prev_health = health
health = 0
/mob/living/simple_animal/admin_unFreeze(admin)
..(admin)
revive()
overlays.Cut()
if(..()) // The result of the parent call here will be the value of the mob's `frozen` variable after they get (un)frozen.
admin_prev_health = health
health = 0
else
revive()
overlays.Cut()
//////////////////////////Freeze Mech
/client/proc/freezemecha(var/obj/mecha/O as obj in GLOB.mechas_list)
set name = "Freeze Mech"
set category = null
if(!check_rights(R_ADMIN))
return
var/obj/mecha/M = O
if(!istype(M,/obj/mecha))
to_chat(src, "<span class='danger'>This can only be used on mechs!</span>")
return
/obj/mecha/admin_Freeze(client/admin)
var/obj/effect/overlay/adminoverlay/freeze_overlay = new
if(!frozen)
GLOB.frozen_atom_list += src
frozen = TRUE
overlays += freeze_overlay
else
if(usr)
if(usr.client)
if(usr.client.holder)
var/adminomaly = new/obj/effect/overlay/adminoverlay
if(M.can_move == 1)
M.can_move = 0
M.overlays += adminomaly
if(M.occupant)
to_chat(M.occupant, "<b><font color= red>You have been frozen by <a href='?priv_msg=[usr.client.UID()]'>[key]</a></b></font>")
message_admins("<span class='notice'>[key_name_admin(usr)] froze [key_name(M.occupant)] in a [M.name]</span>")
log_admin("[key_name(usr)] froze [key_name(M.occupant)] in a [M.name]")
else
message_admins("<span class='notice'>[key_name_admin(usr)] froze an empty [M.name]</span>")
log_admin("[key_name(usr)] froze an empty [M.name]")
else if(M.can_move == 0)
M.can_move = 1
M.overlays -= adminomaly
if(M.occupant)
to_chat(M.occupant, "<b><font color= red>You have been unfrozen by <a href='?priv_msg=[usr.client.UID()]'>[key]</a></b></font>")
message_admins("<span class='notice'>[key_name_admin(usr)] unfroze [key_name(M.occupant)] in a [M.name]</span>")
log_admin("[key_name(usr)] unfroze [key_name(M.occupant)] in a [M.name]")
else
message_admins("<span class='notice'>[key_name_admin(usr)] unfroze an empty [M.name]</span>")
log_admin("[key_name(usr)] unfroze an empty [M.name]")
GLOB.frozen_atom_list -= src
frozen = FALSE
overlays -= freeze_overlay
if(occupant)
occupant.admin_Freeze(admin, mech = name) // We also want to freeze the driver of the mech.
else
message_admins("<span class='notice'>[key_name_admin(admin)] [frozen ? "froze" : "unfroze"] an empty [name]</span>")
log_admin("[key_name(admin)] [frozen ? "froze" : "unfroze"] an empty [name]")
+1 -1
View File
@@ -27,7 +27,7 @@
if(!themission)
alert("No mission specified. Aborting.")
return
var/admin_outfits = subtypesof(/datum/outfit/admin)
var/admin_outfits = subtypesof(/datum/outfit/admin) + list(/datum/outfit/naked)
var/outfit_list = list()
for(var/type in admin_outfits)
var/datum/outfit/admin/O = type
+6 -5
View File
@@ -1,7 +1,7 @@
//HONKsquad
#define HONKSQUAD_POSSIBLE 6 //if more Commandos are needed in the future
var/global/sent_honksquad = 0
GLOBAL_VAR_INIT(sent_honksquad, 0)
/client/proc/honksquad()
if(!SSticker)
@@ -10,7 +10,7 @@ var/global/sent_honksquad = 0
if(world.time < 6000)
to_chat(usr, "<font color='red'>There are [(6000-world.time)/10] seconds remaining before it may be called.</font>")
return
if(sent_honksquad == 1)
if(GLOB.sent_honksquad == 1)
to_chat(usr, "<font color='red'>Clown Planet has already dispatched a HONKsquad.</font>")
return
if(alert("Do you want to send in the HONKsquad? Once enabled, this is irreversible.",,"Yes","No")!="Yes")
@@ -24,11 +24,11 @@ var/global/sent_honksquad = 0
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
if(sent_honksquad)
if(GLOB.sent_honksquad)
to_chat(usr, "Looks like someone beat you to it. HONK.")
return
sent_honksquad = 1
GLOB.sent_honksquad = 1
var/honksquad_number = HONKSQUAD_POSSIBLE //for selecting a leader
@@ -48,7 +48,8 @@ var/global/sent_honksquad = 0
commandos += candidate//Add their ghost to commandos.
//Spawns HONKsquad and equips them.
for(var/obj/effect/landmark/L in GLOB.landmarks_list)
for(var/thing in GLOB.landmarks_list)
var/obj/effect/landmark/L = thing
if(honksquad_number<=0) break
if(L.name == "HONKsquad")
honk_leader_selected = honksquad_number == 1?1:0
@@ -1,7 +1,7 @@
// Syndicate Infiltration Team (SIT)
// A little like Syndicate Strike Team (SST) but geared towards stealthy team missions rather than murderbone.
var/global/sent_syndicate_infiltration_team = 0
GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0)
/client/proc/syndicate_infiltration_team()
set category = "Event"
@@ -35,7 +35,7 @@ var/global/sent_syndicate_infiltration_team = 0
var/tctext = input(src, "How much TC do you want to give each team member? Suggested: 20-30. They cannot trade TC.") as num
var/tcamount = text2num(tctext)
tcamount = between(0, tcamount, 1000)
if(sent_syndicate_infiltration_team == 1)
if(GLOB.sent_syndicate_infiltration_team == 1)
if(alert("A Syndicate Infiltration Team has already been sent. Sure you want to send another?",,"Yes","No")=="No")
return
@@ -61,12 +61,13 @@ var/global/sent_syndicate_infiltration_team = 0
to_chat(src, "Nobody volunteered.")
return 0
sent_syndicate_infiltration_team = 1
GLOB.sent_syndicate_infiltration_team = 1
var/list/sit_spawns = list()
var/list/sit_spawns_leader = list()
var/list/sit_spawns_mgmt = list()
for(var/obj/effect/landmark/L in GLOB.landmarks_list)
for(var/thing in GLOB.landmarks_list)
var/obj/effect/landmark/L = thing
if(L.name == "Syndicate-Infiltrator")
sit_spawns += L
if(L.name == "Syndicate-Infiltrator-Leader")
@@ -90,7 +91,7 @@ var/global/sent_syndicate_infiltration_team = 0
to_chat(new_syndicate_infiltrator, "<span class='danger'>You are a [!syndicate_leader_selected?"Infiltrator":"<B>Lead Infiltrator</B>"] in the service of the Syndicate. \nYour current mission is: <B>[input]</B></span>")
to_chat(new_syndicate_infiltrator, "<span class='notice'>You are equipped with an uplink implant to help you achieve your objectives. ((activate it via button in top left of screen))</span>")
new_syndicate_infiltrator.faction += "syndicate"
data_core.manifest_inject(new_syndicate_infiltrator)
GLOB.data_core.manifest_inject(new_syndicate_infiltrator)
if(syndicate_leader_selected)
var/obj/effect/landmark/warpto = pick(sit_spawns_leader)
new_syndicate_infiltrator.loc = warpto.loc
@@ -104,7 +105,7 @@ var/global/sent_syndicate_infiltration_team = 0
new_syndicate_infiltrator.mind.store_memory("<B>Mission:</B> [input] ")
new_syndicate_infiltrator.mind.store_memory("<B>Team Leader:</B> [team_leader] ")
new_syndicate_infiltrator.mind.store_memory("<B>Starting Equipment:</B> <BR>- Syndicate Headset ((.h for your radio))<BR>- Chameleon Jumpsuit ((right click to Change Color))<BR> - Agent ID card ((disguise as another job))<BR> - Uplink Implant ((top left of screen)) <BR> - Dust Implant ((destroys your body on death)) <BR> - Combat Gloves ((insulated, disguised as black gloves)) <BR> - Anything bought with your uplink implant")
var/datum/atom_hud/antag/opshud = huds[ANTAG_HUD_OPS]
var/datum/atom_hud/antag/opshud = GLOB.huds[ANTAG_HUD_OPS]
opshud.join_hud(new_syndicate_infiltrator.mind.current)
set_antag_hud(new_syndicate_infiltrator.mind.current, "hudoperative")
new_syndicate_infiltrator.regenerate_icons()
+11
View File
@@ -0,0 +1,11 @@
GLOBAL_LIST_INIT(open_logging_views, list())
/client/proc/cmd_admin_open_logging_view()
set category = "Admin"
set name = "Open Logging View"
set desc = "Opens the detailed logging viewer"
if(!GLOB.open_logging_views[usr.client.ckey])
GLOB.open_logging_views[usr.client.ckey] = new /datum/log_viewer()
var/datum/log_viewer/LV = GLOB.open_logging_views[usr.client.ckey]
LV.show_ui(usr)
@@ -6,10 +6,10 @@
return
var/datum/map_template/template
var/map = input(usr, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template") as null|anything in map_templates
var/map = input(usr, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template") as null|anything in GLOB.map_templates
if(!map)
return
template = map_templates[map]
template = GLOB.map_templates[map]
var/turf/T = get_turf(mob)
if(!T)
@@ -48,7 +48,7 @@
var/datum/map_template/M = new(map=map, rename="[map]")
if(M.preload_size(map))
to_chat(usr, "Map template '[map]' ready to place ([M.width]x[M.height])")
map_templates[M.name] = M
GLOB.map_templates[M.name] = M
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has uploaded a map template ([map]). Took [stop_watch(timer)]s.</span>")
else
to_chat(usr, "Map template '[map]' failed to load properly")
+13 -13
View File
@@ -19,8 +19,8 @@
//- Identify how hard it is to break into the area and where the weak points are
//- Check if the area has too much empty space. If so, make it smaller and replace the rest with maintenance tunnels.
var/camera_range_display_status = 0
var/intercom_range_display_status = 0
GLOBAL_VAR_INIT(camera_range_display_status, 0)
GLOBAL_VAR_INIT(intercom_range_display_status, 0)
/obj/effect/debugging/camera_range
icon = 'icons/480x480.dmi'
@@ -50,16 +50,16 @@ var/intercom_range_display_status = 0
if(!check_rights(R_DEBUG))
return
if(camera_range_display_status)
camera_range_display_status = 0
if(GLOB.camera_range_display_status)
GLOB.camera_range_display_status = 0
else
camera_range_display_status = 1
GLOB.camera_range_display_status = 1
for(var/obj/effect/debugging/camera_range/C in world)
qdel(C)
if(camera_range_display_status)
for(var/obj/machinery/camera/C in cameranet.cameras)
if(GLOB.camera_range_display_status)
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
new/obj/effect/debugging/camera_range(C.loc)
feedback_add_details("admin_verb","mCRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -72,7 +72,7 @@ var/intercom_range_display_status = 0
var/list/obj/machinery/camera/CL = list()
for(var/obj/machinery/camera/C in cameranet.cameras)
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
CL += C
var/output = {"<B>CAMERA ANOMALIES REPORT</B><HR>
@@ -109,16 +109,16 @@ var/intercom_range_display_status = 0
if(!check_rights(R_DEBUG))
return
if(intercom_range_display_status)
intercom_range_display_status = 0
if(GLOB.intercom_range_display_status)
GLOB.intercom_range_display_status = 0
else
intercom_range_display_status = 1
GLOB.intercom_range_display_status = 1
for(var/obj/effect/debugging/marker/M in world)
qdel(M)
if(intercom_range_display_status)
for(var/obj/item/radio/intercom/I in world)
if(GLOB.intercom_range_display_status)
for(var/obj/item/radio/intercom/I in GLOB.global_radios)
for(var/turf/T in orange(7,I))
var/obj/effect/debugging/marker/F = new/obj/effect/debugging/marker(T)
if(!(F in view(7,I.loc)))
+4 -4
View File
@@ -45,16 +45,16 @@
var/default
var/var_value = O.vars[variable]
if(variable in VVckey_edit)
if(variable in GLOB.VVckey_edit)
to_chat(src, "It's forbidden to mass-modify ckeys. It'll crash everyone's client you dummy.")
return
if(variable in VVlocked)
if(variable in GLOB.VVlocked)
if(!check_rights(R_DEBUG))
return
if(variable in VVicon_edit_lock)
if(variable in GLOB.VVicon_edit_lock)
if(!check_rights(R_EVENT | R_DEBUG))
return
if(variable in VVpixelmovement)
if(variable in GLOB.VVpixelmovement)
if(!check_rights(R_DEBUG))
return
var/prompt = alert(src, "Editing this var may irreparably break tile gliding for the rest of the round. THIS CAN'T BE UNDONE", "DANGER", "ABORT ", "Continue", " ABORT")
+10 -9
View File
@@ -1,7 +1,7 @@
var/list/VVlocked = list("vars", "var_edited", "client", "firemut", "ishulk", "telekinesis", "xray", "ka", "virus", "viruses", "cuffed", "last_eaten", "unlock_content") // R_DEBUG
var/list/VVicon_edit_lock = list("icon", "icon_state", "overlays", "underlays", "resize") // R_EVENT | R_DEBUG
var/list/VVckey_edit = list("key", "ckey") // R_EVENT | R_DEBUG
var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height", "bound_width", "bound_x", "bound_y") // R_DEBUG + warning
GLOBAL_LIST_INIT(VVlocked, list("vars", "var_edited", "client", "firemut", "ishulk", "telekinesis", "xray", "ka", "virus", "viruses", "cuffed", "last_eaten", "unlock_content")) // R_DEBUG
GLOBAL_LIST_INIT(VVicon_edit_lock, list("icon", "icon_state", "overlays", "underlays", "resize")) // R_EVENT | R_DEBUG
GLOBAL_LIST_INIT(VVckey_edit, list("key", "ckey")) // R_EVENT | R_DEBUG
GLOBAL_LIST_INIT(VVpixelmovement, list("step_x", "step_y", "step_size", "bound_height", "bound_width", "bound_x", "bound_y")) // R_DEBUG + warning
/client/proc/vv_get_class(var/var_value)
if(isnull(var_value))
. = VV_NULL
@@ -517,16 +517,16 @@ var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height",
message_admins("[key_name_admin(src)] modified [original_name]'s varlist [objectvar]: [original_var]=[new_var]")
/proc/vv_varname_lockcheck(param_var_name)
if(param_var_name in VVlocked)
if(param_var_name in GLOB.VVlocked)
if(!check_rights(R_DEBUG))
return FALSE
if(param_var_name in VVckey_edit)
if(param_var_name in GLOB.VVckey_edit)
if(!check_rights(R_EVENT | R_DEBUG))
return FALSE
if(param_var_name in VVicon_edit_lock)
if(param_var_name in GLOB.VVicon_edit_lock)
if(!check_rights(R_EVENT | R_DEBUG))
return FALSE
if(param_var_name in VVpixelmovement)
if(param_var_name in GLOB.VVpixelmovement)
if(!check_rights(R_DEBUG))
return FALSE
var/prompt = alert(usr, "Editing this var may irreparably break tile gliding for the rest of the round. THIS CAN'T BE UNDONE", "DANGER", "ABORT ", "Continue", " ABORT")
@@ -543,7 +543,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height",
var/var_value
if(param_var_name)
if(!param_var_name in O.vars)
if(!(param_var_name in O.vars))
to_chat(src, "A variable with this name ([param_var_name]) doesn't exist in this datum ([O])")
return
variable = param_var_name
@@ -627,6 +627,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height",
if(!O.vv_edit_var(variable, var_new))
to_chat(src, "Your edit was rejected by the object.")
return
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_VAR_EDIT, args)
log_world("### VarEdit by [src]: [O.type] [variable]=[html_encode("[var_new]")]")
log_admin("[key_name(src)] modified [original_name]'s [variable] to [var_new]")
var/msg = "[key_name_admin(src)] modified [original_name]'s [variable] to [var_new]"
+11 -9
View File
@@ -177,11 +177,11 @@ client/proc/one_click_antag()
H = pick(candidates)
SSticker.mode.add_cultist(H.mind)
candidates.Remove(H)
if(!summon_spots.len)
while(summon_spots.len < SUMMON_POSSIBILITIES)
var/area/summon = pick(return_sorted_areas() - summon_spots)
if(!GLOB.summon_spots.len)
while(GLOB.summon_spots.len < SUMMON_POSSIBILITIES)
var/area/summon = pick(return_sorted_areas() - GLOB.summon_spots)
if(summon && is_station_level(summon.z) && summon.valid_territory)
summon_spots += summon
GLOB.summon_spots += summon
return 1
return 0
@@ -267,7 +267,7 @@ client/proc/one_click_antag()
var/I = image('icons/mob/mob.dmi', loc = synd_mind_1.current, icon_state = "synd")
synd_mind.current.client.images += I
for(var/obj/machinery/nuclearbomb/bomb in world)
for(var/obj/machinery/nuclearbomb/bomb in GLOB.machines)
bomb.r_code = nuke_code // All the nukes are set to this code.
return 1
@@ -379,7 +379,7 @@ client/proc/one_click_antag()
if(!G_found || !G_found.key) return
//First we spawn a dude.
var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned.
var/mob/living/carbon/human/new_character = new(pick(GLOB.latejoin))//The mob being spawned.
var/datum/preferences/A = new(G_found.client)
A.copy_to(new_character)
@@ -455,7 +455,8 @@ client/proc/one_click_antag()
if(candidates.len)
var/raiders = min(antnum, candidates.len)
//Spawns vox raiders and equips them.
for(var/obj/effect/landmark/L in world)
for(var/thing in GLOB.landmarks_list)
var/obj/effect/landmark/L = thing
if(L.name == "voxstart")
if(raiders<=0)
break
@@ -513,7 +514,7 @@ client/proc/one_click_antag()
//Now apply cortical stack.
var/obj/item/implant/cortical/I = new(new_vox)
I.implant(new_vox)
cortical_stacks += I
GLOB.cortical_stacks += I
new_vox.equip_vox_raider()
new_vox.regenerate_icons()
@@ -583,7 +584,8 @@ client/proc/one_click_antag()
var/teamOneMembers = 5
var/teamTwoMembers = 5
var/datum/preferences/A = new()
for(var/obj/effect/landmark/L in world)
for(var/thing in GLOB.landmarks_list)
var/obj/effect/landmark/L = thing
if(L.name == "tdome1")
if(teamOneMembers<=0)
break
+2 -2
View File
@@ -54,7 +54,7 @@
message_admins("[key_name_admin(usr)] used THERE CAN BE ONLY ONE! -NO ATTACK LOGS WILL BE SENT TO ADMINS FROM THIS POINT FORTH-", 1)
log_admin("[key_name(usr)] used there can be only one.")
nologevent = 1
GLOB.nologevent = 1
world << sound('sound/music/thunderdome.ogg')
/client/proc/only_me()
@@ -100,5 +100,5 @@
message_admins("[key_name_admin(usr)] used THERE CAN BE ONLY ME! -NO ATTACK LOGS WILL BE SENT TO ADMINS FROM THIS POINT FORTH-", 1)
log_admin("[key_name(usr)] used there can be only me.")
nologevent = 1
GLOB.nologevent = 1
world << sound('sound/music/thunderdome.ogg')
+11 -10
View File
@@ -29,7 +29,7 @@
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes)
if(!team_toggle)
team_alpha += H
GLOB.team_alpha += H
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/red/dodgeball(H), slot_w_uniform)
var/obj/item/card/id/W = new(H)
@@ -42,7 +42,7 @@
H.equip_to_slot_or_del(W, slot_wear_id)
else
team_bravo += H
GLOB.team_bravo += H
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/blue/dodgeball(H), slot_w_uniform)
var/obj/item/card/id/W = new(H)
@@ -60,7 +60,7 @@
message_admins("[key_name_admin(usr)] used DODGEBAWWWWWWWL! -NO ATTACK LOGS WILL BE SENT TO ADMINS FROM THIS POINT FORTH-", 1)
log_admin("[key_name(usr)] used dodgeball.")
nologevent = 1
GLOB.nologevent = 1
/obj/item/beach_ball/dodgeball
name = "dodgeball"
@@ -73,20 +73,21 @@
..()
if((ishuman(hit_atom)))
var/mob/living/carbon/human/H = hit_atom
if(H.r_hand == src) return
if(H.l_hand == src) return
var/mob/A = H.LAssailant
if((H in team_alpha) && (A in team_alpha))
if(H.r_hand == src)
return
if(H.l_hand == src)
return
var/mob/A = thrownby
if((H in GLOB.team_alpha) && (A in GLOB.team_alpha))
to_chat(A, "<span class='warning'>He's on your team!</span>")
return
else if((H in team_bravo) && (A in team_bravo))
else if((H in GLOB.team_bravo) && (A in GLOB.team_bravo))
to_chat(A, "<span class='warning'>He's on your team!</span>")
return
else if(!A in team_alpha && !A in team_bravo)
else if(!(A in GLOB.team_alpha) && !(A in GLOB.team_bravo))
to_chat(A, "<span class='warning'>You're not part of the dodgeball game, sorry!</span>")
return
else
playsound(src, 'sound/items/dodgeball.ogg', 50, 1)
visible_message("<span class='danger'>[H] HAS BEEN ELIMINATED!</span>")
H.melt()
return
+6 -6
View File
@@ -1,4 +1,4 @@
var/list/sounds_cache = list()
GLOBAL_LIST_EMPTY(sounds_cache)
/client/proc/stop_global_admin_sounds()
set category = "Event"
@@ -21,7 +21,7 @@ var/list/sounds_cache = list()
var/sound/uploaded_sound = sound(S, repeat = 0, wait = 1, channel = CHANNEL_ADMIN)
uploaded_sound.priority = 250
sounds_cache += S
GLOB.sounds_cache += S
if(alert("Are you sure?\nSong: [S]\nNow you can also play this sound using \"Play Server Sound\".", "Confirmation request" ,"Play", "Cancel") == "Cancel")
return
@@ -53,8 +53,8 @@ var/list/sounds_cache = list()
set name = "Play Server Sound"
if(!check_rights(R_SOUNDS)) return
var/list/sounds = file2list("sound/serversound_list.txt");
sounds += sounds_cache
var/list/sounds = file2list("sound/serversound_list.txt")
sounds += GLOB.sounds_cache
var/melody = input("Select a sound from the server to play", "Server sound list") as null|anything in sounds
if(!melody) return
@@ -71,8 +71,8 @@ var/list/sounds_cache = list()
var/A = alert("This will play a sound at every intercomm, are you sure you want to continue? This works best with short sounds, beware.","Warning","Yep","Nope")
if(A != "Yep") return
var/list/sounds = file2list("sound/serversound_list.txt");
sounds += sounds_cache
var/list/sounds = file2list("sound/serversound_list.txt")
sounds += GLOB.sounds_cache
var/melody = input("Select a sound from the server to play", "Server sound list") as null|anything in sounds
if(!melody) return
+19 -17
View File
@@ -33,7 +33,7 @@
//teleport person to cell
M.Paralyse(5)
sleep(5) //so they black out before warping
M.loc = pick(prisonwarp)
M.loc = pick(GLOB.prisonwarp)
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/prisoner = M
prisoner.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(prisoner), slot_w_uniform)
@@ -361,8 +361,8 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(G_found.mind.assigned_role=="Alien")
if(alert("This character appears to have been an alien. Would you like to respawn them as such?",,"Yes","No")=="Yes")
var/turf/T
if(xeno_spawn.len) T = pick(xeno_spawn)
else T = pick(latejoin)
if(GLOB.xeno_spawn.len) T = pick(GLOB.xeno_spawn)
else T = pick(GLOB.latejoin)
var/mob/living/carbon/alien/new_xeno
switch(G_found.mind.special_role)//If they have a mind, we can determine which caste they were.
@@ -381,14 +381,14 @@ Traitors and the like can also be revived with the previous role mostly intact.
message_admins("<span class='notice'>[key_name_admin(usr)] has respawned [new_xeno.key] as a filthy xeno.</span>", 1)
return //all done. The ghost is auto-deleted
var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned.
var/mob/living/carbon/human/new_character = new(pick(GLOB.latejoin))//The mob being spawned.
var/datum/data/record/record_found //Referenced to later to either randomize or not randomize the character.
if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something
/*Try and locate a record for the person being respawned through data_core.
This isn't an exact science but it does the trick more often than not.*/
var/id = md5("[G_found.real_name][G_found.mind.assigned_role]")
for(var/datum/data/record/t in data_core.locked)
for(var/datum/data/record/t in GLOB.data_core.locked)
if(t.fields["id"]==id)
record_found = t//We shall now reference the record.
break
@@ -446,7 +446,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
else
new_character.mind.add_antag_datum(/datum/antagonist/traitor)
if("Wizard")
new_character.loc = pick(wizardstart)
new_character.loc = pick(GLOB.wizardstart)
//ticker.mode.learn_basic_spells(new_character)
SSticker.mode.equip_wizard(new_character)
if("Syndicate")
@@ -481,7 +481,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!record_found && new_character.mind.assigned_role != new_character.mind.special_role)//If there are no records for them. If they have a record, this info is already in there. Offstation special characters announced anyway.
//Power to the user!
if(alert(new_character,"Warning: No data core entry detected. Would you like to announce the arrival of this character by adding them to various databases, such as medical records?",,"No","Yes")=="Yes")
data_core.manifest_inject(new_character)
GLOB.data_core.manifest_inject(new_character)
if(alert(new_character,"Would you like an active AI to announce this character?",,"No","Yes")=="Yes")
call(/mob/new_player/proc/AnnounceArrival)(new_character, new_character.mind.assigned_role)
@@ -511,7 +511,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!istext(ckey)) return 0
var/alien_caste = input(usr, "Please choose which caste to spawn.","Pick a caste",null) as null|anything in list("Queen","Hunter","Sentinel","Drone","Larva")
var/obj/effect/landmark/spawn_here = xeno_spawn.len ? pick(xeno_spawn) : pick(latejoin)
var/obj/effect/landmark/spawn_here = GLOB.xeno_spawn.len ? pick(GLOB.xeno_spawn) : pick(GLOB.latejoin)
var/mob/living/carbon/alien/new_xeno
switch(alien_caste)
if("Queen") new_xeno = new /mob/living/carbon/alien/humanoid/queen/large(spawn_here)
@@ -533,7 +533,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/list/mobs = list()
var/list/ghosts = list()
var/list/sortmob = sortAtom(GLOB.mob_list) // get the mob list.
/var/any=0
var/any=0
for(var/mob/dead/observer/M in sortmob)
mobs.Add(M) //filter it where it's only ghosts
any = 1 //if no ghosts show up, any will just be 0
@@ -623,11 +623,11 @@ Traitors and the like can also be revived with the previous role mostly intact.
if("Yes")
var/beepsound = input(usr, "What sound should the announcement make?", "Announcement Sound", "") as anything in MsgSound
command_announcement.Announce(input, customname, MsgSound[beepsound], , , type)
GLOB.command_announcement.Announce(input, customname, MsgSound[beepsound], , , type)
print_command_report(input, "[command_name()] Update")
if("No")
//same thing as the blob stuff - it's not public, so it's classified, dammit
command_announcer.autosay("A classified message has been printed out at all communication consoles.");
GLOB.command_announcer.autosay("A classified message has been printed out at all communication consoles.")
print_command_report(input, "Classified [command_name()] Update")
else
return
@@ -885,7 +885,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
return
to_chat(usr, text("<span class='danger'>Attack Log for []</span>", mob))
for(var/t in M.attack_log)
for(var/t in M.attack_log_old)
to_chat(usr, t)
feedback_add_details("admin_verb","ATTL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -954,7 +954,9 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(confirm != "Yes")
return
GLOB.nttc_config.reset()
for(var/obj/machinery/tcomms/core/C in GLOB.tcomms_machines)
C.nttc.reset()
log_admin("[key_name(usr)] reset NTTC scripts.")
message_admins("[key_name_admin(usr)] reset NTTC scripts.")
feedback_add_details("admin_verb","RAT2") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -977,7 +979,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/role_string
var/obj_count = 0
var/obj_string = ""
for(var/mob/living/carbon/human/H in GLOB.living_mob_list)
for(var/mob/living/carbon/human/H in GLOB.alive_mob_list)
if(!isLivingSSD(H))
continue
mins_ssd = round((world.time - H.last_logout) / 600)
@@ -986,7 +988,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
else
job_string = "-"
key_string = H.key
if(job_string in command_positions)
if(job_string in GLOB.command_positions)
job_string = "<U>" + job_string + "</U>"
role_string = "-"
obj_count = 0
@@ -1014,7 +1016,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
msg += "AFK Players:<BR><TABLE border='1'>"
msg += "<TR><TD><B>Key</B></TD><TD><B>Real Name</B></TD><TD><B>Job</B></TD><TD><B>Mins AFK</B></TD><TD><B>Special Role</B></TD><TD><B>Area</B></TD><TD><B>PPN</B></TD><TD><B>Cryo</B></TD></TR>"
var/mins_afk
for(var/mob/living/carbon/human/H in GLOB.living_mob_list)
for(var/mob/living/carbon/human/H in GLOB.alive_mob_list)
if(H.client == null || H.stat == DEAD) // No clientless or dead
continue
mins_afk = round(H.client.inactivity / 600)
@@ -1025,7 +1027,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
else
job_string = "-"
key_string = H.key
if(job_string in command_positions)
if(job_string in GLOB.command_positions)
job_string = "<U>" + job_string + "</U>"
role_string = "-"
obj_count = 0
@@ -13,7 +13,7 @@
message_admins("[key_name_admin(usr)] re-assigned all space transitions")
space_manager.do_transition_setup()
GLOB.space_manager.do_transition_setup()
log_admin("[key_name(usr)] re-assigned all space transitions")
feedback_add_details("admin_verb","SPCRST") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -37,5 +37,5 @@
message_admins("[key_name_admin(usr)] made a space map")
space_manager.map_as_turfs(get_turf(usr))
GLOB.space_manager.map_as_turfs(get_turf(usr))
log_admin("[key_name(usr)] made a space map")
+14 -9
View File
@@ -1,13 +1,13 @@
//STRIKE TEAMS
#define COMMANDOS_POSSIBLE 6 //if more Commandos are needed in the future
var/global/sent_strike_team = 0
GLOBAL_VAR_INIT(sent_strike_team, 0)
/client/proc/strike_team()
if(!SSticker)
to_chat(usr, "<span class='userdanger'>The game hasn't started yet!</span>")
return
if(sent_strike_team == 1)
if(GLOB.sent_strike_team == 1)
to_chat(usr, "<span class='userdanger'>CentComm is already sending a team.</span>")
return
if(alert("Do you want to send in the CentComm death squad? Once enabled, this is irreversible.",,"Yes","No")!="Yes")
@@ -23,32 +23,33 @@ var/global/sent_strike_team = 0
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
if(sent_strike_team)
if(GLOB.sent_strike_team)
to_chat(usr, "Looks like someone beat you to it.")
return
// Find the nuclear auth code
var/nuke_code
var/temp_code
for(var/obj/machinery/nuclearbomb/N in world)
for(var/obj/machinery/nuclearbomb/N in GLOB.machines)
temp_code = text2num(N.r_code)
if(temp_code)//if it's actually a number. It won't convert any non-numericals.
nuke_code = N.r_code
break
// Find ghosts willing to be DS
var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, COMMANDOS_POSSIBLE, "Join the DeathSquad?",, 21, 600, 1, role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE)
var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, COMMANDOS_POSSIBLE, "Join the DeathSquad?",, 21, 600, 1, GLOB.role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE)
if(!commando_ghosts.len)
to_chat(usr, "<span class='userdanger'>Nobody volunteered to join the DeathSquad.</span>")
return
sent_strike_team = 1
GLOB.sent_strike_team = 1
// Spawns commandos and equips them.
var/commando_number = COMMANDOS_POSSIBLE //for selecting a leader
var/is_leader = TRUE // set to FALSE after leader is spawned
for(var/obj/effect/landmark/L in GLOB.landmarks_list)
for(var/thing in GLOB.landmarks_list)
var/obj/effect/landmark/L = thing
if(commando_number <= 0)
break
@@ -109,7 +110,8 @@ var/global/sent_strike_team = 0
commando_number--
//Spawns the rest of the commando gear.
for(var/obj/effect/landmark/L in GLOB.landmarks_list)
for(var/thing in GLOB.landmarks_list)
var/obj/effect/landmark/L = thing
if(L.name == "Commando_Manual")
//new /obj/item/gun/energy/pulse_rifle(L.loc)
var/obj/item/paper/P = new(L.loc)
@@ -120,7 +122,8 @@ var/global/sent_strike_team = 0
P.stamp(stamp)
qdel(stamp)
for(var/obj/effect/landmark/L in GLOB.landmarks_list)
for(var/thing in GLOB.landmarks_list)
var/obj/effect/landmark/L = thing
if(L.name == "Commando-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(L.loc)
qdel(L)
@@ -158,6 +161,8 @@ var/global/sent_strike_team = 0
var/obj/item/radio/R = new /obj/item/radio/headset/alt(src)
R.set_frequency(DTH_FREQ)
R.requires_tcomms = FALSE
R.instant = TRUE
equip_to_slot_or_del(R, slot_l_ear)
if(is_leader)
equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(src), slot_w_uniform)
@@ -1,7 +1,7 @@
//STRIKE TEAMS
#define SYNDICATE_COMMANDOS_POSSIBLE 6 //if more Commandos are needed in the future
var/global/sent_syndicate_strike_team = 0
GLOBAL_VAR_INIT(sent_syndicate_strike_team, 0)
/client/proc/syndicate_strike_team()
set category = "Event"
set name = "Spawn Syndicate Strike Team"
@@ -12,7 +12,7 @@ var/global/sent_syndicate_strike_team = 0
if(!SSticker)
alert("The game hasn't started yet!")
return
if(sent_syndicate_strike_team == 1)
if(GLOB.sent_syndicate_strike_team == 1)
alert("The Syndicate are already sending a team, Mr. Dumbass.")
return
if(alert("Do you want to send in the Syndicate Strike Team? Once enabled, this is irreversible.",,"Yes","No")=="No")
@@ -28,7 +28,7 @@ var/global/sent_syndicate_strike_team = 0
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
if(sent_syndicate_strike_team)
if(GLOB.sent_syndicate_strike_team)
to_chat(src, "Looks like someone beat you to it.")
return
@@ -38,22 +38,23 @@ var/global/sent_syndicate_strike_team = 0
// Find the nuclear auth code
var/nuke_code
var/temp_code
for(var/obj/machinery/nuclearbomb/N in world)
for(var/obj/machinery/nuclearbomb/N in GLOB.machines)
temp_code = text2num(N.r_code)
if(temp_code)//if it's actually a number. It won't convert any non-numericals.
nuke_code = N.r_code
break
// Find ghosts willing to be SST
var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, SYNDICATE_COMMANDOS_POSSIBLE, "Join the Syndicate Strike Team?",, 21, 600, 1, role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE)
var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, SYNDICATE_COMMANDOS_POSSIBLE, "Join the Syndicate Strike Team?",, 21, 600, 1, GLOB.role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE)
if(!commando_ghosts.len)
to_chat(usr, "<span class='userdanger'>Nobody volunteered to join the SST.</span>")
return
sent_syndicate_strike_team = 1
GLOB.sent_syndicate_strike_team = 1
//Spawns commandos and equips them.
for(var/obj/effect/landmark/L in GLOB.landmarks_list)
for(var/thing in GLOB.landmarks_list)
var/obj/effect/landmark/L = thing
if(syndicate_commando_number <= 0)
break
@@ -85,7 +86,7 @@ var/global/sent_syndicate_strike_team = 0
to_chat(new_syndicate_commando, "<span class='notice'>You are an Elite Syndicate [is_leader ? "<B>TEAM LEADER</B>" : "commando"] in the service of the Syndicate. \nYour current mission is: <span class='userdanger'>[input]</span></span>")
new_syndicate_commando.faction += "syndicate"
var/datum/atom_hud/antag/opshud = huds[ANTAG_HUD_OPS]
var/datum/atom_hud/antag/opshud = GLOB.huds[ANTAG_HUD_OPS]
opshud.join_hud(new_syndicate_commando.mind.current)
set_antag_hud(new_syndicate_commando.mind.current, "hudoperative")
new_syndicate_commando.regenerate_icons()
+3 -5
View File
@@ -1,4 +1,4 @@
var/list/admin_verbs_show_debug_verbs = list(
GLOBAL_LIST_INIT(admin_verbs_show_debug_verbs, list(
/client/proc/camera_view,
/client/proc/sec_camera_report,
/client/proc/intercom_view,
@@ -17,12 +17,10 @@ var/list/admin_verbs_show_debug_verbs = list(
/client/proc/print_jobban_old,
/client/proc/print_jobban_old_filter,
/client/proc/forceEvent,
/client/proc/nanomapgen_DumpImage,
/client/proc/reload_nanoui_resources,
/client/proc/admin_redo_space_transitions,
/client/proc/make_turf_space_map,
/client/proc/vv_by_ref
)
))
// Would be nice to make this a permanent admin pref so we don't need to click it each time
/client/proc/enable_debug_verbs()
@@ -32,6 +30,6 @@ var/list/admin_verbs_show_debug_verbs = list(
if(!check_rights(R_DEBUG))
return
verbs += admin_verbs_show_debug_verbs
verbs += GLOB.admin_verbs_show_debug_verbs
feedback_add_details("admin_verb","mDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+4 -4
View File
@@ -1,4 +1,4 @@
var/global/vox_tick = 1
GLOBAL_VAR_INIT(vox_tick, 1)
/mob/living/carbon/human/proc/equip_vox_raider()
@@ -10,7 +10,7 @@ var/global/vox_tick = 1
equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/vox(src), slot_shoes) // REPLACE THESE WITH CODED VOX ALTERNATIVES.
equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow/vox(src), slot_gloves) // AS ABOVE.
switch(vox_tick)
switch(GLOB.vox_tick)
if(1) // Vox raider!
equip_to_slot_or_del(new /obj/item/clothing/suit/space/vox/carapace(src), slot_wear_suit)
equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/vox/carapace(src), slot_head)
@@ -59,7 +59,7 @@ var/global/vox_tick = 1
W.registered_user = src
equip_to_slot_or_del(W, slot_wear_id)
vox_tick++
if(vox_tick > 4) vox_tick = 1
GLOB.vox_tick++
if(GLOB.vox_tick > 4) GLOB.vox_tick = 1
return 1
+7 -7
View File
@@ -6,7 +6,7 @@
if(!new_ckey)
return
new_ckey = sanitizeSQL(new_ckey)
var/DBQuery/query_watchfind = dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ckey = '[new_ckey]'")
var/DBQuery/query_watchfind = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ckey = '[new_ckey]'")
if(!query_watchfind.Execute())
var/err = query_watchfind.ErrorMsg()
log_game("SQL ERROR obtaining ckey from player table. Error : \[[err]\]\n")
@@ -29,7 +29,7 @@
if(!adminckey)
return
var/admin_sql_ckey = sanitizeSQL(adminckey)
var/DBQuery/query_watchadd = dbcon.NewQuery("INSERT INTO [format_table_name("watch")] (ckey, reason, adminckey, timestamp) VALUES ('[target_sql_ckey]', '[reason]', '[admin_sql_ckey]', '[timestamp]')")
var/DBQuery/query_watchadd = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("watch")] (ckey, reason, adminckey, timestamp) VALUES ('[target_sql_ckey]', '[reason]', '[admin_sql_ckey]', '[timestamp]')")
if(!query_watchadd.Execute())
var/err = query_watchadd.ErrorMsg()
log_game("SQL ERROR during adding new watch entry. Error : \[[err]\]\n")
@@ -43,7 +43,7 @@
if(!check_rights(R_ADMIN))
return
var/target_sql_ckey = sanitizeSQL(target_ckey)
var/DBQuery/query_watchdel = dbcon.NewQuery("DELETE FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'")
var/DBQuery/query_watchdel = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'")
if(!query_watchdel.Execute())
var/err = query_watchdel.ErrorMsg()
log_game("SQL ERROR during removing watch entry. Error : \[[err]\]\n")
@@ -57,7 +57,7 @@
if(!check_rights(R_ADMIN))
return
var/target_sql_ckey = sanitizeSQL(target_ckey)
var/DBQuery/query_watchreason = dbcon.NewQuery("SELECT reason FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'")
var/DBQuery/query_watchreason = GLOB.dbcon.NewQuery("SELECT reason FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'")
if(!query_watchreason.Execute())
var/err = query_watchreason.ErrorMsg()
log_game("SQL ERROR obtaining reason from watch table. Error : \[[err]\]\n")
@@ -71,7 +71,7 @@
var/sql_ckey = sanitizeSQL(usr.ckey)
var/edit_text = "Edited by [sql_ckey] on [SQLtime()] from \"[watch_reason]\" to \"[new_reason]\""
edit_text = sanitizeSQL(edit_text)
var/DBQuery/query_watchupdate = dbcon.NewQuery("UPDATE [format_table_name("watch")] SET reason = '[new_reason]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE ckey = '[target_sql_ckey]'")
var/DBQuery/query_watchupdate = GLOB.dbcon.NewQuery("UPDATE [format_table_name("watch")] SET reason = '[new_reason]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE ckey = '[target_sql_ckey]'")
if(!query_watchupdate.Execute())
var/err = query_watchupdate.ErrorMsg()
log_game("SQL ERROR editing watchlist reason. Error : \[[err]\]\n")
@@ -96,7 +96,7 @@
else
search = "^."
search = sanitizeSQL(search)
var/DBQuery/query_watchlist = dbcon.NewQuery("SELECT ckey, reason, adminckey, timestamp, last_editor FROM [format_table_name("watch")] WHERE ckey REGEXP '[search]' ORDER BY ckey")
var/DBQuery/query_watchlist = GLOB.dbcon.NewQuery("SELECT ckey, reason, adminckey, timestamp, last_editor FROM [format_table_name("watch")] WHERE ckey REGEXP '[search]' ORDER BY ckey")
if(!query_watchlist.Execute())
var/err = query_watchlist.ErrorMsg()
log_game("SQL ERROR obtaining ckey, reason, adminckey, timestamp, last_editor from watch table. Error : \[[err]\]\n")
@@ -115,7 +115,7 @@
/proc/check_watchlist(target_ckey)
var/target_sql_ckey = sanitizeSQL(target_ckey)
var/DBQuery/query_watch = dbcon.NewQuery("SELECT reason FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'")
var/DBQuery/query_watch = GLOB.dbcon.NewQuery("SELECT reason FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'")
if(!query_watch.Execute())
var/err = query_watch.ErrorMsg()
log_game("SQL ERROR obtaining reason from watch table. Error : \[[err]\]\n")