Ports the TG globals controller and converts globals. (#18057)

* SDQL2 update

* fix that verb

* cl

* fix that

* toworld

* this is pointless

* update info

* siiiiick..

* vv edit update

* fix that

* fix editing vars

* fix VV

* Port the /TG/ globals controller.

* part 1

* part 2

* oops

* part 3

* Hollow Purple

* sadas

* bsbsdb

* muda na agaki ta

* ids 1-15

* 16-31

* 41-75

* bring me back to how things used to be before i lost it all

* the strength of mayhem

* final touches

* cl

* protect some vars

* update sdql2 to use glob

* stuff?

* forgot that is not defined there

* whoops

* observ

* but it never gets better

* a

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2023-12-26 02:16:02 +01:00
committed by GitHub
parent 19292f01d3
commit cadd19beac
966 changed files with 4785 additions and 4784 deletions
+17 -17
View File
@@ -6,14 +6,14 @@
if (!ckey || !address || !computer_id || !ban_id)
return
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
log_world("ERROR: Ban database connection failure while attempting to mirror. Key passed for mirror handling: [ckey].")
log_misc("Ban database connection failure while attempting to mirror. Key passed for mirror handling: [ckey].")
return
var/bad_data = BAD_CKEY|BAD_IP|BAD_CID
var/DBQuery/original_ban = dbcon.NewQuery("SELECT ckey, ip, computerid FROM ss13_ban WHERE id = :ban_id:")
var/DBQuery/original_ban = GLOB.dbcon.NewQuery("SELECT ckey, ip, computerid FROM ss13_ban WHERE id = :ban_id:")
original_ban.Execute(list("ban_id" = ban_id))
if (original_ban.NextRow())
@@ -28,7 +28,7 @@
bad_data &= ~BAD_CID
if (bad_data)
var/DBQuery/mirrored_bans = dbcon.NewQuery("SELECT ckey, ip, computerid FROM ss13_ban_mirrors WHERE isnull(deleted_at) AND ban_id = :ban_id:")
var/DBQuery/mirrored_bans = GLOB.dbcon.NewQuery("SELECT ckey, ip, computerid FROM ss13_ban_mirrors WHERE isnull(deleted_at) AND ban_id = :ban_id:")
mirrored_bans.Execute(list("ban_id" = ban_id))
while (mirrored_bans.NextRow())
@@ -57,12 +57,12 @@
if (!ckey || !address || !computer_id)
return null
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
log_world("ERROR: Ban database connection failure while attempting to check mirrors. Key passed for mirror checking: [ckey].")
log_misc("Ban database connection failure while attempting to check mirrors. Key passed for mirror checking: [ckey].")
return null
var/DBQuery/initial_query = dbcon.NewQuery("SELECT DISTINCT ban_id FROM ss13_ban_mirrors WHERE isnull(deleted_at) AND (ckey = :ckey: OR ip = :address: OR computerid = :computerid:)")
var/DBQuery/initial_query = GLOB.dbcon.NewQuery("SELECT DISTINCT ban_id FROM ss13_ban_mirrors WHERE isnull(deleted_at) AND (ckey = :ckey: OR ip = :address: OR computerid = :computerid:)")
initial_query.Execute(list("ckey" = ckey, "address" = address, "computerid" = computer_id))
var/list/ban_ids = list()
@@ -74,7 +74,7 @@
if (!ban_ids.len)
return null
var/DBQuery/search_query = dbcon.NewQuery("SELECT id FROM ss13_ban WHERE id IN :vars: AND isnull(unbanned) AND (bantype = 'PERMABAN' OR (bantype = 'TEMPBAN' AND expiration_time > Now()))")
var/DBQuery/search_query = GLOB.dbcon.NewQuery("SELECT id FROM ss13_ban WHERE id IN :vars: AND isnull(unbanned) AND (bantype = 'PERMABAN' OR (bantype = 'TEMPBAN' AND expiration_time > Now()))")
search_query.Execute(list("vars" = ban_ids))
var/list/active_bans = list()
@@ -98,7 +98,7 @@
for (var/i = 1; i <= extra_info.len && i <= 50; i++)
. |= extra_info[i][1]
var/DBQuery/new_mirror = dbcon.NewQuery("INSERT INTO ss13_ban_mirrors (id, ban_id, ckey, ip, computerid, source, extra_info, datetime) VALUES (NULL, :ban_id:, :ckey:, :address:, :computerid:, :source:, :info:, NOW())")
var/DBQuery/new_mirror = GLOB.dbcon.NewQuery("INSERT INTO ss13_ban_mirrors (id, ban_id, ckey, ip, computerid, source, extra_info, datetime) VALUES (NULL, :ban_id:, :ckey:, :address:, :computerid:, :source:, :info:, NOW())")
new_mirror.Execute(list("ban_id" = ban_id, "ckey" = ckey, "address" = address, "computerid" = computer_id, "source" = source, "info" = json_encode(.)))
log_misc("Mirrored ban #[ban_id] for player [ckey] from [address]-[computer_id].")
@@ -107,10 +107,10 @@
if (!ban_id)
return null
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
return null
var/DBQuery/query = dbcon.NewQuery("SELECT id, ckey, ip, computerid, date(datetime) as datetime, source, extra_info, deleted_at FROM ss13_ban_mirrors WHERE ban_id = :ban_id:")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id, ckey, ip, computerid, date(datetime) as datetime, source, extra_info, deleted_at FROM ss13_ban_mirrors WHERE ban_id = :ban_id:")
query.Execute(list("ban_id" = ban_id))
var/list/mirrors = list()
@@ -194,11 +194,11 @@
if (!user || !check_rights(R_MOD|R_ADMIN) || !mirror_id)
return
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
to_chat(user, "<span class='warning'>Database connection failed!</span>")
return
var/DBQuery/query = dbcon.NewQuery("SELECT extra_info, ban_id FROM ss13_ban_mirrors WHERE id = :id:")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT extra_info, ban_id FROM ss13_ban_mirrors WHERE id = :id:")
query.Execute(list("id" = mirror_id))
if (!query.NextRow())
@@ -229,13 +229,13 @@
if (!user || !check_rights(R_MOD|R_ADMIN) || !mirror_id)
return
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
to_chat(user, "<span class='warning'>Database connection failed!</span>")
return
var/query_text = inactive ? "UPDATE ss13_ban_mirrors SET deleted_at = NULL WHERE id = :id:" : "UPDATE ss13_ban_mirrors SET deleted_at = NOW() WHERE id = :id:"
var/DBQuery/query = dbcon.NewQuery(query_text)
var/DBQuery/query = GLOB.dbcon.NewQuery(query_text)
query.Execute(list("id" = mirror_id))
if (query.ErrorMsg())
@@ -272,15 +272,15 @@
if (A & 2)
count++
if (config.access_deny_vms && count >= config.access_deny_vms)
log_access("Failed Login: [C.ckey] [C.address] [C.computer_id] - Matching [count]/[config.access_deny_vms] VM identifiers. IDs: [A].", ckey = C.ckey)
message_admins("Failed Login: [C.ckey] [C.address] [C.computer_id] - Matching [count]/[config.access_deny_vms] VM identifiers. IDs: [A].")
if (GLOB.config.access_deny_vms && count >= GLOB.config.access_deny_vms)
log_access("Failed Login: [C.ckey] [C.address] [C.computer_id] - Matching [count]/[GLOB.config.access_deny_vms] VM identifiers. IDs: [A].", ckey = C.ckey)
message_admins("Failed Login: [C.ckey] [C.address] [C.computer_id] - Matching [count]/[GLOB.config.access_deny_vms] VM identifiers. IDs: [A].")
spawn(20)
if (C)
del(C)
return
if (config.access_warn_vms && count >= config.access_warn_vms)
if (GLOB.config.access_warn_vms && count >= GLOB.config.access_warn_vms)
log_access("Notice: [key_name(C)] [C.address] [C.computer_id] - Matching [count] VM identifiers. IDs: [A].", ckey = C.ckey)
message_admins("Notice: [key_name(C)] [C.address] [C.computer_id] - Matching [count] VM identifiers. IDs: [A].")
+19 -19
View File
@@ -12,7 +12,7 @@
if (!holder)
return
if(!establish_db_connection(dbcon))
if(!establish_db_connection(GLOB.dbcon))
return
var/serverip = "[world.internet_address]:[world.port]"
@@ -51,7 +51,7 @@
computerid = bancid
ip = banip
var/DBQuery/query = dbcon.NewQuery("SELECT id, computerid, ip FROM ss13_player WHERE ckey = '[ckey]'")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id, computerid, ip FROM ss13_player WHERE ckey = '[ckey]'")
query.Execute()
var/validckey = 0
if(query.NextRow())
@@ -80,7 +80,7 @@
a_ip = world.address
var/who
for(var/c in clients)
for(var/c in GLOB.clients)
var/client/C = c
if(!who)
who = "[C]"
@@ -88,7 +88,7 @@
who += ", [C]"
var/adminwho
for(var/c in staff)
for(var/c in GLOB.staff)
var/client/C = c
if(!adminwho)
adminwho = "[C]"
@@ -98,7 +98,7 @@
reason = sql_sanitize_text(reason)
var/sql = "INSERT INTO ss13_ban (`id`,`bantime`,`serverip`,`game_id`,`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]', '[game_id]','[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)
@@ -138,13 +138,13 @@
if(job)
sql += " AND job = '[job]'"
if(!establish_db_connection(dbcon))
if(!establish_db_connection(GLOB.dbcon))
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]
@@ -174,7 +174,7 @@
to_chat(usr, "Cancelled")
return
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, duration, reason FROM ss13_ban WHERE id = [banid]")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, duration, reason FROM ss13_ban WHERE id = [banid]")
query.Execute()
var/eckey = usr.ckey //Editing admin ckey
@@ -202,7 +202,7 @@
to_chat(usr, "Cancelled")
return
var/DBQuery/update_query = dbcon.NewQuery("UPDATE ss13_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 ss13_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")
@@ -212,7 +212,7 @@
to_chat(usr, "Cancelled")
return
var/DBQuery/update_query = dbcon.NewQuery("UPDATE ss13_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 ss13_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")
@@ -232,7 +232,7 @@
var/sql = "SELECT ckey, bantype, job FROM ss13_ban WHERE id = [id]"
if(!establish_db_connection(dbcon))
if(!establish_db_connection(GLOB.dbcon))
return
var/reason = input("Please specify an unban reason.", "Unban Reason", "Unbanned as per appeal.")
@@ -245,7 +245,7 @@
var/pckey
var/ban_type
var/job // This is for integrating the static jobban API into this.
var/DBQuery/query = dbcon.NewQuery(sql)
var/DBQuery/query = GLOB.dbcon.NewQuery(sql)
query.Execute()
while(query.NextRow())
pckey = query.item[1]
@@ -277,7 +277,7 @@
var/sql_update = "UPDATE ss13_ban SET unbanned = 1, unbanned_datetime = Now(), unbanned_ckey = '[unban_ckey]', unbanned_computerid = '[unban_computerid]', unbanned_ip = '[unban_ip]', unbanned_reason = '[unban_reason]' 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()
notes_add_sql(ckey(pckey), "[ban_type] (#[id]) lifted. Reason for unban: [reason].", usr)
@@ -303,7 +303,7 @@
if(!check_rights(R_BAN)) return
if(!establish_db_connection(dbcon))
if(!establish_db_connection(GLOB.dbcon))
to_chat(usr, "<span class='warning'>Failed to establish database connection</span>")
return
@@ -336,8 +336,8 @@
for(var/j in nonhuman_positions)
output += "<option value='[j]'>[j]</option>"
var/list/bantypes = list("traitor","changeling","vampire","operative","revolutionary","cultist","wizard") //For legacy bans.
for(var/antag_type in all_antag_types) // Grab other bans.
var/datum/antagonist/antag = all_antag_types[antag_type]
for(var/antag_type in GLOB.all_antag_types) // Grab other bans.
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
bantypes |= antag.bantype
for(var/j in bantypes)
output += "<option value='[j]'>[j]</option>"
@@ -433,7 +433,7 @@
* Do mirror checks first! Basically find active mirrors and add those to the output before we proceed onto finding bans.
*/
if (!match)
var/DBQuery/mirror_query = dbcon.NewQuery({"SELECT DISTINCT(mirrors.ban_id), bans.ckey FROM ss13_ban_mirrors mirrors
var/DBQuery/mirror_query = GLOB.dbcon.NewQuery({"SELECT DISTINCT(mirrors.ban_id), bans.ckey FROM ss13_ban_mirrors mirrors
JOIN ss13_ban bans ON mirrors.ban_id = bans.id
WHERE (isnull(mirrors.deleted_at) AND (1 [mirror_player] [mirror_ip] [mirror_cid]))
AND (
@@ -465,7 +465,7 @@
output += "<th width='15%'><b>OPTIONS</b></th>"
output += "</tr>"
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, bantime, bantype, reason, job, duration, expiration_time, ckey, a_ckey, unbanned, unbanned_ckey, unbanned_datetime, unbanned_reason, edits, ip, computerid FROM ss13_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, unbanned_reason, edits, ip, computerid FROM ss13_ban WHERE 1 [playersearch] [adminsearch] [ipsearch] [cidsearch] [bantypesearch] ORDER BY bantime DESC LIMIT 100")
select_query.Execute()
var/now = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss") // MUST BE the same format as SQL gives us the dates in, and MUST be least to most specific (i.e. year, month, day not day, month, year)
@@ -546,7 +546,7 @@
output += "</tr>"
if (bantype in list("PERMABAN", "TEMPBAN"))
var/mirror_count = 0
var/DBQuery/get_mirrors = dbcon.NewQuery("SELECT id FROM ss13_ban_mirrors WHERE ban_id = :ban_id:")
var/DBQuery/get_mirrors = GLOB.dbcon.NewQuery("SELECT id FROM ss13_ban_mirrors WHERE ban_id = :ban_id:")
get_mirrors.Execute(list("ban_id" = text2num(banid)))
while (get_mirrors.NextRow())
+11 -11
View File
@@ -12,7 +12,7 @@
var/ckey = ckey(key)
var/admin = (ckey in admin_datums)
var/client/C = directory[ckey]
var/client/C = GLOB.directory[ckey]
if (C && ckey == C.ckey && computer_id == C.computer_id && address == C.address)
return // Player is already connected, do not recheck.
@@ -23,12 +23,12 @@
var/message = !checkedckeys[ckey]++
//Guest Checking
if(!(config.guests_allowed || config.external_auth) && IsGuestKey(key))
if(!(GLOB.config.guests_allowed || GLOB.config.external_auth) && IsGuestKey(key))
log_access("Failed Login: [key] - Guests not allowed",ckey=key_name(key))
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.")
if(config.ban_legacy_system)
if(GLOB.config.ban_legacy_system)
//Ban Checking
. = CheckBan(ckey, computer_id, address)
if(.)
@@ -51,7 +51,7 @@
return list("reason" = "Temporary ban", "desc" = "Your connection did not broadcast an computer ID to check.")
if(!establish_db_connection(dbcon))
if(!establish_db_connection(GLOB.dbcon))
log_world("ERROR: Ban database connection failure. Key [ckey] not checked")
log_misc("Ban database connection failure. Key [ckey] not checked")
return ..()
@@ -69,7 +69,7 @@
params["computerid"] = computer_id
params["address"] = address
var/DBQuery/query = dbcon.NewQuery(query_content)
var/DBQuery/query = GLOB.dbcon.NewQuery(query_content)
query.Execute(params)
while(query.NextRow())
@@ -92,8 +92,8 @@
expires = " The ban is for [duration] minutes and expires on [expiration] (server time)."
var/desc = "\nReason: You, or another user of this computer or connection ([pckey]) is banned from playing here. The ban reason is:\n[reason]\nThis ban was applied by [ackey] on [bantime], [expires]"
if (config.forum_passphrase)
desc += "\nTo register on the forums, please use the following passphrase: [config.forum_passphrase]"
if (GLOB.config.forum_passphrase)
desc += "\nTo register on the forums, please use the following passphrase: [GLOB.config.forum_passphrase]"
return list("reason"="[bantype]", "desc"="[desc]", "id" = ban_id)
@@ -180,15 +180,15 @@
return null
if (ban["fromdb"])
if(establish_db_connection(dbcon))
if(establish_db_connection(GLOB.dbcon))
spawn()
var/DBQuery/query = dbcon.NewQuery("INSERT INTO ss13_stickyban_matched_ckey (matched_ckey, stickyban) VALUES ('[sanitizeSQL(ckey)]', '[sanitizeSQL(bannedckey)]') ON DUPLICATE KEY UPDATE last_matched = now()")
var/DBQuery/query = GLOB.dbcon.NewQuery("INSERT INTO ss13_stickyban_matched_ckey (matched_ckey, stickyban) VALUES ('[sanitizeSQL(ckey)]', '[sanitizeSQL(bannedckey)]') ON DUPLICATE KEY UPDATE last_matched = now()")
query.Execute()
query = dbcon.NewQuery("INSERT INTO ss13_stickyban_matched_ip (matched_ip, stickyban) VALUES ( INET_ATON('[sanitizeSQL(address)]'), '[sanitizeSQL(bannedckey)]') ON DUPLICATE KEY UPDATE last_matched = now()")
query = GLOB.dbcon.NewQuery("INSERT INTO ss13_stickyban_matched_ip (matched_ip, stickyban) VALUES ( INET_ATON('[sanitizeSQL(address)]'), '[sanitizeSQL(bannedckey)]') ON DUPLICATE KEY UPDATE last_matched = now()")
query.Execute()
query = dbcon.NewQuery("INSERT INTO ss13_stickyban_matched_cid (matched_cid, stickyban) VALUES ('[sanitizeSQL(computer_id)]', '[sanitizeSQL(bannedckey)]') ON DUPLICATE KEY UPDATE last_matched = now()")
query = GLOB.dbcon.NewQuery("INSERT INTO ss13_stickyban_matched_cid (matched_cid, stickyban) VALUES ('[sanitizeSQL(computer_id)]', '[sanitizeSQL(bannedckey)]') ON DUPLICATE KEY UPDATE last_matched = now()")
query.Execute()
//byond will not trigger isbanned() for "global" host bans,
+2 -2
View File
@@ -10,8 +10,8 @@ var/savefile/Banlist
. = 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>"
if(GLOB.config && GLOB.config.banappeals)
appeal = "\nFor more information on your ban, or to appeal, head to <a href='[GLOB.config.banappeals]'>[GLOB.config.banappeals]</a>"
Banlist.cd = "/base"
if( "[ckey][id]" in Banlist.dir )
Banlist.cd = "[ckey][id]"
+57 -57
View File
@@ -6,14 +6,14 @@ var/global/enabled_spooking = 0
////////////////////////////////
/proc/message_admins(var/msg)
msg = "<span class=\"log_message\"><span class=\"prefix\">ADMIN LOG:</span> <span class=\"message\">[msg]</span></span>"
for(var/s in staff)
for(var/s in GLOB.staff)
var/client/C = s
if((R_ADMIN|R_MOD) & C.holder.rights)
to_chat(C, msg)
/proc/message_cciaa(var/msg)
msg = "<span class=\"log_message\"><span class=\"prefix\">CCIA LOG:</span> <span class=\"message\">[msg]</span></span>"
for(var/s in staff)
for(var/s in GLOB.staff)
var/client/C = s
if(R_CCIAA & C.holder.rights)
to_chat(C, msg)
@@ -21,7 +21,7 @@ var/global/enabled_spooking = 0
/proc/msg_admin_attack(var/text,var/ckey="",var/ckey_target="") //Toggleable Attack Messages
log_attack(text,ckey=ckey,ckey_target=ckey_target)
var/rendered = "<span class=\"log_message\"><span class=\"prefix\">ATTACK:</span> <span class=\"message\">[text]</span></span>"
for(var/s in staff)
for(var/s in GLOB.staff)
var/client/C = s
if((R_ADMIN|R_MOD) & C.holder.rights)
if(C.prefs.toggles & CHAT_ATTACKLOGS)
@@ -29,13 +29,13 @@ var/global/enabled_spooking = 0
to_chat(C, msg)
/proc/admin_notice(var/message, var/rights)
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
if(check_rights(rights, 0, M))
to_chat(M, message)
///////////////////////////////////////////////////////////////////////////////////////////////Panels
/datum/admins/proc/show_player_panel(var/mob/M in mob_list)
/datum/admins/proc/show_player_panel(var/mob/M in GLOB.mob_list)
set category = "Admin"
set name = "Show Player Panel"
set desc="Edit player (respawn, ban, heal, etc)"
@@ -206,8 +206,8 @@ var/global/enabled_spooking = 0
// language toggles
body += "<br><br><b>Languages:</b><br>"
var/f = 1
for(var/k in all_languages)
var/datum/language/L = all_languages[k]
for(var/k in GLOB.all_languages)
var/datum/language/L = GLOB.all_languages[k]
if(!(L.flags & INNATE))
if(!f) body += " | "
else f = 0
@@ -240,7 +240,7 @@ var/global/enabled_spooking = 0
return
if (!check_rights(R_ADMIN|R_MOD))
return
if (config.ban_legacy_system)
if (GLOB.config.ban_legacy_system)
PlayerNotesPage(1)
else
show_notes_sql()
@@ -302,12 +302,12 @@ var/global/enabled_spooking = 0
to_chat(usr, "Error: you are not an admin!")
return
if (config.ban_legacy_system)
if (GLOB.config.ban_legacy_system)
var/dat = "<html><head><title>Info on [key]</title></head>"
dat += "<body>"
var/p_age = "unknown"
for(var/client/C in clients)
for(var/client/C in GLOB.clients)
if(C.ckey == key)
p_age = C.player_age
break
@@ -628,7 +628,7 @@ var/global/enabled_spooking = 0
<center><B>Game Panel</B></center><hr>\n
<A href='?src=\ref[src];c_mode=1'>Change Game Mode</A><br>
"}
if(master_mode == ROUNDTYPE_STR_SECRET || master_mode == ROUNDTYPE_STR_MIXED_SECRET)
if(GLOB.master_mode == ROUNDTYPE_STR_SECRET || GLOB.master_mode == ROUNDTYPE_STR_MIXED_SECRET)
dat += "<A href='?src=\ref[src];f_secret=1'>(Force Secret Mode)</A><br>"
dat += {"
@@ -713,8 +713,8 @@ var/global/enabled_spooking = 0
if(!check_rights(R_ADMIN))
return
config.ooc_allowed = !(config.ooc_allowed)
if (config.ooc_allowed)
GLOB.config.ooc_allowed = !(GLOB.config.ooc_allowed)
if (GLOB.config.ooc_allowed)
to_world("<B>The OOC channel has been globally enabled!</B>")
else
to_world("<B>The OOC channel has been globally disabled!</B>")
@@ -729,8 +729,8 @@ var/global/enabled_spooking = 0
if(!check_rights(R_ADMIN))
return
config.looc_allowed = !(config.looc_allowed)
if (config.looc_allowed)
GLOB.config.looc_allowed = !(GLOB.config.looc_allowed)
if (GLOB.config.looc_allowed)
to_world("<B>The LOOC channel has been globally enabled!</B>")
else
to_world("<B>The LOOC channel has been globally disabled!</B>")
@@ -746,8 +746,8 @@ var/global/enabled_spooking = 0
if(!check_rights(R_ADMIN))
return
config.dsay_allowed = !(config.dsay_allowed)
if (config.dsay_allowed)
GLOB.config.dsay_allowed = !(GLOB.config.dsay_allowed)
if (GLOB.config.dsay_allowed)
to_world("<B>Deadchat has been globally enabled!</B>")
else
to_world("<B>Deadchat has been globally disabled!</B>")
@@ -763,8 +763,8 @@ var/global/enabled_spooking = 0
if(!check_rights(R_ADMIN))
return
config.dooc_allowed = !( config.dooc_allowed )
log_and_message_admins("toggled dead (global) OOC. (New state: [config.dooc_allowed])")
GLOB.config.dooc_allowed = !( GLOB.config.dooc_allowed )
log_and_message_admins("toggled dead (global) OOC. (New state: [GLOB.config.dooc_allowed])")
feedback_add_details("admin_verb","TDOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/toggle_dead_looc()
@@ -775,8 +775,8 @@ var/global/enabled_spooking = 0
if (!check_rights(R_ADMIN))
return
config.dead_looc_allowed = !config.dead_looc_allowed
log_and_message_admins("toggled dead LOOC. (New state: [config.dead_looc_allowed])")
GLOB.config.dead_looc_allowed = !GLOB.config.dead_looc_allowed
log_and_message_admins("toggled dead LOOC. (New state: [GLOB.config.dead_looc_allowed])")
/datum/admins/proc/togglehubvisibility()
set category = "Server"
@@ -799,9 +799,9 @@ var/global/enabled_spooking = 0
set category = "Server"
set desc="Toggle traitor scaling"
set name="Toggle Traitor Scaling"
config.traitor_scaling = !config.traitor_scaling
log_admin("[key_name(usr)] toggled Traitor Scaling to [config.traitor_scaling].")
message_admins("[key_name_admin(usr)] toggled Traitor Scaling [config.traitor_scaling ? "on" : "off"].", 1)
GLOB.config.traitor_scaling = !GLOB.config.traitor_scaling
log_admin("[key_name(usr)] toggled Traitor Scaling to [GLOB.config.traitor_scaling].")
message_admins("[key_name_admin(usr)] toggled Traitor Scaling [GLOB.config.traitor_scaling ? "on" : "off"].", 1)
feedback_add_details("admin_verb","TTS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/startnow()
@@ -825,8 +825,8 @@ var/global/enabled_spooking = 0
set category = "Server"
set desc="People can't enter"
set name="Toggle Entering"
config.enter_allowed = !(config.enter_allowed)
if (!(config.enter_allowed))
GLOB.config.enter_allowed = !(GLOB.config.enter_allowed)
if (!(GLOB.config.enter_allowed))
to_world("<B>New players may no longer enter the game.</B>")
else
to_world("<B>New players may now enter the game.</B>")
@@ -839,8 +839,8 @@ var/global/enabled_spooking = 0
set category = "Server"
set desc="People can't be AI"
set name="Toggle AI"
config.allow_ai = !( config.allow_ai )
if (!( config.allow_ai ))
GLOB.config.allow_ai = !( GLOB.config.allow_ai )
if (!( GLOB.config.allow_ai ))
to_world("<B>The AI job is no longer chooseable.</B>")
else
to_world("<B>The AI job is chooseable now.</B>")
@@ -852,13 +852,13 @@ var/global/enabled_spooking = 0
set category = "Server"
set desc="Respawn basically"
set name="Toggle Respawn"
config.abandon_allowed = !(config.abandon_allowed)
if(config.abandon_allowed)
GLOB.config.abandon_allowed = !(GLOB.config.abandon_allowed)
if(GLOB.config.abandon_allowed)
to_world("<B>You may now respawn.</B>")
else
to_world("<B>You may no longer respawn :(</B>")
message_admins("<span class='notice'>[key_name_admin(usr)] toggled respawn to [config.abandon_allowed ? "On" : "Off"].</span>", 1)
log_admin("[key_name(usr)] toggled respawn to [config.abandon_allowed ? "On" : "Off"].")
message_admins("<span class='notice'>[key_name_admin(usr)] toggled respawn to [GLOB.config.abandon_allowed ? "On" : "Off"].</span>", 1)
log_admin("[key_name(usr)] toggled respawn to [GLOB.config.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!
@@ -866,9 +866,9 @@ var/global/enabled_spooking = 0
set category = "Server"
set desc="Toggle space ninjas spawning."
set name="Toggle Space Ninjas"
config.ninjas_allowed = !config.ninjas_allowed
log_admin("[key_name(usr)] toggled Space Ninjas to [config.ninjas_allowed].")
message_admins("[key_name_admin(usr)] toggled Space Ninjas [config.ninjas_allowed ? "on" : "off"].", 1)
GLOB.config.ninjas_allowed = !GLOB.config.ninjas_allowed
log_admin("[key_name(usr)] toggled Space Ninjas to [GLOB.config.ninjas_allowed].")
message_admins("[key_name_admin(usr)] toggled Space Ninjas [GLOB.config.ninjas_allowed ? "on" : "off"].", 1)
feedback_add_details("admin_verb","TSN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/delay()
@@ -882,8 +882,8 @@ var/global/enabled_spooking = 0
log_admin("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].")
message_admins("<span class='notice'>[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].</span>", 1)
return //alert("Round end delayed", null, null, null, null, null)
round_progressing = !round_progressing
if (!round_progressing)
GLOB.round_progressing = !GLOB.round_progressing
if (!GLOB.round_progressing)
to_world("<b>The game start has been delayed.</b>")
log_admin("[key_name(usr)] delayed the game.")
else
@@ -895,24 +895,24 @@ var/global/enabled_spooking = 0
set category = "Server"
set desc="Toggle admin jumping"
set name="Toggle Jump"
config.allow_admin_jump = !(config.allow_admin_jump)
message_admins("<span class='notice'>Toggled admin jumping to [config.allow_admin_jump].</span>")
GLOB.config.allow_admin_jump = !(GLOB.config.allow_admin_jump)
message_admins("<span class='notice'>Toggled admin jumping to [GLOB.config.allow_admin_jump].</span>")
feedback_add_details("admin_verb","TJ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/adspawn()
set category = "Server"
set desc="Toggle admin spawning"
set name="Toggle Spawn"
config.allow_admin_spawning = !(config.allow_admin_spawning)
message_admins("<span class='notice'>Toggled admin item spawning to [config.allow_admin_spawning].</span>")
GLOB.config.allow_admin_spawning = !(GLOB.config.allow_admin_spawning)
message_admins("<span class='notice'>Toggled admin item spawning to [GLOB.config.allow_admin_spawning].</span>")
feedback_add_details("admin_verb","TAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/adrev()
set category = "Server"
set desc="Toggle admin revives"
set name="Toggle Revive"
config.allow_admin_rev = !(config.allow_admin_rev)
message_admins("<span class='notice'>Toggled reviving to [config.allow_admin_rev].</span>")
GLOB.config.allow_admin_rev = !(GLOB.config.allow_admin_rev)
message_admins("<span class='notice'>Toggled reviving to [GLOB.config.allow_admin_rev].</span>")
feedback_add_details("admin_verb","TAR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/immreboot()
@@ -930,12 +930,12 @@ var/global/enabled_spooking = 0
world.Reboot()
/datum/admins/proc/unprison(var/mob/M in mob_list)
/datum/admins/proc/unprison(var/mob/M in GLOB.mob_list)
set category = "Admin"
set name = "Unprison"
if (M.z == 2)
if (config.allow_admin_jump)
M.forceMove(pick(latejoin))
if (GLOB.config.allow_admin_jump)
M.forceMove(pick(GLOB.latejoin))
message_admins("[key_name_admin(usr)] has unprisoned [key_name_admin(M)]", 1)
log_admin("[key_name(usr)] has unprisoned [key_name(M)]")
else
@@ -1046,7 +1046,7 @@ var/global/enabled_spooking = 0
feedback_add_details("admin_verb","SA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/show_traitor_panel(var/mob/M in mob_list)
/datum/admins/proc/show_traitor_panel(var/mob/M in GLOB.mob_list)
set category = "Admin"
set desc = "Edit mobs's memory and role"
set name = "Show Traitor Panel"
@@ -1139,8 +1139,8 @@ var/global/enabled_spooking = 0
set category = "Debug"
set desc="Reduces view range when wearing welding helmets"
set name="Toggle tinted welding helmets."
config.welder_vision = !( config.welder_vision )
if (config.welder_vision)
GLOB.config.welder_vision = !( GLOB.config.welder_vision )
if (GLOB.config.welder_vision)
to_world("<B>Reduced welder vision has been enabled!</B>")
else
to_world("<B>Reduced welder vision has been disabled!</B>")
@@ -1152,18 +1152,18 @@ var/global/enabled_spooking = 0
set category = "Server"
set desc="Guests can't enter"
set name="Toggle guests"
config.guests_allowed = !(config.guests_allowed)
if (!(config.guests_allowed))
GLOB.config.guests_allowed = !(GLOB.config.guests_allowed)
if (!(GLOB.config.guests_allowed))
to_world("<B>Guests may no longer enter the game.</B>")
else
to_world("<B>Guests may now enter the game.</B>")
log_admin("[key_name(usr)] toggled guests game entering [config.guests_allowed?"":"dis"]allowed.")
message_admins("<span class='notice'>[key_name_admin(usr)] toggled guests game entering [config.guests_allowed?"":"dis"]allowed.</span>", 1)
log_admin("[key_name(usr)] toggled guests game entering [GLOB.config.guests_allowed?"":"dis"]allowed.")
message_admins("<span class='notice'>[key_name_admin(usr)] toggled guests game entering [GLOB.config.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()
var/ai_number = 0
for(var/mob/living/silicon/S in mob_list)
for(var/mob/living/silicon/S in GLOB.mob_list)
ai_number++
if(isAI(S))
to_chat(usr, "<b>AI [key_name(S, usr)]'s laws:</b>")
@@ -1277,12 +1277,12 @@ var/global/enabled_spooking = 0
to_chat(usr, "Mode has not started.")
return
var/antag_type = tgui_input_list(usr, "Choose a template.", "Force Latespawn", all_antag_types)
if(!antag_type || !all_antag_types[antag_type])
var/antag_type = tgui_input_list(usr, "Choose a template.", "Force Latespawn", GLOB.all_antag_types)
if(!antag_type || !GLOB.all_antag_types[antag_type])
to_chat(usr, "Aborting.")
return
var/datum/antagonist/antag = all_antag_types[antag_type]
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
message_admins("[key_name(usr)] attempting to force latespawn with template [antag.id].")
antag.attempt_auto_spawn()
+3 -3
View File
@@ -39,9 +39,9 @@
src << browse(F,"window=investigate[subject];size=800x300")
if("hrefs") //persistant logs and stuff
if(config && config.logsettings["log_hrefs"])
if(config.logfiles["world_href_log"])
src << browse(config.logfiles["world_href_log"], "window=investigate[subject];size=800x300")
if(GLOB.config && GLOB.config.logsettings["log_hrefs"])
if(GLOB.config.logfiles["world_href_log"])
src << browse(GLOB.config.logfiles["world_href_log"], "window=investigate[subject];size=800x300")
else
to_chat(src, "<span class='warning'>Error: admin_investigate: No href logfile found.</span>")
return
+13 -13
View File
@@ -76,7 +76,7 @@ var/list/forum_groupids_to_ranks = list()
/proc/load_admins()
clear_admins()
if(config.admin_legacy_system)
if(GLOB.config.admin_legacy_system)
//load text from file
var/list/Lines = file2list("config/admins.txt")
@@ -111,20 +111,20 @@ var/list/forum_groupids_to_ranks = list()
var/datum/admins/D = new /datum/admins(rank, rank_object?.rights || 0, ckey)
//find the client for a ckey if they are connected and associate them with the new admin datum
D.associate(directory[ckey])
D.associate(GLOB.directory[ckey])
LOG_DEBUG("AdminRanks: Updated Admins from Legacy System")
else
//The current admin system uses SQL
if(!establish_db_connection(dbcon))
if(!establish_db_connection(GLOB.dbcon))
log_world("ERROR: AdminRanks: Failed to connect to database in load_admins(). Reverting to legacy system.")
log_misc("AdminRanks: Failed to connect to database in load_admins(). Reverting to legacy system.")
config.admin_legacy_system = 1
GLOB.config.admin_legacy_system = 1
load_admins()
return
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, `rank`, flags FROM ss13_admins;")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, `rank`, flags FROM ss13_admins;")
query.Execute()
while(query.NextRow())
var/ckey = query.item[1]
@@ -135,12 +135,12 @@ var/list/forum_groupids_to_ranks = list()
var/datum/admins/D = new /datum/admins(rank, rights, ckey)
//find the client for a ckey if they are connected and associate them with the new admin datum
D.associate(directory[ckey])
D.associate(GLOB.directory[ckey])
if(!admin_datums)
log_world("ERROR: AdminRanks: The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system.")
log_misc("AdminRanks: The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system.")
config.admin_legacy_system = 1
GLOB.config.admin_legacy_system = 1
load_admins()
return
@@ -157,11 +157,11 @@ var/list/forum_groupids_to_ranks = list()
/proc/clear_admins()
//clear the datums references
admin_datums.Cut()
for(var/s in staff)
for(var/s in GLOB.staff)
var/client/C = s
C.remove_admin_verbs()
C.holder = null
staff.Cut()
GLOB.staff.Cut()
// Clears admins from the world config.
for (var/A in world.GetConfig("admin"))
@@ -170,7 +170,7 @@ var/list/forum_groupids_to_ranks = list()
/proc/update_admins_from_api(reload_once_done=FALSE)
set background = TRUE
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
log_and_message_admins("AdminRanks: Failed to connect to database in update_admins_from_api(). Carrying on with old staff lists.")
return FALSE
@@ -195,13 +195,13 @@ var/list/forum_groupids_to_ranks = list()
for (var/datum/forum_user/user in resp.body)
admins_to_push += user
var/DBQuery/prep_query = dbcon.NewQuery("UPDATE ss13_admins SET status = 0")
var/DBQuery/prep_query = GLOB.dbcon.NewQuery("UPDATE ss13_admins SET status = 0")
prep_query.Execute()
for (var/user in admins_to_push)
insert_user_to_admins_table(user)
var/DBQuery/del_query = dbcon.NewQuery("DELETE FROM ss13_admins WHERE status = 0")
var/DBQuery/del_query = GLOB.dbcon.NewQuery("DELETE FROM ss13_admins WHERE status = 0")
del_query.Execute()
if (reload_once_done)
@@ -231,5 +231,5 @@ var/list/forum_groupids_to_ranks = list()
var/datum/admin_rank/r = forum_groupids_to_ranks["[user.forum_primary_group]"]
primary_rank = r.rank_name
var/DBQuery/query = dbcon.NewQuery("INSERT INTO ss13_admins VALUES (:ckey:, :rank:, :flags:, 1) ON DUPLICATE KEY UPDATE rank = :rank:, flags = :flags:, status = 1")
var/DBQuery/query = GLOB.dbcon.NewQuery("INSERT INTO ss13_admins VALUES (:ckey:, :rank:, :flags:, 1) ON DUPLICATE KEY UPDATE rank = :rank:, flags = :flags:, status = 1")
query.Execute(list("ckey" = ckey(user.ckey), "rank" = primary_rank, "flags" = rights))
+34 -34
View File
@@ -503,7 +503,7 @@ var/list/admin_verbs_cciaa = list(
if(holder.rights & R_SERVER) add_verb(src, admin_verbs_server)
if(holder.rights & R_DEBUG)
add_verb(src, admin_verbs_debug)
if(config.debugparanoid && !(holder.rights & R_ADMIN))
if(GLOB.config.debugparanoid && !(holder.rights & R_ADMIN))
remove_verb(src, admin_verbs_paranoid_debug) //Right now it's just callproc but we can easily add others later on.
if(holder.rights & R_POSSESS) add_verb(src, admin_verbs_possess)
if(holder.rights & R_PERMISSIONS) add_verb(src, admin_verbs_permissions)
@@ -631,7 +631,7 @@ var/list/admin_verbs_cciaa = list(
set name = "Display Job bans"
set category = "Admin"
if(holder)
if(config.ban_legacy_system)
if(GLOB.config.ban_legacy_system)
holder.Jobbans()
else
holder.DB_ban_panel()
@@ -642,7 +642,7 @@ var/list/admin_verbs_cciaa = list(
set name = "Unban Panel"
set category = "Admin"
if(holder)
if(config.ban_legacy_system)
if(GLOB.config.ban_legacy_system)
holder.unbanpanel()
else
holder.DB_ban_panel()
@@ -824,7 +824,7 @@ var/list/admin_verbs_cciaa = list(
if(!check_rights(R_ADMIN)) return
var/mob/living/silicon/S = input("Select silicon.", "Rename Silicon.") as null|anything in silicon_mob_list
var/mob/living/silicon/S = input("Select silicon.", "Rename Silicon.") as null|anything in GLOB.silicon_mob_list
if(!S) return
var/new_name = sanitizeSafe(input(src, "Enter new name. Leave blank or as is to cancel.", "[S.real_name] - Enter new silicon name", S.real_name))
@@ -839,7 +839,7 @@ var/list/admin_verbs_cciaa = list(
if(!check_rights(R_ADMIN)) return
var/mob/living/silicon/S = input("Select silicon.", "Manage Silicon Laws") as null|anything in silicon_mob_list
var/mob/living/silicon/S = input("Select silicon.", "Manage Silicon Laws") as null|anything in GLOB.silicon_mob_list
if(!S) return
var/datum/tgui_module/admin/law_manager/L = new(S)
@@ -854,7 +854,7 @@ var/list/admin_verbs_cciaa = list(
if(!check_rights(R_FUN)) return
var/mob/living/carbon/human/H = tgui_input_list(usr, "Select mob.", "Change Mob Appearance - Self", human_mob_list)
var/mob/living/carbon/human/H = tgui_input_list(usr, "Select mob.", "Change Mob Appearance - Self", GLOB.human_mob_list)
if(!H) return
log_and_message_admins("is altering the appearance of [H].")
@@ -868,7 +868,7 @@ var/list/admin_verbs_cciaa = list(
if(!check_rights(R_FUN)) return
var/mob/living/carbon/human/H = tgui_input_list(usr, "Select mob.", "Change Mob Appearance - Self", human_mob_list)
var/mob/living/carbon/human/H = tgui_input_list(usr, "Select mob.", "Change Mob Appearance - Self", GLOB.human_mob_list)
if(!H) return
if(!H.client)
@@ -913,7 +913,7 @@ var/list/admin_verbs_cciaa = list(
if(!check_rights(R_FUN)) return
var/mob/living/carbon/human/M = input("Select mob.", "Edit Appearance") as null|anything in human_mob_list
var/mob/living/carbon/human/M = input("Select mob.", "Edit Appearance") as null|anything in GLOB.human_mob_list
if(!istype(M, /mob/living/carbon/human))
to_chat(usr, "<span class='warning'>You can only do this to humans!</span>")
@@ -953,12 +953,12 @@ var/list/admin_verbs_cciaa = list(
M.s_tone = -M.s_tone + 35
// hair
var/new_hstyle = input(usr, "Select a hair style", "Grooming") as null|anything in hair_styles_list
var/new_hstyle = input(usr, "Select a hair style", "Grooming") as null|anything in GLOB.hair_styles_list
if(new_hstyle)
M.h_style = new_hstyle
// facial hair
var/new_fstyle = input(usr, "Select a facial hair style", "Grooming") as null|anything in facial_hair_styles_list
var/new_fstyle = input(usr, "Select a facial hair style", "Grooming") as null|anything in GLOB.facial_hair_styles_list
if(new_fstyle)
M.f_style = new_fstyle
@@ -1015,13 +1015,13 @@ var/list/admin_verbs_cciaa = list(
set name = "Toggle ghost writers"
set category = "Server"
if(!holder) return
if(config)
if(config.cult_ghostwriter)
config.cult_ghostwriter = 0
if(GLOB.config)
if(GLOB.config.cult_ghostwriter)
GLOB.config.cult_ghostwriter = 0
to_chat(src, "<b>Disallowed ghost writers.</b>")
message_admins("Admin [key_name_admin(usr)] has disabled ghost writers.", 1)
else
config.cult_ghostwriter = 1
GLOB.config.cult_ghostwriter = 1
to_chat(src, "<b>Enabled ghost writers.</b>")
message_admins("Admin [key_name_admin(usr)] has enabled ghost writers.", 1)
@@ -1029,13 +1029,13 @@ var/list/admin_verbs_cciaa = list(
set name = "Toggle maintenance drones"
set category = "Server"
if(!holder) return
if(config)
if(config.allow_drone_spawn)
config.allow_drone_spawn = 0
if(GLOB.config)
if(GLOB.config.allow_drone_spawn)
GLOB.config.allow_drone_spawn = 0
to_chat(src, "<b>Disallowed maint drones.</b>")
message_admins("Admin [key_name_admin(usr)] has disabled maint drones.", 1)
else
config.allow_drone_spawn = 1
GLOB.config.allow_drone_spawn = 1
to_chat(src, "<b>Enabled maint drones.</b>")
message_admins("Admin [key_name_admin(usr)] has enabled maint drones.", 1)
@@ -1049,7 +1049,7 @@ var/list/admin_verbs_cciaa = list(
else
to_chat(usr, "You now won't get debug log messages")
/client/proc/damage_menu(mob/living/carbon/human/H as null|mob in human_mob_list)
/client/proc/damage_menu(mob/living/carbon/human/H as null|mob in GLOB.human_mob_list)
set name = "Damage Menu"
set desc = "Access a human mob's damage menu, allowing you to make their life hell."
set category = "Fun"
@@ -1057,7 +1057,7 @@ var/list/admin_verbs_cciaa = list(
if(H)
new /datum/tgui_module/damage_menu(WEAKREF(H), usr)
/client/proc/man_up(mob/T as mob in mob_list)
/client/proc/man_up(mob/T as mob in GLOB.mob_list)
set category = "Fun"
set name = "Man Up"
set desc = "Tells mob to man up and deal with it."
@@ -1073,14 +1073,14 @@ var/list/admin_verbs_cciaa = list(
set name = "Man Up Global"
set desc = "Tells everyone to man up and deal with it."
for (var/mob/T as mob in mob_list)
for (var/mob/T as mob in GLOB.mob_list)
to_chat(T, "<br><center><span class='notice'><b><font size=4>Man up.<br> Deal with it.</font></b><br>Move on.</span></center><br>")
sound_to(T, 'sound/voice/ManUp1.ogg')
log_admin("[key_name(usr)] told everyone to man up and deal with it.",admin_key=key_name(usr))
message_admins("<span class='notice'>[key_name_admin(usr)] told everyone to man up and deal with it.</span>", 1)
/client/proc/give_spell(mob/T as mob in mob_list) // -- Urist
/client/proc/give_spell(mob/T as mob in GLOB.mob_list) // -- Urist
set category = "Fun"
set name = "Give Spell"
set desc = "Gives a spell to a mob."
@@ -1099,15 +1099,15 @@ var/list/admin_verbs_cciaa = list(
if (!check_rights(R_SERVER|R_DEBUG))
return
var/ans = alert(src, "This will force explosions to run in the [config.use_spreading_explosions ? "old manner (circular)" : "new, realistic manner (spreading)"]. Do you want to proceed?", "Switch explosion type", "Yes", "Cancel")
var/ans = alert(src, "This will force explosions to run in the [GLOB.config.use_spreading_explosions ? "old manner (circular)" : "new, realistic manner (spreading)"]. Do you want to proceed?", "Switch explosion type", "Yes", "Cancel")
if (!ans || ans == "Cancel")
to_chat(src, "<span class='notice'>Cancelled.</span>")
return
config.use_spreading_explosions = !config.use_spreading_explosions
GLOB.config.use_spreading_explosions = !GLOB.config.use_spreading_explosions
log_and_message_admins("has toggled explosions to be [config.use_spreading_explosions ? "iterative/spreading" : "simple/circular"].")
log_and_message_admins("has toggled explosions to be [GLOB.config.use_spreading_explosions ? "iterative/spreading" : "simple/circular"].")
feedback_add_details("admin_verb", "TRE")
/client/proc/wipe_ai()
@@ -1153,7 +1153,7 @@ var/list/admin_verbs_cciaa = list(
log_and_message_admins("is attempting to reconnect the server to MySQL.")
dbcon.Reconnect()
GLOB.dbcon.Reconnect()
/client/proc/fix_player_list()
set category = "Special Verbs"
@@ -1167,19 +1167,19 @@ var/list/admin_verbs_cciaa = list(
return
log_and_message_admins("is rebuilding the master player mob list.")
for (var/P in player_list)
for (var/P in GLOB.player_list)
if (isnull(P) || !ismob(P))
var/msg = "P_LIST DEBUG: Found null entry in player_list!"
var/msg = "P_LIST DEBUG: Found null entry in GLOB.player_list!"
log_debug(msg)
message_admins(SPAN_DANGER(msg))
player_list -= P
GLOB.player_list -= P
else
var/mob/M = P
if (!M.client)
var/msg = "P_LIST DEBUG: Found a mob without a client in player_list! [M.name]"
var/msg = "P_LIST DEBUG: Found a mob without a client in GLOB.player_list! [M.name]"
log_debug(msg)
message_admins(SPAN_DANGER(msg))
player_list -= M
GLOB.player_list -= M
/client/proc/reset_openturf()
set category = "Debug"
@@ -1196,7 +1196,7 @@ var/list/admin_verbs_cciaa = list(
SSzcopy.hard_reset()
/client/proc/add_client_color(mob/T as mob in mob_list)
/client/proc/add_client_color(mob/T as mob in GLOB.mob_list)
set category = "Debug"
set name = "Add Client Color"
set desc = "Adds a client color to a given mob"
@@ -1305,7 +1305,7 @@ var/list/admin_verbs_cciaa = list(
for(var/turf in range(world.view, get_turf(AI.eyeobj)))
messageturfs += turf
for(var/mob/M in player_list)
for(var/mob/M in GLOB.player_list)
if(!M.client || istype(M, /mob/abstract/new_player))
continue
if(isAI(M))
@@ -1324,7 +1324,7 @@ var/list/admin_verbs_cciaa = list(
var/prefix
var/admin_stuff
for(var/client/target in clients)
for(var/client/target in GLOB.clients)
admin_stuff = ""
var/display_remote = FALSE
if (target.holder && ((R_MOD|R_ADMIN) & target.holder.rights))
+19 -19
View File
@@ -42,7 +42,7 @@ var/list/jobban_keylist = list() // Global jobban list.
* @return num 1
*/
/hook/startup/proc/loadJobBans()
if (config.ban_legacy_system)
if (GLOB.config.ban_legacy_system)
jobban_loadbanfile()
else
jobban_loaddatabase()
@@ -87,7 +87,7 @@ var/list/jobban_keylist = list() // Global jobban list.
jobban_keylist[key][rank] = list(reason, unban_time)
// Log the ban to the appropriate place.
if (config.ban_legacy_system)
if (GLOB.config.ban_legacy_system)
jobban_savebanfile()
else
DB_ban_record(minutes < 0 ? BANTYPE_JOB_PERMA : BANTYPE_JOB_TEMP, null, minutes, reason, rank, banckey = key)
@@ -111,9 +111,9 @@ var/list/jobban_keylist = list() // Global jobban list.
CKEY_OR_MOB(ckey, player)
if (ckey)
if (guest_jobbans(rank) && config.guest_jobban && IsGuestKey(ckey))
if (guest_jobbans(rank) && GLOB.config.guest_jobban && IsGuestKey(ckey))
return "GUEST JOB-BAN"
if (config.usewhitelist && ismob(player) && !check_whitelist_rank(player, rank))
if (GLOB.config.usewhitelist && ismob(player) && !check_whitelist_rank(player, rank))
return "WHITELISTED"
var/age_whitelist = player_old_enough_for_role(player, rank)
@@ -124,8 +124,8 @@ var/list/jobban_keylist = list() // Global jobban list.
if (isnull(antag_bantypes))
antag_bantypes = list()
for (var/antag_type in all_antag_types)
var/datum/antagonist/antag = all_antag_types[antag_type]
for (var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
if (antag && antag.bantype)
antag_bantypes |= antag.bantype
@@ -179,15 +179,15 @@ var/list/jobban_keylist = list() // Global jobban list.
*/
/proc/jobban_loaddatabase()
// No database. Weee.
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
log_world("ERROR: Database connection failed. Reverting to the legacy ban system.")
log_misc("Database connection failed. Reverting to the legacy ban system.")
config.ban_legacy_system = 1
GLOB.config.ban_legacy_system = 1
jobban_loadbanfile()
return
// All jobbans in one query. Because we don't actually care.
var/DBQuery/query = dbcon.NewQuery("SELECT id, ckey, job, reason FROM ss13_ban WHERE isnull(unbanned) AND ((bantype = 'JOB_PERMABAN') OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now()))")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id, ckey, job, reason FROM ss13_ban WHERE isnull(unbanned) AND ((bantype = 'JOB_PERMABAN') OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now()))")
query.Execute()
while (query.NextRow())
@@ -249,7 +249,7 @@ var/list/jobban_keylist = list() // Global jobban list.
jobban_keylist -= ckey
// Update appropriate ban files.
if (config.ban_legacy_system)
if (GLOB.config.ban_legacy_system)
jobban_savebanfile()
/**
@@ -269,7 +269,7 @@ var/list/jobban_keylist = list() // Global jobban list.
* FALSE if ban is not expired.
*/
/proc/jobban_isexpired(var/list/tuple, var/player, var/rank)
if (config.ban_legacy_system && tuple[2] && (tuple[2] > 0) && (tuple[2] < world.realtime))
if (GLOB.config.ban_legacy_system && tuple[2] && (tuple[2] > 0) && (tuple[2] < world.realtime))
// It's expired. Remove it.
jobban_unban(player, rank)
@@ -562,8 +562,8 @@ var/list/jobban_keylist = list() // Global jobban list.
var/isbanned_dept = jobban_isbanned(ckey, "Antagonist")
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
jobs += "<tr bgcolor='ffeeaa'><th colspan='10'><a href='?src=\ref[src];jobban_job=Antagonist;jobban_tgt=[ckey]'>Antagonist Positions</a></th></tr><tr align='center'>"
for (var/antag_type in all_antag_types)
var/datum/antagonist/antag = all_antag_types[antag_type]
for (var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
if (!antag || !antag.bantype)
continue
if (isbanned_dept || jobban_isbanned(ckey, antag.bantype))
@@ -608,7 +608,7 @@ var/list/jobban_keylist = list() // Global jobban list.
to_chat(usr, "<span class='warning'>You do not have the appropriate permissions to add job bans!</span>")
return 0
if (check_rights(R_MOD, 0) && !check_rights(R_ADMIN, 0) && !config.mods_can_job_tempban) // If mod and tempban disabled
if (check_rights(R_MOD, 0) && !check_rights(R_ADMIN, 0) && !GLOB.config.mods_can_job_tempban) // If mod and tempban disabled
to_chat(usr, "<span class='warning'>Mod jobbanning is disabled!</span>")
return 0
@@ -729,8 +729,8 @@ var/list/jobban_keylist = list() // Global jobban list.
var/mins = input(usr, "How long (in minutes)?", "Ban time", 1440) as num|null
if (!mins)
return 0
if (check_rights(R_MOD, 0) && !check_rights(R_BAN, 0) && mins > config.mod_job_tempban_max)
to_chat(usr, "<span class='warning'>Moderators can only job tempban up to [config.mod_job_tempban_max] minutes!</span>")
if (check_rights(R_MOD, 0) && !check_rights(R_BAN, 0) && mins > GLOB.config.mod_job_tempban_max)
to_chat(usr, "<span class='warning'>Moderators can only job tempban up to [GLOB.config.mod_job_tempban_max] minutes!</span>")
return 0
var/reason = sanitize(input(usr,"Reason?","Please State Reason","") as text|null)
if (!reason)
@@ -748,7 +748,7 @@ var/list/jobban_keylist = list() // Global jobban list.
msg = R
else
msg += ", [R]"
if (config.ban_legacy_system)
if (GLOB.config.ban_legacy_system)
notes_add(ckey, "Banned from [msg] - [reason]", usr)
else
notes_add_sql(ckey, "Banned from [msg] - [reason]", usr)
@@ -777,7 +777,7 @@ var/list/jobban_keylist = list() // Global jobban list.
else
msg += ", [R]"
if (config.ban_legacy_system)
if (GLOB.config.ban_legacy_system)
notes_add(ckey, "Banned from [msg] - [reason]", usr)
else
notes_add_sql(ckey, "Banned from [msg] - [reason]", usr)
@@ -795,7 +795,7 @@ var/list/jobban_keylist = list() // Global jobban list.
//Unbanning joblist
//all jobs in joblist are banned already OR we didn't give a reason (implying they shouldn't be banned)
if (joblist.len) //at least 1 banned job exists in joblist so we have stuff to unban.
if (!config.ban_legacy_system)
if (!GLOB.config.ban_legacy_system)
// This is important. jobban_unban() can't actually lift DB bans. So the DB unban
// panel must be used instead.
to_chat(usr, "Unfortunately, database based unbanning cannot be done through this panel")
+5 -5
View File
@@ -4,7 +4,7 @@
set name = "Advanced ProcCall"
if(!check_rights(R_DEBUG)) return
if(config.debugparanoid && !check_rights(R_ADMIN)) return
if(GLOB.config.debugparanoid && !check_rights(R_ADMIN)) return
var/target = null
var/targetselected = 0
@@ -20,7 +20,7 @@
if("Area or Turf")
target = input("Select target:", "Target", get_turf(usr)) as null|area|turf in world
if("Client")
target = input("Select target:", "Target", usr.client) as null|anything in clients
target = input("Select target:", "Target", usr.client) as null|anything in GLOB.clients
else
return
if(!target)
@@ -36,7 +36,7 @@
set name = "Advanced ProcCall Target"
if(!check_rights(R_DEBUG)) return
if(config.debugparanoid && !check_rights(R_ADMIN)) return
if(GLOB.config.debugparanoid && !check_rights(R_ADMIN)) return
callproc_targetpicked(1, A)
@@ -44,7 +44,7 @@
// this needs checking again here because VV's 'Call Proc' option directly calls this proc with the target datum
if(!check_rights(R_DEBUG)) return
if(config.debugparanoid && !check_rights(R_ADMIN)) return
if(GLOB.config.debugparanoid && !check_rights(R_ADMIN)) return
var/returnval = null
@@ -126,7 +126,7 @@
if(isnull(current)) return
if("client")
current = input("Select client for [arguments.len+1]\th argument") as null|anything in clients
current = input("Select client for [arguments.len+1]\th argument") as null|anything in GLOB.clients
if(isnull(current)) return
if("mob's area")
+6 -6
View File
@@ -4,7 +4,7 @@
if(!check_rights(R_DEV))
return
if(!establish_db_connection(dbcon))
if(!establish_db_connection(GLOB.dbcon))
to_chat(src,"<span class='danger'>Failed to establish database connection.</span>")
return
var/polltype = input("Choose poll type.","Poll Type") in list("Single Option","Text Reply","Rating","Multiple Choice")
@@ -24,7 +24,7 @@
if(!endtime)
return
endtime = sanitizeSQL(endtime)
var/DBQuery/query_validate_time = dbcon.NewQuery("SELECT STR_TO_DATE('[endtime]','%Y-%c-%d %T')")
var/DBQuery/query_validate_time = GLOB.dbcon.NewQuery("SELECT STR_TO_DATE('[endtime]','%Y-%c-%d %T')")
if(!query_validate_time.Execute())
var/err = query_validate_time.ErrorMsg()
to_chat(src, "SQL ERROR validating endtime. Error : \[[err]\]\n")
@@ -34,7 +34,7 @@
if(!endtime)
to_chat(src, "Datetime entered is invalid.")
return
var/DBQuery/query_time_later = dbcon.NewQuery("SELECT DATE('[endtime]') < NOW()")
var/DBQuery/query_time_later = GLOB.dbcon.NewQuery("SELECT DATE('[endtime]') < NOW()")
if(!query_time_later.Execute())
var/err = query_time_later.ErrorMsg()
to_chat(src, "SQL ERROR comparing endtime to NOW(). Error : \[[err]\]\n")
@@ -73,13 +73,13 @@
if(!question)
return
question = sanitizeSQL(question)
var/DBQuery/query_polladd_question = dbcon.NewQuery("INSERT INTO ss13_poll_question (polltype, starttime, endtime, question, adminonly, multiplechoiceoptions, createdby_ckey, createdby_ip, publicresult, viewtoken, link) VALUES ('[polltype]', '[starttime]', '[endtime]', '[question]', '[adminonly]', '[choice_amount]', '[sql_ckey]', '[address]', '[publicresult]', [viewtoken], [link])")
var/DBQuery/query_polladd_question = GLOB.dbcon.NewQuery("INSERT INTO ss13_poll_question (polltype, starttime, endtime, question, adminonly, multiplechoiceoptions, createdby_ckey, createdby_ip, publicresult, viewtoken, link) VALUES ('[polltype]', '[starttime]', '[endtime]', '[question]', '[adminonly]', '[choice_amount]', '[sql_ckey]', '[address]', '[publicresult]', [viewtoken], [link])")
if(!query_polladd_question.Execute())
var/err = query_polladd_question.ErrorMsg()
to_chat(src,"SQL ERROR adding new poll question to table. Error : \[[err]\]\n")
return
var/pollid = 0
var/DBQuery/query_get_id = dbcon.NewQuery("SELECT id FROM ss13_poll_question WHERE question = '[question]' AND starttime = '[starttime]' AND endtime = '[endtime]' AND createdby_ckey = '[sql_ckey]' AND createdby_ip = '[address]'")
var/DBQuery/query_get_id = GLOB.dbcon.NewQuery("SELECT id FROM ss13_poll_question WHERE question = '[question]' AND starttime = '[starttime]' AND endtime = '[endtime]' AND createdby_ckey = '[sql_ckey]' AND createdby_ip = '[address]'")
if(!query_get_id.Execute())
var/err = query_get_id.ErrorMsg()
to_chat(src,"SQL ERROR obtaining id from poll_question table. Error : \[[err]\]\n")
@@ -130,7 +130,7 @@
descmax = input("Optional: Set description for maximum rating","Maximum rating description") as message
if(descmax)
descmax = sanitizeSQL(descmax)
var/DBQuery/query_polladd_option = dbcon.NewQuery("INSERT INTO ss13_poll_option (pollid, text, percentagecalc, minval, maxval, descmin, descmid, descmax) VALUES ('[pollid]', '[option]', '[percentagecalc]', '[minval]', '[maxval]', '[descmin]', '[descmid]', '[descmax]')")
var/DBQuery/query_polladd_option = GLOB.dbcon.NewQuery("INSERT INTO ss13_poll_option (pollid, text, percentagecalc, minval, maxval, descmin, descmid, descmax) VALUES ('[pollid]', '[option]', '[percentagecalc]', '[minval]', '[maxval]', '[descmin]', '[descmid]', '[descmax]')")
if(!query_polladd_option.Execute())
var/err = query_polladd_option.ErrorMsg()
to_chat(src, "SQL ERROR adding new poll option to table. Error : \[[err]\]\n")
+3 -3
View File
@@ -50,18 +50,18 @@ var/list/admin_datums = list()
owner = C
owner.holder = src
owner.add_admin_verbs() //TODO
staff |= C
GLOB.staff |= C
/datum/admins/proc/disassociate()
if(owner)
staff -= owner
GLOB.staff -= owner
owner.remove_admin_verbs()
owner.deadmin_holder = owner.holder
owner.holder = null
/datum/admins/proc/reassociate()
if(owner)
staff += owner
GLOB.staff += owner
owner.holder = src
owner.deadmin_holder = null
owner.add_admin_verbs()
+13 -13
View File
@@ -14,18 +14,18 @@
. = FALSE
if (intel < 0)
return
if (intel <= config.ipintel_rating_bad)
if (world.realtime < cacherealtime+(config.ipintel_save_good*60*60*10))
if (intel <= GLOB.config.ipintel_rating_bad)
if (world.realtime < cacherealtime+(GLOB.config.ipintel_save_good*60*60*10))
return TRUE
else
if (world.realtime < cacherealtime+(config.ipintel_save_bad*60*60*10))
if (world.realtime < cacherealtime+(GLOB.config.ipintel_save_bad*60*60*10))
return TRUE
/proc/get_ip_intel(ip, bypasscache = FALSE, updatecache = TRUE)
var/datum/ipintel/res = new()
res.ip = ip
. = res
if (!ip || !config.ipintel_email || !SSipintel.enabled)
if (!ip || !GLOB.config.ipintel_email || !SSipintel.enabled)
return
if (!bypasscache)
var/datum/ipintel/cachedintel = SSipintel.cache[ip]
@@ -33,20 +33,20 @@
cachedintel.cache = TRUE
return cachedintel
if(establish_db_connection(dbcon))
var/DBQuery/query_get_ip_intel = dbcon.NewQuery({"
if(establish_db_connection(GLOB.dbcon))
var/DBQuery/query_get_ip_intel = GLOB.dbcon.NewQuery({"
SELECT date, intel, TIMESTAMPDIFF(MINUTE,date,NOW())
FROM ss13_ipintel
WHERE
ip = INET6_ATON('[ip]')
AND ((
intel < [config.ipintel_rating_bad]
intel < [GLOB.config.ipintel_rating_bad]
AND
date + INTERVAL [config.ipintel_save_good] HOUR > NOW()
date + INTERVAL [GLOB.config.ipintel_save_good] HOUR > NOW()
) OR (
intel >= [config.ipintel_rating_bad]
intel >= [GLOB.config.ipintel_rating_bad]
AND
date + INTERVAL [config.ipintel_save_bad] HOUR > NOW()
date + INTERVAL [GLOB.config.ipintel_save_bad] HOUR > NOW()
))
"})
if(!query_get_ip_intel.Execute())
@@ -62,8 +62,8 @@
res.intel = ip_intel_query(ip)
if (updatecache && res.intel >= 0)
SSipintel.cache[ip] = res
if(establish_db_connection(dbcon))
var/DBQuery/query_add_ip_intel = dbcon.NewQuery("INSERT INTO ss13_ipintel (ip, intel) VALUES (INET6_ATON('[ip]'), [res.intel]) ON DUPLICATE KEY UPDATE intel = VALUES(intel), date = NOW()")
if(establish_db_connection(GLOB.dbcon))
var/DBQuery/query_add_ip_intel = GLOB.dbcon.NewQuery("INSERT INTO ss13_ipintel (ip, intel) VALUES (INET6_ATON('[ip]'), [res.intel]) ON DUPLICATE KEY UPDATE intel = VALUES(intel), date = NOW()")
query_add_ip_intel.Execute()
@@ -77,7 +77,7 @@
if (!SSipintel.enabled)
return
var/list/http[] = world.Export("http://[config.ipintel_domain]/check.php?ip=[ip]&contact=[config.ipintel_email]&format=json&flags=f")
var/list/http[] = world.Export("http://[GLOB.config.ipintel_domain]/check.php?ip=[ip]&contact=[GLOB.config.ipintel_email]&format=json&flags=f")
if (http)
var/status = text2num(http["STATUS"])
@@ -37,7 +37,7 @@
admins += list(d)
data["admins"] = admins
data["forumuserui_enabled"] = config.use_forumuser_api
data["forumuserui_enabled"] = GLOB.config.use_forumuser_api
return data
@@ -96,7 +96,7 @@
if("*New Rank*")
new_rank = input("Please input a new rank", "New custom rank", null, null) as null|text
if(config.admin_legacy_system)
if(GLOB.config.admin_legacy_system)
new_rank = ckeyEx(new_rank)
if(!new_rank)
@@ -118,7 +118,7 @@
else
D = new /datum/admins(new_rank, rights, admin_ckey)
var/client/C = directory[admin_ckey] //find the client with the specified ckey (if they are logged in)
var/client/C = GLOB.directory[admin_ckey] //find the client with the specified ckey (if they are logged in)
D.associate(C) //link up with the client and add verbs
log_and_message_admins("edited the admin rank of [admin_ckey] to [new_rank]")
@@ -157,14 +157,14 @@
return new_ckey
/datum/tgui_module/permissions_panel/proc/log_admin_rank_modification(admin_ckey, new_rank)
if (config.admin_legacy_system)
if (GLOB.config.admin_legacy_system)
return
if (!check_rights(R_PERMISSIONS))
to_chat(usr, SPAN_DANGER("You do not have permission to do this!"))
return
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
to_chat(usr, SPAN_WARNING("Failed to establish database connection."))
return
@@ -176,7 +176,7 @@
if (!istext(admin_ckey) || !istext(new_rank))
return
var/DBQuery/select_query = dbcon.NewQuery("SELECT ckey FROM `ss13_admins` WHERE ckey = :ckey:")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT ckey FROM `ss13_admins` WHERE ckey = :ckey:")
select_query.Execute(list("ckey" = admin_ckey))
var/new_admin = TRUE
@@ -184,29 +184,29 @@
new_admin = FALSE
if (new_admin)
var/DBQuery/update_query = dbcon.NewQuery("INSERT INTO `ss13_admins` VALUES (:ckey:, :rank:, 0)")
var/DBQuery/update_query = GLOB.dbcon.NewQuery("INSERT INTO `ss13_admins` VALUES (:ckey:, :rank:, 0)")
update_query.Execute(list("ckey" = admin_ckey, "rank" = new_rank))
to_chat(usr, SPAN_NOTICE("New admin added to the DB."))
else if (new_rank != "Removed")
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE `ss13_admins` SET rank = :rank: WHERE ckey = :ckey:")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("UPDATE `ss13_admins` SET rank = :rank: WHERE ckey = :ckey:")
insert_query.Execute(list("ckey" = admin_ckey, "rank" = new_rank))
to_chat(usr, SPAN_NOTICE("Admin's rank changed."))
else if (new_rank == "Removed")
var/DBQuery/insert_query = dbcon.NewQuery("DELETE FROM ss13_admins WHERE ckey = :ckey:")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("DELETE FROM ss13_admins WHERE ckey = :ckey:")
insert_query.Execute(list("ckey" = admin_ckey))
to_chat(usr, SPAN_NOTICE("Admin removed."))
/datum/tgui_module/permissions_panel/proc/log_admin_permission_modification(admin_ckey, new_permission)
if (config.admin_legacy_system)
if (GLOB.config.admin_legacy_system)
return
if (!check_rights(R_PERMISSIONS))
to_chat(usr, SPAN_DANGER("You do not have permission to do this!"))
return
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
to_chat(usr, SPAN_WARNING("Failed to establish database connection."))
return
@@ -221,7 +221,7 @@
if(!istext(admin_ckey) || !isnum(new_permission))
return
var/DBQuery/select_query = dbcon.NewQuery("SELECT flags FROM ss13_admins WHERE ckey = :ckey:")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT flags FROM ss13_admins WHERE ckey = :ckey:")
select_query.Execute(list("ckey" = admin_ckey))
var/admin_rights = 0
@@ -231,10 +231,10 @@
return
if(admin_rights & new_permission) //This admin already has this permission, so we are removing it.
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE `ss13_admins` SET flags = :flags: WHERE ckey = :ckey:")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("UPDATE `ss13_admins` SET flags = :flags: WHERE ckey = :ckey:")
insert_query.Execute(list("flags" = admin_rights & ~new_permission, "ckey" = admin_ckey))
to_chat(usr, SPAN_NOTICE("Permission removed."))
else //This admin doesn't have this permission, so we are adding it.
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE `ss13_admins` SET flags = :flags: WHERE ckey = :ckey:")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("UPDATE `ss13_admins` SET flags = :flags: WHERE ckey = :ckey:")
insert_query.Execute(list("flags" = admin_rights | new_permission, "ckey" = admin_ckey))
to_chat(usr, SPAN_NOTICE("Permission added."))
+14 -14
View File
@@ -12,12 +12,12 @@
else
query_details["a_ckey"] = user.ckey
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
alert("SQL connection failed while trying to add a note!")
return
if (!player_address || !player_computerid)
var/DBQuery/init_query = dbcon.NewQuery("SELECT ip, computerid FROM ss13_player WHERE ckey = :ckey:")
var/DBQuery/init_query = GLOB.dbcon.NewQuery("SELECT ip, computerid FROM ss13_player WHERE ckey = :ckey:")
init_query.Execute(list("ckey" = player_ckey))
if (init_query.NextRow())
if (!query_details["address"])
@@ -25,7 +25,7 @@
if (!query_details["computer_id"])
query_details["computer_id"] = init_query.item[2]
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO ss13_notes (id, adddate, game_id, ckey, ip, computerid, a_ckey, content) VALUES (null, Now(), :game_id:, :ckey:, :address:, :computer_id:, :a_ckey:, :note:)")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("INSERT INTO ss13_notes (id, adddate, game_id, ckey, ip, computerid, a_ckey, content) VALUES (null, Now(), :game_id:, :ckey:, :address:, :computer_id:, :a_ckey:, :note:)")
insert_query.Execute(query_details)
message_admins("<span class='notice'>[key_name_admin(user)] has edited [player_ckey]'s notes.</span>")
@@ -35,7 +35,7 @@
if (!note_id || !note_edit)
return
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
log_world("ERROR: SQL connection failed while attempting to delete a note!")
return
@@ -43,7 +43,7 @@
var/ckey
var/note
var/DBQuery/init_query = dbcon.NewQuery("SELECT ckey, content FROM ss13_notes WHERE id = :note_id:")
var/DBQuery/init_query = GLOB.dbcon.NewQuery("SELECT ckey, content FROM ss13_notes WHERE id = :note_id:")
init_query.Execute(list("note_id" = note_id))
while (init_query.NextRow())
ckey = init_query.item[1]
@@ -63,7 +63,7 @@
switch (note_edit)
if ("delete")
if(alert("Delete this note?", "Delete?", "Yes", "No") == "Yes")
var/DBQuery/deletequery = dbcon.NewQuery("UPDATE ss13_notes SET visible = 0 WHERE id = :note_id:")
var/DBQuery/deletequery = GLOB.dbcon.NewQuery("UPDATE ss13_notes SET visible = 0 WHERE id = :note_id:")
deletequery.Execute(list("note_id" = note_id))
message_admins("<span class='notice'>[key_name_admin(usr)] deleted one of [ckey]'s notes.</span>")
@@ -76,7 +76,7 @@
if (!new_content)
to_chat(usr, "Cancelled")
return
var/DBQuery/editquery = dbcon.NewQuery("UPDATE ss13_notes SET content = :new_content:, lasteditor = :a_ckey:, lasteditdate = Now(), edited = 1 WHERE id = :note_id:")
var/DBQuery/editquery = GLOB.dbcon.NewQuery("UPDATE ss13_notes SET content = :new_content:, lasteditor = :a_ckey:, lasteditdate = Now(), edited = 1 WHERE id = :note_id:")
editquery.Execute(list("new_content" = new_content, "a_ckey" = usr.client.ckey, "note_id" = note_id))
/datum/admins/proc/show_notes_sql(var/player_ckey = null, var/admin_ckey = null)
@@ -91,7 +91,7 @@
player_ckey = ckey(player_ckey)
admin_ckey = ckey(admin_ckey)
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
log_world("ERROR: SQL connection failed while attempting to view a player's notes!")
return
@@ -119,7 +119,7 @@
dat += "<tr><td align='center' colspan='4' bgcolor='white'><b><a href='?src=\ref[src];add_player_info=[player_ckey]'>Add Note</a></b></td></tr>"
var/DBQuery/init_query = dbcon.NewQuery("SELECT ip, computerid FROM ss13_player WHERE ckey = :player_ckey:")
var/DBQuery/init_query = GLOB.dbcon.NewQuery("SELECT ip, computerid FROM ss13_player WHERE ckey = :player_ckey:")
init_query.Execute(query_details)
if (init_query.NextRow())
query_details["player_address"] = init_query.item[1]
@@ -133,7 +133,7 @@
query_content += " OR computerid = :player_computerid: AND visible = '1'"
query_content += " ORDER BY adddate ASC"
var/DBQuery/query = dbcon.NewQuery(query_content)
var/DBQuery/query = GLOB.dbcon.NewQuery(query_content)
query.Execute(query_details)
while (query.NextRow())
@@ -157,7 +157,7 @@
else if (admin_ckey && !player_ckey)
var/aquery_content = "SELECT id, adddate, ckey, content, edited, lasteditor, lasteditdate FROM ss13_notes WHERE a_ckey = :a_ckey: AND visible = '1' ORDER BY adddate ASC"
var/DBQuery/admin_query = dbcon.NewQuery(aquery_content)
var/DBQuery/admin_query = GLOB.dbcon.NewQuery(aquery_content)
admin_query.Execute(list("a_ckey" = admin_ckey))
while (admin_query.NextRow())
@@ -182,10 +182,10 @@
if (!ckey)
return "No ckey given!"
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
return "Unable to establish database connection! Aborting!"
var/DBQuery/info_query = dbcon.NewQuery("SELECT ip, computerid FROM ss13_player WHERE ckey = :ckey:")
var/DBQuery/info_query = GLOB.dbcon.NewQuery("SELECT ip, computerid FROM ss13_player WHERE ckey = :ckey:")
info_query.Execute(list("ckey" = ckey))
var/address = null
@@ -201,7 +201,7 @@
if (computer_id)
query_content += " OR computerid = :computerid:"
var/DBQuery/query = dbcon.NewQuery(query_content)
var/DBQuery/query = GLOB.dbcon.NewQuery(query_content)
query.Execute(query_details)
var/notes
+2 -2
View File
@@ -76,8 +76,8 @@
data["round_delayed"] = SSticker.delay_end
data["antagonists"] = list()
data["antagonist_types"] = list()
for(var/antag_type in all_antag_types)
var/datum/antagonist/A = all_antag_types[antag_type]
for(var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/A = GLOB.all_antag_types[antag_type]
for(var/datum/mind/mind in A.current_antagonists)
var/mob/M = mind.current
data["antagonists"] += list(list(
@@ -6,8 +6,8 @@
if(!.)
return
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!"
user << browse(dat, "window=admin_log")
@@ -7,6 +7,6 @@
return
var/dat = "<B>Bombing List</B>"
for(var/l in bombers)
for(var/l in GLOB.bombers)
dat += text("[l]<BR>")
user << browse(dat, "window=bombers")
@@ -7,7 +7,7 @@
return
var/dat = "<B>Showing DNA from blood.</B><HR>"
dat += "<table cellspacing=5><tr><th>Name</th><th>DNA</th><th>Blood Type</th></tr>"
for(var/mob/living/carbon/human/H in mob_list)
for(var/mob/living/carbon/human/H in GLOB.mob_list)
if(H.dna && H.ckey)
dat += "<tr><td>[H]</td><td>[H.dna.unique_enzymes]</td><td>[H.b_type]</td></tr>"
dat += "</table>"
@@ -7,7 +7,7 @@
return
var/dat = "<B>Showing Fingerprints.</B><HR>"
dat += "<table cellspacing=5><tr><th>Name</th><th>Fingerprints</th></tr>"
for(var/mob/living/carbon/human/H in mob_list)
for(var/mob/living/carbon/human/H in GLOB.mob_list)
if(H.ckey)
if(H.dna && H.dna.uni_identity)
dat += "<tr><td>[H]</td><td>[md5(H.dna.uni_identity)]</td></tr>"
@@ -2,14 +2,14 @@
name = "Show law changes"
/datum/admin_secret_item/admin_secret/show_law_changes/name()
return "Show Last [length(lawchanges)] Law change\s"
return "Show Last [length(GLOB.lawchanges)] Law change\s"
/datum/admin_secret_item/admin_secret/show_law_changes/execute(var/mob/user)
. = ..()
if(!.)
return
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>"
user << browse(dat, "window=lawchanges;size=800x500")
@@ -2,14 +2,14 @@
name = "Show Last Signalers"
/datum/admin_secret_item/admin_secret/show_signalers/name()
return "Show Last [length(lastsignalers)] Signaler\s"
return "Show Last [length(GLOB.lastsignalers)] Signaler\s"
/datum/admin_secret_item/admin_secret/show_signalers/execute(var/mob/user)
. = ..()
if(!.)
return
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>"
user << browse(dat, "window=lastsignalers;size=800x500")
@@ -12,7 +12,7 @@
return
var/list/affected_areas = list()
for(var/mob/M in living_mob_list)
for(var/mob/M in GLOB.living_mob_list)
if(M.stat == CONSCIOUS && !(M in affected_mobs))
affected_mobs |= M
switch(rand(1,4))
@@ -25,6 +25,6 @@
set_switches(null)
/datum/admin_secret_item/fun_secret/light_switches/proc/set_switches(var/new_state)
for(var/area/A in all_areas)
for(var/area/A in GLOB.all_areas)
if(A.lightswitch != new_state)
A.set_lightswitch(new_state)
@@ -6,8 +6,8 @@
if(!.)
return
for(var/species in all_species)
var/datum/species/S = all_species[species]
for(var/species in GLOB.all_species)
var/datum/species/S = GLOB.all_species[species]
S.blood_color = "rainbow"
for(var/obj/effect/decal/cleanable/blood/B in world)
B.basecolor = "rainbow"
@@ -7,15 +7,15 @@
if(!.)
return
switch(max_explosion_range)
if(14) max_explosion_range = 16
if(16) max_explosion_range = 20
if(20) max_explosion_range = 28
if(28) max_explosion_range = 56
if(56) max_explosion_range = 128
if(128) max_explosion_range = 14
var/range_dev = max_explosion_range *0.25
var/range_high = max_explosion_range *0.5
var/range_low = max_explosion_range
switch(GLOB.max_explosion_range)
if(14) GLOB.max_explosion_range = 16
if(16) GLOB.max_explosion_range = 20
if(20) GLOB.max_explosion_range = 28
if(28) GLOB.max_explosion_range = 56
if(56) GLOB.max_explosion_range = 128
if(128) GLOB.max_explosion_range = 14
var/range_dev = GLOB.max_explosion_range *0.25
var/range_high = GLOB.max_explosion_range *0.5
var/range_low = GLOB.max_explosion_range
message_admins("<span class='danger'>[key_name_admin(user)] changed the bomb cap to [range_dev], [range_high], [range_low]</span>", 1)
log_admin("[key_name(user)] changed the bomb cap to [max_explosion_range]",admin_key=key_name(user))
log_admin("[key_name(user)] changed the bomb cap to [GLOB.max_explosion_range]",admin_key=key_name(user))
@@ -6,6 +6,6 @@
if(!.)
return
for(var/mob/living/carbon/human/H in mob_list)
for(var/mob/living/carbon/human/H in GLOB.mob_list)
spawn(0)
H.corgize()
@@ -6,6 +6,6 @@
if(!.)
return
for(var/mob/living/carbon/human/H in mob_list)
for(var/mob/living/carbon/human/H in GLOB.mob_list)
spawn(0)
H.monkeyize()
@@ -15,14 +15,14 @@
if(!.)
return
gravity_is_on = !gravity_is_on
GLOB.gravity_is_on = !GLOB.gravity_is_on
for(var/A in SSmachinery.gravity_generators)
var/obj/machinery/gravity_generator/main/B = A
B.eventshutofftoggle()
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(user)] toggled gravity on.", admin_key=key_name(user))
message_admins("<span class='notice'>[key_name_admin(user)] toggled gravity on.</span>", 1)
command_announcement.Announce("Gravity generators are again functioning within normal parameters. Sorry for any inconvenience.")
+20 -20
View File
@@ -32,8 +32,8 @@
return
ban["message"] = "[reason]"
if(establish_db_connection(dbcon))
var/DBQuery/query_create_stickyban = dbcon.NewQuery("INSERT INTO ss13_stickyban (ckey, reason, banning_admin) VALUES ('[sanitizeSQL(ckey)]', '[sanitizeSQL(ban["message"])]', '[sanitizeSQL(usr.ckey)]')")
if(establish_db_connection(GLOB.dbcon))
var/DBQuery/query_create_stickyban = GLOB.dbcon.NewQuery("INSERT INTO ss13_stickyban (ckey, reason, banning_admin) VALUES ('[sanitizeSQL(ckey)]', '[sanitizeSQL(ban["message"])]', '[sanitizeSQL(usr.ckey)]')")
if (query_create_stickyban.Execute())
ban["fromdb"] = TRUE
@@ -64,17 +64,17 @@
world.SetConfig("ban",ckey, null)
SSstickyban.cache -= ckey
if (establish_db_connection(dbcon))
var/DBQuery/query = dbcon.NewQuery("DELETE FROM ss13_stickyban WHERE ckey = '[sanitizeSQL(ckey)]'")
if (establish_db_connection(GLOB.dbcon))
var/DBQuery/query = GLOB.dbcon.NewQuery("DELETE FROM ss13_stickyban WHERE ckey = '[sanitizeSQL(ckey)]'")
query.Execute()
query = dbcon.NewQuery("DELETE FROM ss13_stickyban_matched_ckey WHERE stickyban = '[sanitizeSQL(ckey)]'")
query = GLOB.dbcon.NewQuery("DELETE FROM ss13_stickyban_matched_ckey WHERE stickyban = '[sanitizeSQL(ckey)]'")
query.Execute()
query = dbcon.NewQuery("DELETE FROM ss13_stickyban_matched_cid WHERE stickyban = '[sanitizeSQL(ckey)]'")
query = GLOB.dbcon.NewQuery("DELETE FROM ss13_stickyban_matched_cid WHERE stickyban = '[sanitizeSQL(ckey)]'")
query.Execute()
query = dbcon.NewQuery("DELETE FROM ss13_stickyban_matched_ip WHERE stickyban = '[sanitizeSQL(ckey)]'")
query = GLOB.dbcon.NewQuery("DELETE FROM ss13_stickyban_matched_ip WHERE stickyban = '[sanitizeSQL(ckey)]'")
query.Execute()
@@ -117,8 +117,8 @@
SSstickyban.cache[ckey] = ban
if (establish_db_connection(dbcon))
var/DBQuery/query_remove_stickyban_alt = dbcon.NewQuery("DELETE FROM ss13_stickyban_matched_ckey WHERE stickyban = '[sanitizeSQL(ckey)]' AND matched_ckey = '[sanitizeSQL(alt)]'")
if (establish_db_connection(GLOB.dbcon))
var/DBQuery/query_remove_stickyban_alt = GLOB.dbcon.NewQuery("DELETE FROM ss13_stickyban_matched_ckey WHERE stickyban = '[sanitizeSQL(ckey)]' AND matched_ckey = '[sanitizeSQL(alt)]'")
query_remove_stickyban_alt.Execute()
log_and_message_admins("has disassociated [alt] from [ckey]'s sticky ban")
@@ -146,8 +146,8 @@
SSstickyban.cache[ckey] = ban
if (establish_db_connection(dbcon))
var/DBQuery/query_edit_stickyban = dbcon.NewQuery("UPDATE ss13_stickyban SET reason = '[sanitizeSQL(reason)]' WHERE ckey = '[sanitizeSQL(ckey)]'")
if (establish_db_connection(GLOB.dbcon))
var/DBQuery/query_edit_stickyban = GLOB.dbcon.NewQuery("UPDATE ss13_stickyban SET reason = '[sanitizeSQL(reason)]' WHERE ckey = '[sanitizeSQL(ckey)]'")
query_edit_stickyban.Execute()
log_and_message_admins("has edited [ckey]'s sticky ban reason from [oldreason] to [reason]")
@@ -191,8 +191,8 @@
SSstickyban.cache[ckey] = ban
if (establish_db_connection(dbcon))
var/DBQuery/query_exempt_stickyban_alt = dbcon.NewQuery("UPDATE ss13_stickyban_matched_ckey SET exempt = 1 WHERE stickyban = '[sanitizeSQL(ckey)]' AND matched_ckey = '[sanitizeSQL(alt)]'")
if (establish_db_connection(GLOB.dbcon))
var/DBQuery/query_exempt_stickyban_alt = GLOB.dbcon.NewQuery("UPDATE ss13_stickyban_matched_ckey SET exempt = 1 WHERE stickyban = '[sanitizeSQL(ckey)]' AND matched_ckey = '[sanitizeSQL(alt)]'")
query_exempt_stickyban_alt.Execute()
log_and_message_admins("has exempted [alt] from [ckey]'s sticky ban")
@@ -236,8 +236,8 @@
SSstickyban.cache[ckey] = ban
if (establish_db_connection(dbcon))
var/DBQuery/query_unexempt_stickyban_alt = dbcon.NewQuery("UPDATE ss13_stickyban_matched_ckey SET exempt = 0 WHERE stickyban = '[sanitizeSQL(ckey)]' AND matched_ckey = '[sanitizeSQL(alt)]'")
if (establish_db_connection(GLOB.dbcon))
var/DBQuery/query_unexempt_stickyban_alt = GLOB.dbcon.NewQuery("UPDATE ss13_stickyban_matched_ckey SET exempt = 0 WHERE stickyban = '[sanitizeSQL(ckey)]' AND matched_ckey = '[sanitizeSQL(alt)]'")
query_unexempt_stickyban_alt.Execute()
log_and_message_admins("has unexempted [alt] from [ckey]'s sticky ban")
@@ -245,7 +245,7 @@
if ("timeout")
if (!data["ckey"])
return
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
to_chat(usr, "<span class='adminnotice'>No database connection!</span>")
return
@@ -271,7 +271,7 @@
if ("untimeout")
if (!data["ckey"])
return
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
to_chat(usr, "<span class='adminnotice'>No database connection!</span>")
return
var/ckey = data["ckey"]
@@ -322,7 +322,7 @@
if (!ban)
return
var/timeout
if (establish_db_connection(dbcon))
if (establish_db_connection(GLOB.dbcon))
timeout = "<a href='?_src_=holder;stickyban=[(ban["timeout"] ? "untimeout" : "timeout")]&ckey=[ckey]'>\[[(ban["timeout"] ? "untimeout" : "timeout" )]\]</a>"
else
timeout = "<a href='?_src_=holder;stickyban=revert&ckey=[ckey]'>\[revert\]</a>"
@@ -372,7 +372,7 @@
usr << browse(html,"window=stickybans;size=700x400")
/proc/sticky_banned_ckeys()
if (establish_db_connection(dbcon) || length(SSstickyban.dbcache))
if (establish_db_connection(GLOB.dbcon) || length(SSstickyban.dbcache))
if (SSstickyban.dbcacheexpire < world.time)
SSstickyban.Populatedbcache()
if (SSstickyban.dbcacheexpire)
@@ -385,7 +385,7 @@
. = list()
if (!ckey)
return null
if (establish_db_connection(dbcon) || length(SSstickyban.dbcache))
if (establish_db_connection(GLOB.dbcon) || length(SSstickyban.dbcache))
if (SSstickyban.dbcacheexpire < world.time)
SSstickyban.Populatedbcache()
if (SSstickyban.dbcacheexpire)
+18 -18
View File
@@ -1,5 +1,5 @@
var/global/list/tickets = list()
var/global/list/ticket_panels = list()
GLOBAL_LIST_EMPTY(tickets)
GLOBAL_LIST_EMPTY(ticket_panels)
/datum/ticket
var/owner
@@ -19,13 +19,13 @@ var/global/list/ticket_panels = list()
/datum/ticket/New(var/owner)
src.owner = owner
tickets |= src
id = tickets.len
GLOB.tickets |= src
id = GLOB.tickets.len
opened_time = world.time
opened_rt = world.realtime
if (config.ticket_reminder_period)
reminder_timer = addtimer(CALLBACK(src, PROC_REF(remind)), config.ticket_reminder_period SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE)
if (GLOB.config.ticket_reminder_period)
reminder_timer = addtimer(CALLBACK(src, PROC_REF(remind)), GLOB.config.ticket_reminder_period SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE)
/datum/ticket/proc/broadcast_closure(closing_user)
var/client/owner_client = client_by_ckey(owner)
@@ -128,20 +128,20 @@ var/global/list/ticket_panels = list()
if (!admin_found)
message_admins("<span class='danger'><b>[owner]'s ticket has yet to be closed!</b></span>")
for(var/s in staff)
for(var/s in GLOB.staff)
var/client/C = s
if((C.holder.rights & (R_ADMIN|R_MOD)) && (C.prefs.toggles & SOUND_ADMINHELP))
sound_to(C, 'sound/effects/adminhelp.ogg')
reminder_timer = addtimer(CALLBACK(src, PROC_REF(remind)), config.ticket_reminder_period SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE)
reminder_timer = addtimer(CALLBACK(src, PROC_REF(remind)), GLOB.config.ticket_reminder_period SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE)
/proc/get_open_ticket_by_ckey(var/owner)
for(var/datum/ticket/ticket in tickets)
for(var/datum/ticket/ticket in GLOB.tickets)
if(ticket.owner == owner && (ticket.status == TICKET_OPEN || ticket.status == TICKET_ASSIGNED))
return ticket // there should only be one open ticket by a client at a time, so no need to keep looking
/proc/get_ticket_by_id(id)
for (var/datum/ticket/ticket in tickets)
for (var/datum/ticket/ticket in GLOB.tickets)
if (ticket.id == id)
return ticket
@@ -162,10 +162,10 @@ var/global/list/ticket_panels = list()
if (status != TICKET_CLOSED)
return
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
return
var/DBQuery/Q = dbcon.NewQuery({"INSERT INTO ss13_tickets
var/DBQuery/Q = GLOB.dbcon.NewQuery({"INSERT INTO ss13_tickets
(game_id, message_count, admin_count, admin_list, opened_by, taken_by, closed_by, response_delay, opened_at, closed_at)
VALUES
(:g_id:, :m_count:, :a_count:, :a_list:, :opened_by:, :taken_by:, :closed_by:, :delay:, :opened_at:, :closed_at:)"})
@@ -216,8 +216,8 @@ var/global/list/ticket_panels = list()
var/valid_holder = check_rights(R_MOD|R_ADMIN, FALSE, ticket_panel_window.user)
var/list/ticket_dat = list()
for(var/id = tickets.len, id >= 1, id--)
var/datum/ticket/ticket = tickets[id]
for(var/id = GLOB.tickets.len, id >= 1, id--)
var/datum/ticket/ticket = GLOB.tickets[id]
if(valid_holder || ticket.owner == C.ckey)
var/client/owner_client = client_by_ckey(ticket.owner)
var/status = "Unknown status"
@@ -275,7 +275,7 @@ var/global/list/ticket_panels = list()
..()
if(href_list["close"])
ticket_panels -= usr.client
GLOB.ticket_panels -= usr.client
switch(href_list["action"])
if("unview")
@@ -318,15 +318,15 @@ var/global/list/ticket_panels = list()
set category = "Admin"
var/datum/ticket_panel/ticket_panel = new()
ticket_panels[src] = ticket_panel
GLOB.ticket_panels[src] = ticket_panel
ticket_panel.ticket_panel_window = new(src.mob, "ticketpanel", "Ticket Manager", 1024, 768, ticket_panel)
ticket_panel.ticket_panel_window.set_content(ticket_panel.get_dat())
ticket_panel.ticket_panel_window.open()
/proc/update_ticket_panels()
for(var/client/C in ticket_panels)
var/datum/ticket_panel/ticket_panel = ticket_panels[C]
for(var/client/C in GLOB.ticket_panels)
var/datum/ticket_panel/ticket_panel = GLOB.ticket_panels[C]
if(C.mob != ticket_panel.ticket_panel_window.user)
C.view_tickets()
else
+37 -37
View File
@@ -74,7 +74,7 @@
var/mob/playermob
for(var/mob/M in player_list)
for(var/mob/M in GLOB.player_list)
if(M.ckey == banckey)
playermob = M
break
@@ -90,7 +90,7 @@
else
message_admins("Ban process: A mob matching [playermob.ckey] was found at location [playermob.x], [playermob.y], [playermob.z]. Custom ip and computer id fields replaced with the ip and computer id from the located mob")
if (config.ban_legacy_system)
if (GLOB.config.ban_legacy_system)
notes_add(banckey,banreason,usr)
else
notes_add_sql(banckey, banreason, usr, banip, bancid)
@@ -284,7 +284,7 @@
to_chat(usr, "<span class='warning'>You do not have the appropriate permissions to add bans!</span>")
return
if(check_rights(R_MOD,0) && !check_rights(R_ADMIN, 0) && !config.mods_can_job_tempban) // If mod and tempban disabled
if(check_rights(R_MOD,0) && !check_rights(R_ADMIN, 0) && !GLOB.config.mods_can_job_tempban) // If mod and tempban disabled
to_chat(usr, "<span class='warning'>Mod jobbanning is disabled!</span>")
return
@@ -298,8 +298,8 @@
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
if(!mins)
return
if(check_rights(R_MOD, 0) && !check_rights(R_BAN, 0) && mins > config.mod_tempban_max)
to_chat(usr, "<span class='warning'>Moderators can only job tempban up to [config.mod_tempban_max] minutes!</span>")
if(check_rights(R_MOD, 0) && !check_rights(R_BAN, 0) && mins > GLOB.config.mod_tempban_max)
to_chat(usr, "<span class='warning'>Moderators can only job tempban up to [GLOB.config.mod_tempban_max] minutes!</span>")
return
if(mins >= 525600) mins = 525599
var/reason = sanitize(input(usr,"Reason?","reason","Griefer") as text|null)
@@ -307,7 +307,7 @@
return
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 1, mins)
ban_unban_log_save("[usr.client.ckey] has banned [M.ckey]. - Reason: [reason] - This will be removed in [mins] minutes.")
if (config.ban_legacy_system)
if (GLOB.config.ban_legacy_system)
notes_add(M.ckey,"[usr.client.ckey] has banned [M.ckey]. - Reason: [reason] - This will be removed in [mins] minutes.",usr)
else
notes_add_sql(M.ckey, "[usr.client.ckey] has banned [M.ckey]. - Reason: [reason] - This will be removed in [mins] minutes.", usr, M.lastKnownIP, M.computer_id)
@@ -316,8 +316,8 @@
feedback_inc("ban_tmp",1)
DB_ban_record(BANTYPE_TEMP, M, mins, reason)
feedback_inc("ban_tmp_mins",mins)
if(config.banappeals)
to_chat_immediate(M, "<span class='warning'>To try to resolve this matter head to [config.banappeals]</span>")
if(GLOB.config.banappeals)
to_chat_immediate(M, "<span class='warning'>To try to resolve this matter head to [GLOB.config.banappeals]</span>")
else
to_chat_immediate(M, "<span class='warning'>No ban appeals URL has been set.</span>")
log_admin("[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.",admin_key=key_name(usr),ckey=key_name(M))
@@ -338,12 +338,12 @@
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0)
to_chat(M, "<span class='danger'><BIG>You have been banned by [usr.client.ckey].\nReason: [reason].</BIG></span>")
to_chat(M, "<span class='warning'>This is a permanent ban.</span>")
if(config.banappeals)
to_chat(M, "<span class='warning'>To try to resolve this matter head to [config.banappeals]</span>")
if(GLOB.config.banappeals)
to_chat(M, "<span class='warning'>To try to resolve this matter head to [GLOB.config.banappeals]</span>")
else
to_chat(M, "<span class='warning'>No ban appeals URL has been set.</span>")
ban_unban_log_save("[usr.client.ckey] has permabanned [M.ckey]. - Reason: [reason] - This is a permanent ban.")
if (config.ban_legacy_system)
if (GLOB.config.ban_legacy_system)
notes_add(M.ckey,"[usr.client.ckey] has permabanned [M.ckey]. - Reason: [reason] - This is a permanent ban.",usr)
else
notes_add_sql(M.ckey, "[usr.client.ckey] has permabanned [M.ckey]. - Reason: [reason] - This is a permanent ban.", usr, M.lastKnownIP, M.computer_id)
@@ -376,11 +376,11 @@
if(ROUND_IS_STARTED)
return alert(usr, "The game has already started.", null, null, null, null)
var/dat = {"<B>What mode do you wish to play?</B><HR>"}
for(var/mode in config.modes)
dat += {"<A href='?src=\ref[src];c_mode2=[mode]'>[config.mode_names[mode]]</A><br>"}
for(var/mode in GLOB.config.modes)
dat += {"<A href='?src=\ref[src];c_mode2=[mode]'>[GLOB.config.mode_names[mode]]</A><br>"}
dat += {"<A href='?src=\ref[src];c_mode2=secret'>Secret</A><br>"}
dat += {"<A href='?src=\ref[src];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"])
@@ -388,13 +388,13 @@
if(ROUND_IS_STARTED)
return alert(usr, "The game has already started.", null, null, null, null)
if(master_mode != ROUNDTYPE_STR_SECRET && master_mode != ROUNDTYPE_STR_MIXED_SECRET)
if(GLOB.master_mode != ROUNDTYPE_STR_SECRET && GLOB.master_mode != ROUNDTYPE_STR_MIXED_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=\ref[src];f_secret2=[mode]'>[config.mode_names[mode]]</A><br>"}
for(var/mode in GLOB.config.modes)
dat += {"<A href='?src=\ref[src];f_secret2=[mode]'>[GLOB.config.mode_names[mode]]</A><br>"}
dat += {"<A href='?src=\ref[src];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"])
@@ -402,12 +402,12 @@
if (ROUND_IS_STARTED)
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].",admin_key=key_name(usr))
message_admins("<span class='notice'>[key_name_admin(usr)] set the mode as [master_mode].</span>", 1)
to_world("<span class='notice'><b>The mode is now: [master_mode]</b></span>")
GLOB.master_mode = href_list["c_mode2"]
log_admin("[key_name(usr)] set the mode as [GLOB.master_mode].",admin_key=key_name(usr))
message_admins("<span class='notice'>[key_name_admin(usr)] set the mode as [GLOB.master_mode].</span>", 1)
to_world("<span class='notice'><b>The mode is now: [GLOB.master_mode]</b></span>")
Game() // updates the main game menu
SSpersistent_configuration.last_gamemode = master_mode
SSpersistent_configuration.last_gamemode = GLOB.master_mode
.(href, list("c_mode"=1))
else if(href_list["f_secret2"])
@@ -415,11 +415,11 @@
if(ROUND_IS_STARTED)
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].",admin_key=key_name(usr))
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].",admin_key=key_name(usr))
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))
@@ -516,7 +516,7 @@
M.Paralyse(5)
sleep(5)
M.forceMove(pick(tdome1))
M.forceMove(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)",admin_key=key_name(usr),ckey=key_name(M))
@@ -541,7 +541,7 @@
M.Paralyse(5)
sleep(5)
M.forceMove(pick(tdome2))
M.forceMove(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)",admin_key=key_name(usr),ckey=key_name(M))
@@ -563,7 +563,7 @@
M.Paralyse(5)
sleep(5)
M.forceMove(pick(tdomeadmin))
M.forceMove(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.)",admin_key=key_name(usr),ckey=key_name(M))
@@ -592,7 +592,7 @@
observer.equip_to_slot_or_del(new /obj/item/clothing/shoes/sneakers/black(observer), slot_shoes)
M.Paralyse(5)
sleep(5)
M.forceMove(pick(tdomeobserve))
M.forceMove(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.)",admin_key=key_name(usr),ckey=key_name(M))
@@ -606,7 +606,7 @@
to_chat(usr, "This can only be used on instances of type /mob/living")
return
if(config.allow_admin_rev)
if(GLOB.config.allow_admin_rev)
L.revive()
message_admins("<span class='danger'>Admin [key_name_admin(usr)] healed / revived [key_name_admin(L)]!</span>", 1)
log_admin("[key_name(usr)] healed / Revived [key_name(L)]",admin_key=key_name(usr),ckey=key_name(L))
@@ -878,7 +878,7 @@
if(!isvaurca(H))
to_chat(usr, "This can only be used on Vaurca.")
return
if(!(all_languages[LANGUAGE_VAURCA] in H.languages))
if(!(GLOB.all_languages[LANGUAGE_VAURCA] in H.languages))
to_chat(usr, "The person you are trying to contact is incapable of recieving Hivenet transmissions.")
return
var/input = sanitize(input(src.owner, "Please enter a message to reply to [key_name(H)] via the Hivenet.", "Outgoing transmission from the Hive...", ""))
@@ -1013,7 +1013,7 @@
else if(href_list["object_list"]) //this is the laggiest thing ever
if(!check_rights(R_SPAWN)) return
if(!config.allow_admin_spawning)
if(!GLOB.config.allow_admin_spawning)
to_chat(usr, "Spawning of items is not allowed.")
return
@@ -1401,7 +1401,7 @@
to_chat(usr, "[M] is illegal type, must be /mob!")
return
var/lang2toggle = href_list["lang"]
var/datum/language/L = all_languages[lang2toggle]
var/datum/language/L = GLOB.all_languages[lang2toggle]
if(L in M.languages)
if(!M.remove_language(lang2toggle))
@@ -1419,7 +1419,7 @@
var/add = sanitize(input("Add Player Info") as null|text)
if(!add) return
if (config.ban_legacy_system)
if (GLOB.config.ban_legacy_system)
notes_add(key,add,usr)
else
notes_add_sql(key, add, usr)
@@ -1526,7 +1526,7 @@
. += target.extra_admin_link(source)
/proc/spawn_humanoid_species_admin(var/mob/user, var/mob/M, var/delmob)
var/input = input(user, "Select a species:") as null|anything in all_species
var/input = input(user, "Select a species:") as null|anything in GLOB.all_species
if(!input)
return
M.change_mob_type( /mob/living/carbon/human , null, null, delmob, input)
+12 -10
View File
@@ -124,7 +124,7 @@
"IN" (or "FROM", that works too but it's kinda weird to read),
is the list of objects to work on. This defaults to world if not provided.
But doing something like "IN living_mob_list" is quite handy and can optimize your query.
But doing something like "in living_mob_list" is quite handy and can optimize your query.
All names inside the IN block are global scope, so you can do living_mob_list (a global var) easily.
You can also run it on a single object. Because SDQL is that convenient even for single operations.
@@ -305,8 +305,8 @@
SPAN_NOTICE("SDQL query completed: [objs_all] objects selected by path, and [selectors_used ? objs_eligible : objs_all] objects executed on after WHERE filtering/MAPping if applicable."),\
SPAN_NOTICE("SDQL combined querys took [DisplayTimeText(end_time_total)] to complete.")) + combined_refs
var/global/list/sdql2_queries =list()
var/global/obj/effect/statclick/sdql2_vv_all/sdql2_vv_statobj = new(null, "VIEW VARIABLES (all)", null)
GLOBAL_LIST_INIT(sdql2_queries, GLOB.sdql2_queries || list())
GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/sdql2_vv_all, new(null, "VIEW VARIABLES (all)", null))
/datum/sdql2_query
var/list/query_tree
@@ -343,7 +343,7 @@ var/global/obj/effect/statclick/sdql2_vv_all/sdql2_vv_statobj = new(null, "VIEW
if(!LAZYLEN(tree))
qdel(src)
return
LAZYADD(sdql2_queries, src)
LAZYADD(GLOB.sdql2_queries, src)
superuser = SU
allow_admin_interact = admin_interact
query_tree = tree
@@ -359,7 +359,7 @@ var/global/obj/effect/statclick/sdql2_vv_all/sdql2_vv_statobj = new(null, "VIEW
obj_count_finished = null
select_text = null
select_refs = null
sdql2_queries -= src
GLOB.sdql2_queries -= src
return ..()
/datum/sdql2_query/proc/get_query_text()
@@ -524,7 +524,7 @@ var/global/obj/effect/statclick/sdql2_vv_all/sdql2_vv_statobj = new(null, "VIEW
finished = TRUE
. = TRUE
if(show_next_to_key)
var/client/C = directory[show_next_to_key]
var/client/C = GLOB.directory[show_next_to_key]
if(C)
var/mob/showmob = C.mob
to_chat(showmob, "<span class='admin'>SDQL query results: [get_query_text()]<br>\
@@ -789,7 +789,7 @@ var/global/obj/effect/statclick/sdql2_vv_all/sdql2_vv_statobj = new(null, "VIEW
var/list/new_args = list()
for(var/arg in arguments)
new_args[++new_args.len] = SDQL_expression(source, arg)
if(object == "global") // Global proc.
if(object == GLOB) // Global proc.
return call("/proc/[procname]")(arglist(new_args))
return call(object, procname)(arglist(new_args))
@@ -1043,13 +1043,13 @@ var/global/obj/effect/statclick/sdql2_vv_all/sdql2_vv_statobj = new(null, "VIEW
if("world")
v = world
if("global")
v = "global"
v = GLOB
if("MC")
v = Master
if("FS")
v = Failsafe
if("CFG")
v = config
v = GLOB.config
else
if(copytext(expression[start], 1, 3) == "SS") //Subsystem //3 == length("SS") + 1
var/SSname = copytext_char(expression[start], 3)
@@ -1066,6 +1066,8 @@ var/global/obj/effect/statclick/sdql2_vv_all/sdql2_vv_statobj = new(null, "VIEW
v = SSmatch
else
return null
else if(object == GLOB) // Shitty ass hack kill me.
v = expression[start]
if(long)
if(expression[start + 1] == ".")
return SDQL_var(v, expression[start + 2], null, source, superuser, query)
@@ -1212,7 +1214,7 @@ var/global/obj/effect/statclick/sdql2_vv_all/sdql2_vv_statobj = new(null, "VIEW
message_admins("[key_name_admin(usr)] non-holder clicked on a statclick! ([src])")
log_admin("non-holder clicked on a statclick! ([src])")
return
usr.client.debug_variables(sdql2_queries)
usr.client.debug_variables(GLOB.sdql2_queries)
#undef SDQL2_HALT_CHECK
#undef SDQL2_IS_RUNNING
+23 -23
View File
@@ -16,24 +16,24 @@
data += "Currently [world.visibility ? "<font color='green'>VISIBLE</font>" : "<span class='warning'>HIDDEN</span>"]. <a href='?_src_=holder;access_control=hub'>Toggle</a><br><hr>"
data += "<h2>IP Intel Settings:</h2><br><ul>"
data += "<li>Current warning level: [config.ipintel_rating_bad ? "[config.ipintel_rating_bad]" : "<span class='warning'>DISABLED</span>"]. <a href='?_src_=holder;access_control=intel_bad'>Edit</a></li>"
data += "<li>Current kick level: [config.ipintel_rating_kick ? "[config.ipintel_rating_kick]" : "<span class='warning'>DISABLED</span>"]. <a href='?_src_=holder;access_control=intel_kick'>Edit</a></li>"
data += "<li>Current warning level: [GLOB.config.ipintel_rating_bad ? "[GLOB.config.ipintel_rating_bad]" : "<span class='warning'>DISABLED</span>"]. <a href='?_src_=holder;access_control=intel_bad'>Edit</a></li>"
data += "<li>Current kick level: [GLOB.config.ipintel_rating_kick ? "[GLOB.config.ipintel_rating_kick]" : "<span class='warning'>DISABLED</span>"]. <a href='?_src_=holder;access_control=intel_kick'>Edit</a></li>"
data += "</ul><hr>"
data += "<h2>Player Age Settings:</h2><br><ul>"
data += "<li>New players: [config.access_deny_new_players ? "<span class='warning'>DENIED</span>" : "<font color='green'>ALLOWED</font>"]. <a href='?_src_=holder;access_control=new_players;'>Toggle</a></li>"
data += "<li>Account age restriction: [config.access_deny_new_accounts == -1 ? "<span class='warning'>DISABLED</span>" : "[config.access_deny_new_accounts] DAYS"]. <a href='?_src_=holder;access_control=new_accounts;'>Edit</a></li>"
data += "<li>New players: [GLOB.config.access_deny_new_players ? "<span class='warning'>DENIED</span>" : "<font color='green'>ALLOWED</font>"]. <a href='?_src_=holder;access_control=new_players;'>Toggle</a></li>"
data += "<li>Account age restriction: [GLOB.config.access_deny_new_accounts == -1 ? "<span class='warning'>DISABLED</span>" : "[GLOB.config.access_deny_new_accounts] DAYS"]. <a href='?_src_=holder;access_control=new_accounts;'>Edit</a></li>"
data += "</ul><hr>"
data += "<h2>VM Detection Settings:</h2><br><ul>"
data += "<li>VM identifier count to warn on: [config.access_warn_vms ? "[config.access_warn_vms]" : "<span class='warning'>DISABLED</span>"]. <a href='?_src_=holder;access_control=vm_warn;'>Edit</a></li>"
data += "<li>VM identifier count to kick on: [config.access_deny_vms ? "[config.access_deny_vms]" : "<span class='warning'>DISABLED</span>"]. <a href='?_src_=holder;access_control=vm_kick;'>Edit</a></li>"
data += "<li>VM identifier count to warn on: [GLOB.config.access_warn_vms ? "[GLOB.config.access_warn_vms]" : "<span class='warning'>DISABLED</span>"]. <a href='?_src_=holder;access_control=vm_warn;'>Edit</a></li>"
data += "<li>VM identifier count to kick on: [GLOB.config.access_deny_vms ? "[GLOB.config.access_deny_vms]" : "<span class='warning'>DISABLED</span>"]. <a href='?_src_=holder;access_control=vm_kick;'>Edit</a></li>"
data += "</ul>"
data += "<h2>Guest join settings:</h2><br><ul>"
data += "<li>Guests [(config.guests_allowed || config.external_auth) ? "<font color='green'>CAN</font>" : "<span class='warning'>CAN NOT</span>"] join.</li>"
data += "<li>Guests [config.guests_allowed ? "<font color='green'>CAN</font>" : "<span class='warning'>CAN NOT</span>"] play. <a href='?_src_=holder;access_control=guest;'>Toggle</a></li>"
data += "<li>External authetification: [config.external_auth ? "<font color='green'>ENABLED</font>" : "<span class='warning'>DISABLED</span>"]. <a href='?_src_=holder;access_control=external_auth;'>Toggle</a></li>"
data += "<li>Guests [(GLOB.config.guests_allowed || GLOB.config.external_auth) ? "<font color='green'>CAN</font>" : "<span class='warning'>CAN NOT</span>"] join.</li>"
data += "<li>Guests [GLOB.config.guests_allowed ? "<font color='green'>CAN</font>" : "<span class='warning'>CAN NOT</span>"] play. <a href='?_src_=holder;access_control=guest;'>Toggle</a></li>"
data += "<li>External authetification: [GLOB.config.external_auth ? "<font color='green'>ENABLED</font>" : "<span class='warning'>DISABLED</span>"]. <a href='?_src_=holder;access_control=external_auth;'>Toggle</a></li>"
data += "</ul>"
config_window.set_user(src.mob)
@@ -51,37 +51,37 @@
switch(control)
if ("intel_bad")
var/num = input("Please set the new threshold for warning based on IPintel (0 to disable).", "New Threshold", config.ipintel_rating_kick) as num
var/num = input("Please set the new threshold for warning based on IPintel (0 to disable).", "New Threshold", GLOB.config.ipintel_rating_kick) as num
if (num < 0 || num > 1)
to_chat(usr, "<span class='warning'>Invalid number. Cancelling.</span>")
return
config.ipintel_rating_bad = num
GLOB.config.ipintel_rating_bad = num
if (num)
log_and_message_admins("has set the IPIntel warn threshold to [num].")
else
log_and_message_admins("has disabled warn based on IPIntel.")
if ("intel_kick")
var/num = input("Please set the new threshold for kicking based on IPintel (0 to disable).", "New Threshold", config.ipintel_rating_kick) as num
var/num = input("Please set the new threshold for kicking based on IPintel (0 to disable).", "New Threshold", GLOB.config.ipintel_rating_kick) as num
if (num < 0 || num > 1)
to_chat(usr, "<span class='warning'>Invalid number. Cancelling.</span>")
return
config.ipintel_rating_kick = num
GLOB.config.ipintel_rating_kick = num
if (num)
log_and_message_admins("has set the IPIntel kick threshold to [num].")
else
log_and_message_admins("has disabled kicking based on IPIntel.")
if ("new_players")
config.access_deny_new_players = !config.access_deny_new_players
log_and_message_admins("has [config.access_deny_new_players ? "ENABLED" : "DISABLED"] the kicking of new players.")
GLOB.config.access_deny_new_players = !GLOB.config.access_deny_new_players
log_and_message_admins("has [GLOB.config.access_deny_new_players ? "ENABLED" : "DISABLED"] the kicking of new players.")
if ("new_accounts")
var/num = input("Please set the new threshold for denying access based on BYOND account age. (-1 to disable.)", "New Threshold", config.access_deny_new_accounts) as num
var/num = input("Please set the new threshold for denying access based on BYOND account age. (-1 to disable.)", "New Threshold", GLOB.config.access_deny_new_accounts) as num
if (num < 0 && num != -1)
to_chat(usr, "<span class='warning'>Invalid number. Cancelling.</span>")
return
config.access_deny_new_accounts = num
GLOB.config.access_deny_new_accounts = num
if (num != -1)
log_and_message_admins("has set the access barrier for new BYOND accounts to [num] days.")
else
@@ -89,25 +89,25 @@
if ("vm_warn")
var/num = input("Please set the new threshold for warning on login based on positive VM identifiers. (0 to disable.)", "New Threshold") in list(0, 1, 2)
config.access_warn_vms = num
GLOB.config.access_warn_vms = num
if (num)
log_and_message_admins("has set players with [config.access_warn_vms] positive identifiers out of 2 for VM usage to be warned.")
log_and_message_admins("has set players with [GLOB.config.access_warn_vms] positive identifiers out of 2 for VM usage to be warned.")
else
log_and_message_admins("has disabled warnings based on potential VM usage.")
if ("vm_kick")
var/num = input("Please set the new threshold for warning on login based on positive VM identifiers. (0 to disable.)", "New Threshold") in list(0, 1, 2)
config.access_deny_vms = num
GLOB.config.access_deny_vms = num
if (num)
log_and_message_admins("has set players with [config.access_deny_vms] positive identifiers out of 2 for VM usage to be warned.")
log_and_message_admins("has set players with [GLOB.config.access_deny_vms] positive identifiers out of 2 for VM usage to be warned.")
else
log_and_message_admins("has disabled warnings based on potential VM usage.")
if ("hub")
togglehubvisibility()
if ("external_auth")
config.external_auth = !config.external_auth
GLOB.config.external_auth = !GLOB.config.external_auth
if ("guest")
config.guests_allowed = !config.guests_allowed
GLOB.config.guests_allowed = !GLOB.config.guests_allowed
else
to_chat(usr, "<span class='danger'>Unknown control message sent. Cancelling.</span>")
+2 -2
View File
@@ -10,7 +10,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
//explode the input msg into a list
var/list/msglist = splittext(msg, " ")
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
var/list/indexing = list(M.real_name, M.name)
if(M.mind) indexing += M.mind.name
@@ -116,7 +116,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
var/admin_number_present = 0
var/admin_number_afk = 0
for(var/s in staff)
for(var/s in GLOB.staff)
var/client/C = s
if((R_ADMIN|R_MOD) & C.holder.rights)
admin_number_present++
+18 -18
View File
@@ -4,7 +4,7 @@
/mob/abstract/observer/on_mob_jump()
stop_following()
/client/proc/Jump(var/area/A in all_areas)
/client/proc/Jump(var/area/A in GLOB.all_areas)
set name = "Jump to Area"
set desc = "Area to jump to"
set category = "Admin"
@@ -15,7 +15,7 @@
if(istype(usr, /mob/abstract/new_player))
return
if(config.allow_admin_jump)
if(GLOB.config.allow_admin_jump)
usr.on_mob_jump()
usr.forceMove(pick(get_area_turfs(A)))
@@ -35,7 +35,7 @@
if(isnewplayer(usr))
return
if(config.allow_admin_jump)
if(GLOB.config.allow_admin_jump)
log_admin("[key_name(usr)] jumped to [T.x],[T.y],[T.z] in [T.loc]",admin_key=key_name(usr))
message_admins("[key_name_admin(usr)] jumped to [T.x],[T.y],[T.z] in [T.loc]", 1)
usr.on_mob_jump()
@@ -45,7 +45,7 @@
alert("Admin jumping disabled")
return
/client/proc/jumptomob(var/mob/M in mob_list)
/client/proc/jumptomob(var/mob/M in GLOB.mob_list)
set category = "Admin"
set name = "Jump to Mob Admin"
@@ -55,7 +55,7 @@
if(isnewplayer(usr))
return
if(config.allow_admin_jump)
if(GLOB.config.allow_admin_jump)
log_admin("[key_name(usr)] jumped to [key_name(M)]", admin_key=key_name(usr),ckey=key_name(M))
message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]", 1)
if(src.mob)
@@ -77,7 +77,7 @@
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_DEV))
return
if (config.allow_admin_jump)
if (GLOB.config.allow_admin_jump)
if(src.mob)
var/mob/A = src.mob
A.on_mob_jump()
@@ -97,7 +97,7 @@
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_DEV))
return
if(config.allow_admin_jump)
if(GLOB.config.allow_admin_jump)
var/list/zlevels = list()
for(var/z=0, z<world.maxz, z++)
zlevels += z
@@ -123,7 +123,7 @@
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_DEV))
return
if(config.allow_admin_jump)
if(GLOB.config.allow_admin_jump)
var/list/shuttles = list()
for(var/shuttle_tag in SSshuttle.shuttles)
shuttles += shuttle_tag
@@ -147,7 +147,7 @@
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_DEV))
return
if(config.allow_admin_jump)
if(GLOB.config.allow_admin_jump)
var/list/ships = list()
for(var/ship in SSshuttle.ships)
ships += ship
@@ -171,7 +171,7 @@
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_DEV))
return
if(config.allow_admin_jump)
if(GLOB.config.allow_admin_jump)
var/list/sectors = list()
for(var/sector in SSshuttle.initialized_sectors)
sectors += sector
@@ -198,9 +198,9 @@
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_DEV))
return
if(config.allow_admin_jump)
if(GLOB.config.allow_admin_jump)
var/list/keys = list()
for(var/mob/M in player_list)
for(var/mob/M in GLOB.player_list)
keys += M.client
var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sortKey(keys)
if(!selection)
@@ -215,13 +215,13 @@
else
alert("Admin jumping disabled")
/client/proc/Getmob(var/mob/M in mob_list)
/client/proc/Getmob(var/mob/M in GLOB.mob_list)
set category = "Admin"
set name = "Get Mob"
set desc = "Mob to teleport"
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG))
return
if(config.allow_admin_jump)
if(GLOB.config.allow_admin_jump)
log_admin("[key_name(usr)] teleported [key_name(M)]",admin_key=key_name(usr),ckey=key_name(M))
message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)]", 1)
M.on_mob_jump()
@@ -238,9 +238,9 @@
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG))
return
if(config.allow_admin_jump)
if(GLOB.config.allow_admin_jump)
var/list/keys = list()
for(var/mob/M in player_list)
for(var/mob/M in GLOB.player_list)
keys += M.client
var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sortKey(keys)
if(!selection)
@@ -263,9 +263,9 @@
set name = "Send Mob"
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG))
return
var/area/A = input(usr, "Pick an area.", "Pick an area") in all_areas
var/area/A = input(usr, "Pick an area.", "Pick an area") in GLOB.all_areas
if(A)
if(config.allow_admin_jump)
if(GLOB.config.allow_admin_jump)
M.on_mob_jump()
M.forceMove(pick(get_area_turfs(A)))
feedback_add_details("admin_verb","SMOB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+5 -5
View File
@@ -1,5 +1,5 @@
//allows right clicking mobs to send an admin PM to their client, forwards the selected mob's client to cmd_admin_pm
/client/proc/cmd_admin_pm_context(mob/M as mob in mob_list)
/client/proc/cmd_admin_pm_context(mob/M as mob in GLOB.mob_list)
set category = null
set name = "Admin PM Mob"
if(!holder)
@@ -17,7 +17,7 @@
to_chat(src, "<span class='warning'>Error: Admin-PM-Panel: Only administrators may use this command.</span>")
return
var/list/client/targets[0]
for(var/p in clients)
for(var/p in GLOB.clients)
var/client/T = p
if(T.mob)
if(istype(T.mob, /mob/abstract/new_player))
@@ -114,7 +114,7 @@
C.adminhelped = NOT_ADMINHELPED
//AdminPM popup for ApocStation and anybody else who wants to use it. Set it with POPUP_ADMIN_PM in config.txt ~Carn
if(config.popup_admin_pm)
if(GLOB.config.popup_admin_pm)
spawn(0) //so we don't hold the caller proc up
var/sender = src
var/sendername = key
@@ -154,7 +154,7 @@
ticket.append_message(src.ckey, C.ckey, msg)
//we don't use message_admins here because the sender/receiver might get it too
for(var/s in staff)
for(var/s in GLOB.staff)
var/client/X = s
//check client/X is an admin and isn't the sender or recipient
if(X == C || X == src)
@@ -181,7 +181,7 @@
to_chat(src, "<span class='pm'><span class='out'>" + create_text_tag("PM <-", src) + " to <span class='name'>Discord-[sender]</span>: <span class='message linkify'>[msg]</span></span></span>")
log_admin("PM: [key_name(src)]->Discord-[sender]: [msg]")
for(var/s in staff)
for(var/s in GLOB.staff)
var/client/C = s
if(C == src)
continue
+4 -4
View File
@@ -10,7 +10,7 @@
log_admin("ADMIN: [key_name(src)] : [msg]",admin_key=key_name(src))
if(check_rights(R_ADMIN,0))
for(var/s in staff)
for(var/s in GLOB.staff)
var/client/C = s
if(R_ADMIN & C.holder.rights)
to_chat(C, "<span class='admin_channel'>" + create_text_tag("ADMIN", C) + " <span class='name'>[key_name(usr, 1)]</span>([admin_jump_link(mob, src)]): <span class='message linkify'>[msg]</span></span>")
@@ -33,7 +33,7 @@
var/sender_name = key_name(usr, 1)
if(check_rights(R_ADMIN, 0))
sender_name = "<span class='admin'>[sender_name]</span>"
for(var/s in staff)
for(var/s in GLOB.staff)
var/client/C = s
if ((R_ADMIN|R_MOD) & C.holder.rights)
to_chat(C, "<span class='mod_channel'>" + create_text_tag("MOD", C) + " <span class='name'>[sender_name]</span>(<A HREF='?src=\ref[C.holder];adminplayerobservejump=\ref[mob]'>JMP</A>): <span class='message linkify'>[msg]</span></span>")
@@ -54,7 +54,7 @@
if(check_rights(R_DEV,0))
msg = "<span class='devsay'>[create_text_tag("DEV")] <EM>[key_name(usr, 0, 1, 0)]</EM>: <span class='message linkify'>[msg]</span></span>"
for(var/s in staff)
for(var/s in GLOB.staff)
var/client/C = s
if(C.holder.rights & (R_ADMIN|R_DEV))
to_chat(C, msg)
@@ -73,7 +73,7 @@
if(check_rights((R_CCIAA|R_ADMIN),0))
msg = "<span class='cciaasay'>[create_text_tag("CCIA")] <EM>[key_name(usr, 0, 1, 0)]</EM>: <span class='message linkify'>[msg]</span></span>"
for(var/s in staff)
for(var/s in GLOB.staff)
var/client/C = s
if(C.holder.rights & (R_ADMIN|R_CCIAA))
to_chat(C, msg)
+1 -1
View File
@@ -20,7 +20,7 @@
if (holder.fakekey)
display_name = holder.fakekey
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
if (check_rights(R_ADMIN|R_MOD|R_CCIAA, 0, M) && M.client.aooc_mute_holder_check() == FALSE)
to_chat(M, "<span class='aooc'>" + create_text_tag("A-OOC", M.client) + " <EM>[get_options_bar(src, 0, 1, 1)](<A HREF='?_src_=holder;adminplayerobservejump=\ref[src.mob]'>JMP</A>):</EM> <span class='message linkify'>[msg]</span></span>")
else if (M.mind && M.mind.special_role && M.client && player_is_antag(M.mind))
+1 -1
View File
@@ -29,7 +29,7 @@
to_chat(usr, "Checking for overlapping pipes...")
next_turf:
for(var/turf/T in world)
for(var/dir in cardinal)
for(var/dir in GLOB.cardinal)
var/list/connect_types = list(1 = 0, 2 = 0, 3 = 0)
for(var/obj/machinery/atmospherics/pipe in T)
if(dir & pipe.initialize_directions)
+2 -2
View File
@@ -131,7 +131,7 @@
return 1
/client/proc/bst_post_spawn(mob/living/carbon/human/bst/bst)
spark(bst, 3, alldirs)
spark(bst, 3, GLOB.alldirs)
bst.anchored = FALSE
/mob/living/carbon/human/bst
@@ -164,7 +164,7 @@
return
src.custom_emote(VISIBLE_MESSAGE,"presses a button on their suit, followed by a polite bow.")
spark(src, 5, alldirs)
spark(src, 5, GLOB.alldirs)
QDEL_IN(src, 10)
animate(src, alpha = 0, time = 9, easing = QUAD_EASING)
if(key)
+2 -2
View File
@@ -1,4 +1,4 @@
/proc/togglebuildmode(mob/M as mob in player_list)
/proc/togglebuildmode(mob/M as mob in GLOB.player_list)
set name = "Toggle Build Mode"
set category = "Special Verbs"
if(M.client)
@@ -211,7 +211,7 @@
if("number")
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value", 123) as num
if("mob-reference")
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as mob in mob_list
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as mob in GLOB.mob_list
if("obj-reference")
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as obj in world
if("turf-reference")
+6 -6
View File
@@ -7,9 +7,9 @@
to_chat(src, "Only administrators may use this command.")
return
var/input = sanitize(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, MAX_BOOK_MESSAGE_LEN, extra = 0)
var/input = sanitize(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, MAX_BOOK_MESSAGE_LEN, extra = 0)
if(!input || input == "")
custom_event_msg = null
GLOB.custom_event_msg = null
log_admin("[usr.key] has cleared the custom event text.",admin_key=key_name(usr))
message_admins("[key_name_admin(usr)] has cleared the custom event text.")
return
@@ -17,11 +17,11 @@
log_admin("[usr.key] has changed the custom event text.",admin_key=key_name(usr))
message_admins("[key_name_admin(usr)] has changed the custom event text.")
custom_event_msg = input
GLOB.custom_event_msg = input
to_world("<h1 class='alert'>Custom Event</h1>")
to_world("<h2 class='alert'>A custom event is starting. OOC Info:</h2>")
to_world("<span class='alert'>[custom_event_msg]</span>")
to_world("<span class='alert'>[GLOB.custom_event_msg]</span>")
to_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'>[custom_event_msg]</span>")
to_chat(src, "<span class='alert'>[GLOB.custom_event_msg]</span>")
to_chat(src, "<br>")
+25 -25
View File
@@ -3,20 +3,20 @@
set name = "Debug-Game"
if(!check_rights(R_DEBUG|R_DEV)) return
if(Debug2)
Debug2 = 0
if(GLOB.Debug2)
GLOB.Debug2 = 0
message_admins("[key_name(src)] toggled debugging off.")
log_admin("[key_name(src)] toggled debugging off.",admin_key=key_name(usr))
else
Debug2 = 1
GLOB.Debug2 = 1
message_admins("[key_name(src)] toggled debugging on.")
log_admin("[key_name(src)] toggled debugging on.",admin_key=key_name(usr))
switch(alert("Do you want to print all logs to world? This should ONLY EVER HAPPEN IN CRISIS OR DURING DEBUGGING / DEVELOPMENT.", "All logs to world?", "No", "Yes"))
if("Yes")
config.all_logs_to_chat = 1
GLOB.config.all_logs_to_chat = 1
else
config.all_logs_to_chat = 0
GLOB.config.all_logs_to_chat = 0
feedback_add_details("admin_verb","DG2") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -25,10 +25,10 @@
set name = "Debugs Toggle"
if(!check_rights(R_DEBUG|R_DEV)) return
var/target = input(usr, "Select which log to toggle", "Debugs Toggle", null) in sortAssoc(config.logsettings)
var/target = input(usr, "Select which log to toggle", "Debugs Toggle", null) in sortAssoc(GLOB.config.logsettings)
if(target)
config.logsettings[target] = !config.logsettings[target]
to_chat(usr, "The log category [target] is now [config.logsettings[target]]")
GLOB.config.logsettings[target] = !GLOB.config.logsettings[target]
to_chat(usr, "The log category [target] is now [GLOB.config.logsettings[target]]")
/client/proc/DebugToggleAll()
set category = "Debug"
@@ -37,8 +37,8 @@
switch(alert("Do you want to turn on ALL LOGS?.", "All logs to ON?", "No", "Yes"))
if("Yes")
for(var/k in config.logsettings)
config.logsettings[k] = TRUE
for(var/k in GLOB.config.logsettings)
GLOB.config.logsettings[k] = TRUE
// callproc moved to code/modules/admin/callproc
@@ -64,7 +64,7 @@
usr.show_message(t, 1)
feedback_add_details("admin_verb","ASL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_robotize(var/mob/M in mob_list)
/client/proc/cmd_admin_robotize(var/mob/M in GLOB.mob_list)
set category = "Fun"
set name = "Make Robot"
@@ -79,7 +79,7 @@
else
alert("Invalid mob")
/client/proc/cmd_admin_animalize(var/mob/M in mob_list)
/client/proc/cmd_admin_animalize(var/mob/M in GLOB.mob_list)
set category = "Fun"
set name = "Make Simple Animal"
@@ -100,7 +100,7 @@
M.Animalize()
/client/proc/cmd_admin_slimeize(var/mob/M in mob_list)
/client/proc/cmd_admin_slimeize(var/mob/M in GLOB.mob_list)
set category = "Fun"
set name = "Make slime"
@@ -139,7 +139,7 @@
message_admins("[key_name_admin(src)] has remade the powernets. makepowernets() called.", 0)
feedback_add_details("admin_verb","MPWN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_grantfullaccess(var/mob/M in mob_list)
/client/proc/cmd_admin_grantfullaccess(var/mob/M in GLOB.mob_list)
set category = "Admin"
set name = "Grant Full Access"
@@ -167,7 +167,7 @@
log_admin("[key_name(src)] has granted [M.key] full access.",admin_key=key_name(usr),ckey=key_name(M))
message_admins("<span class='notice'>[key_name_admin(usr)] has granted [M.key] full access.</span>", 1)
/client/proc/cmd_assume_direct_control(var/mob/M in mob_list)
/client/proc/cmd_assume_direct_control(var/mob/M in GLOB.mob_list)
set category = "Admin"
set name = "Assume direct control"
set desc = "Direct intervention"
@@ -288,7 +288,7 @@
var/list/chosen_observers = list()
var/next_observer = "NotGeeves"
while(next_observer)
var/list/valid_choices = player_list.Copy()
var/list/valid_choices = GLOB.player_list.Copy()
for(var/choice in valid_choices)
if(choice in chosen_observers)
valid_choices -= choice
@@ -305,7 +305,7 @@
H.ckey = O.ckey
qdel(O)
/client/proc/cmd_admin_dress(mob/living/carbon/human/H in human_mob_list)
/client/proc/cmd_admin_dress(mob/living/carbon/human/H in GLOB.human_mob_list)
set category = "Fun"
set name = "Set Human Outfit"
@@ -315,7 +315,7 @@
/client/proc/do_dressing(var/mob/living/carbon/human/M = null)
if(!M || !istype(M))
M = input("Select a mob you would like to dress.", "Set Human Outfit") as null|anything in human_mob_list
M = input("Select a mob you would like to dress.", "Set Human Outfit") as null|anything in GLOB.human_mob_list
if(!M)
return
@@ -388,19 +388,19 @@
switch(input("Which list?") in list("Players","Staff","Mobs","Living Mobs","Dead Mobs","Frozen Mobs","Clients"))
if("Players")
to_chat(usr, jointext(player_list,", "))
to_chat(usr, jointext(GLOB.player_list,", "))
if("Staff")
to_chat(usr, jointext(staff,", "))
to_chat(usr, jointext(GLOB.staff,", "))
if("Mobs")
to_chat(usr, jointext(mob_list,", "))
to_chat(usr, jointext(GLOB.mob_list,", "))
if("Living Mobs")
to_chat(usr, jointext(living_mob_list,", "))
to_chat(usr, jointext(GLOB.living_mob_list,", "))
if("Dead Mobs")
to_chat(usr, jointext(dead_mob_list,", "))
to_chat(usr, jointext(GLOB.dead_mob_list,", "))
if("Frozen Mobs")
to_chat(usr, jointext(frozen_crew,", "))
to_chat(usr, jointext(GLOB.frozen_crew,", "))
if("Clients")
to_chat(usr, jointext(clients,", "))
to_chat(usr, jointext(GLOB.clients,", "))
// DNA2 - Admin Hax
/client/proc/cmd_admin_toggle_block(var/mob/M,var/block)
+2 -2
View File
@@ -48,7 +48,7 @@
var/largest_click_time = 0
var/mob/largest_move_mob = null
var/mob/largest_click_mob = null
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
if(!M.client)
continue
if(M.next_move >= largest_move_time)
@@ -105,7 +105,7 @@
if(!check_rights(R_SERVER|R_DEV))
return
if (config.use_forumuser_api)
if (GLOB.config.use_forumuser_api)
update_admins_from_api(FALSE)
log_and_message_admins("manually reloaded admins.")
+1 -1
View File
@@ -7,7 +7,7 @@
if(!check_rights(R_DEBUG|R_DEV))
return
var/cfg_fps = (10 / config.Ticklag)
var/cfg_fps = (10 / GLOB.config.Ticklag)
var/new_fps = round(input("Sets game frames-per-second. Can potentially break the game (default: [cfg_fps])","FPS", world.fps) as num|null)
if(new_fps <= 0)
+2 -2
View File
@@ -27,7 +27,7 @@
to_chat(src, "<span class='warning'>Only Admins may use this command.</span>")
return
var/client/target = input(src,"Choose somebody to grant access to the server's runtime logs (permissions expire at the end of each round):","Grant Permissions",null) as null|anything in clients
var/client/target = input(src,"Choose somebody to grant access to the server's runtime logs (permissions expire at the end of each round):","Grant Permissions",null) as null|anything in GLOB.clients
if(!istype(target,/client))
to_chat(src, "<span class='warning'>Error: giveruntimelog(): Client not found.</span>")
return
@@ -85,7 +85,7 @@
set category = "Admin"
var/text_signal_log = ""
for(var/log in signal_log)
for(var/log in GLOB.signal_log)
text_signal_log += "[log]<br>"
var/datum/browser/signal_win = new(usr, "signallog", "Signal Log", 550, 500)
@@ -83,7 +83,7 @@
return
var/rounded_wtime = round(world.time)
rustg_file_write(file2text(map), "data/logs/[diary_date_string]_[rounded_wtime]_[map]")
rustg_file_write(file2text(map), "data/logs/[GLOB.diary_date_string]_[rounded_wtime]_[map]")
var/datum/map_template/M = new(list(map), "[map]")
+2 -2
View File
@@ -56,7 +56,7 @@ var/intercom_range_display_status = 0
qdel(C)
if(camera_range_display_status)
for(var/obj/machinery/camera/C in cameranet.cameras)
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)
if (isturf(C.loc))
CL += C
+12 -12
View File
@@ -133,7 +133,7 @@
O.vars[variable] = initial_var
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
if ( istype(M , O.type) )
M.vars[variable] = O.vars[variable]
@@ -149,7 +149,7 @@
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
if (M.type == O.type)
M.vars[variable] = O.vars[variable]
@@ -177,7 +177,7 @@
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
if ( istype(M , O.type) )
M.vars[variable] = O.vars[variable]
@@ -192,7 +192,7 @@
A.vars[variable] = O.vars[variable]
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
if (M.type == O.type)
M.vars[variable] = O.vars[variable]
@@ -223,7 +223,7 @@
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
if ( istype(M , O.type) )
if(variable=="light_range")
M.set_light(new_value)
@@ -248,7 +248,7 @@
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
if (M.type == O.type)
if(variable=="light_range")
M.set_light(new_value)
@@ -284,7 +284,7 @@
O.vars[variable] = new_value
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
if ( istype(M , O.type) )
M.vars[variable] = O.vars[variable]
@@ -299,7 +299,7 @@
A.vars[variable] = O.vars[variable]
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
if (M.type == O.type)
M.vars[variable] = O.vars[variable]
@@ -326,7 +326,7 @@
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
if ( istype(M , O.type) )
M.vars[variable] = O.vars[variable]
@@ -341,7 +341,7 @@
A.vars[variable] = O.vars[variable]
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
if (M.type == O.type)
M.vars[variable] = O.vars[variable]
@@ -367,7 +367,7 @@
O.vars[variable] = new_value
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
if ( istype(M , O.type) )
M.vars[variable] = O.vars[variable]
@@ -383,7 +383,7 @@
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
if (M.type == O.type)
M.vars[variable] = O.vars[variable]
+5 -5
View File
@@ -3,7 +3,7 @@ var/list/VVicon_edit_lock = list("icon", "icon_state", "overlays", "underlays")
var/list/VVckey_edit = list("key", "ckey")
// The paranoia box. Specify a var name => bitflags required to edit it.
// Allows the securing of specific variables for, for example, config. That alter
// Allows the securing of specific variables for, for example, GLOB.config. That alter
// how players could join! Definitely not something you want folks to touch if they
// don't have the perms.
var/list/VVdynamic_lock = list(
@@ -619,11 +619,11 @@ var/list/VVdynamic_lock = list(
return
if((O.vars[variable] == 2) && (var_new < 2))//Bringing the dead back to life
dead_mob_list -= O
living_mob_list += O
GLOB.dead_mob_list -= O
GLOB.living_mob_list += O
if((O.vars[variable] < 2) && (var_new == 2))//Kill he
living_mob_list -= O
dead_mob_list += O
GLOB.living_mob_list -= O
GLOB.dead_mob_list += O
O.vars[variable] = var_new
else
var/var_new = input("Enter new number:","Num",O.vars[variable]) as null|num
+1 -1
View File
@@ -15,7 +15,7 @@ var/list/sounds_cache = list()
log_admin("[key_name(src)] played sound [S]",admin_key=key_name(src))
message_admins("[key_name_admin(src)] played sound [S]", 1)
for(var/mob/M in player_list)
for(var/mob/M in GLOB.player_list)
if(M.client.prefs.toggles & SOUND_MIDI)
sound_to(M, uploaded_sound)
+2 -2
View File
@@ -3,7 +3,7 @@
set category = "Object"
if(istype(O,/obj/singularity))
if(config.forbid_singulo_possession)
if(GLOB.config.forbid_singulo_possession)
to_chat(usr, "It is forbidden to possess singularities.")
return
@@ -44,7 +44,7 @@
usr.control_object = null
feedback_add_details("admin_verb","RO") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/proc/givetestverbs(mob/M as mob in mob_list)
/proc/givetestverbs(mob/M as mob in GLOB.mob_list)
set desc = "Give this guy possess/release verbs"
set category = "Debug"
set name = "Give Possessing Verbs"
+3 -3
View File
@@ -15,7 +15,7 @@
var/image/cross = image('icons/obj/library.dmi',"bible")
msg = "<span class='notice'>[icon2html(cross, src)] <b><font color=purple>PRAY: </font>[key_name(src, 1)] (<A HREF='?_src_=holder;adminmoreinfo=\ref[src]'>?</A>) (<A HREF='?_src_=holder;adminplayeropts=\ref[src]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[src]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[src]'>SM</A>) ([admin_jump_link(src, src)]) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;adminspawncookie=\ref[src]'>SC</a>):</b> [msg]</span>"
for(var/s in staff)
for(var/s in GLOB.staff)
var/client/C = s
if(C.holder.rights & (R_ADMIN|R_MOD|R_FUN))
if(C.prefs.toggles & CHAT_PRAYER)
@@ -32,7 +32,7 @@
var/cciaa_present = 0
var/cciaa_afk = 0
for(var/s in staff)
for(var/s in GLOB.staff)
var/client/C = s
if(R_ADMIN & C.holder.rights)
to_chat(C, msg_admin)
@@ -57,7 +57,7 @@
/proc/Syndicate_announce(var/msg, var/mob/Sender)
msg = "<span class='notice'><b><font color=crimson>ILLEGAL:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) ([admin_jump_link(Sender)]) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?_src_=holder;SyndicateReply=\ref[Sender]'>RPLY</A>):</b> [msg]</span>"
for(var/s in staff)
for(var/s in GLOB.staff)
var/client/C = s
if(R_ADMIN & C.holder.rights)
to_chat(C, msg)
+36 -36
View File
@@ -1,4 +1,4 @@
/client/proc/cmd_admin_drop_everything(mob/M as mob in mob_list)
/client/proc/cmd_admin_drop_everything(mob/M as mob in GLOB.mob_list)
set category = null
set name = "Drop Everything"
if(!holder)
@@ -17,7 +17,7 @@
feedback_add_details("admin_verb","DEVR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_subtle_message(mob/M as mob in mob_list)
/client/proc/cmd_admin_subtle_message(mob/M as mob in GLOB.mob_list)
set category = "Special Verbs"
set name = "Subtle Message"
@@ -59,7 +59,7 @@
if(!check_rights(R_MOD|R_ADMIN, 0))
highlight_special_characters = 0
for(var/client/C in clients)
for(var/client/C in GLOB.clients)
if(C.player_age == "Requires database")
missing_ages = 1
continue
@@ -143,7 +143,7 @@
message_admins("<span class='notice'>\bold DirectNarrate: [key_name(usr)] to ([M.name]/[M.key]): [msg]<BR></span>", 1)
feedback_add_details("admin_verb","DIRN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_godmode(mob/M as mob in mob_list)
/client/proc/cmd_admin_godmode(mob/M as mob in GLOB.mob_list)
set category = "Special Verbs"
set name = "Godmode"
if(!holder)
@@ -159,7 +159,7 @@
/proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0)
if(automute)
if(!config.automute_on) return
if(!GLOB.config.automute_on) return
else
if(!usr || !usr.client)
return
@@ -237,7 +237,7 @@ Ccomp's first proc.
var/list/mobs = list()
var/list/ghosts = list()
var/list/sortmob = sortAtom(mob_list) // get the mob list.
var/list/sortmob = sortAtom(GLOB.mob_list) // get the mob list.
var/any=0
for(var/mob/abstract/observer/M in sortmob)
mobs.Add(M) //filter it where it's only ghosts
@@ -270,7 +270,7 @@ Ccomp's first proc.
return
var/mob/abstract/observer/G = ghosts[target]
if(G.has_enabled_antagHUD && config.antag_hud_restricted)
if(G.has_enabled_antagHUD && GLOB.config.antag_hud_restricted)
var/response = alert(src, "Are you sure you wish to allow this individual to play?","Ghost has used AntagHUD","Yes","No")
if(response == "No") return
@@ -294,8 +294,8 @@ Ccomp's first proc.
G.can_reenter_corpse = 1
G:show_message(text("<span class='notice'><B>You may now respawn. You should roleplay as if you learned nothing about the round during your time with the dead.</B></span>"), 1)
log_admin("[key_name(usr)] allowed [key_name(G)] to bypass the [config.respawn_delay] minute respawn limit", admin_key=key_name(usr), ckey=key_name(G))
message_admins("Admin [key_name_admin(usr)] allowed [key_name_admin(G)] to bypass the [config.respawn_delay] minute respawn limit", 1)
log_admin("[key_name(usr)] allowed [key_name(G)] to bypass the [GLOB.config.respawn_delay] minute respawn limit", admin_key=key_name(usr), ckey=key_name(G))
message_admins("Admin [key_name_admin(usr)] allowed [key_name_admin(G)] to bypass the [GLOB.config.respawn_delay] minute respawn limit", 1)
/client/proc/allow_stationbound_reset(mob/living/silicon/robot/R in range(world.view))
set category = "Special Verbs"
@@ -329,7 +329,7 @@ Ccomp's first proc.
if(!holder)
to_chat(src, "Only administrators may use this command.")
var/action=""
if(config.antag_hud_allowed)
if(GLOB.config.antag_hud_allowed)
for(var/mob/abstract/observer/g in get_ghosts())
if(!g.client.holder) //Remove the verb from non-admin ghosts
remove_verb(g, /mob/abstract/observer/verb/toggle_antagHUD)
@@ -337,7 +337,7 @@ Ccomp's first proc.
g.antagHUD = 0 // Disable it on those that have it enabled
g.has_enabled_antagHUD = 2 // We'll allow them to respawn
to_chat(g, "<span class='warning'>The Administrator has disabled AntagHUD.</span> ")
config.antag_hud_allowed = 0
GLOB.config.antag_hud_allowed = 0
to_chat(src, "<span class='danger'>AntagHUD usage has been disabled.</span>")
action = "disabled"
else
@@ -345,7 +345,7 @@ Ccomp's first proc.
if(!g.client.holder) // Add the verb back for all non-admin ghosts
add_verb(g, /mob/abstract/observer/verb/toggle_antagHUD)
to_chat(g, "<span class='notice'><B>The Administrator has enabled AntagHUD.</B></span>") // Notify all observers they can now use AntagHUD)
config.antag_hud_allowed = 1
GLOB.config.antag_hud_allowed = 1
action = "enabled"
to_chat(src, "<span class='notice'><B>AntagHUD usage has been enabled.</B></span>")
@@ -362,11 +362,11 @@ Ccomp's first proc.
if(!holder)
to_chat(src, "Only administrators may use this command.")
var/action=""
if(config.antag_hud_restricted)
if(GLOB.config.antag_hud_restricted)
for(var/mob/abstract/observer/g in get_ghosts())
to_chat(g, "<span class='notice'><B>The administrator has lifted restrictions on joining the round if you use AntagHUD</B></span>")
action = "lifted restrictions"
config.antag_hud_restricted = 0
GLOB.config.antag_hud_restricted = 0
to_chat(src, "<span class='notice'><B>AntagHUD restrictions have been lifted</B></span>")
else
for(var/mob/abstract/observer/g in get_ghosts())
@@ -375,7 +375,7 @@ Ccomp's first proc.
g.antagHUD = 0
g.has_enabled_antagHUD = 0
action = "placed restrictions"
config.antag_hud_restricted = 1
GLOB.config.antag_hud_restricted = 1
to_chat(src, "<span class='danger'>AntagHUD restrictions have been enabled</span>")
log_admin("[key_name(usr)] has [action] on joining the round if they use AntagHUD",admin_key=key_name(usr))
@@ -399,7 +399,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
return
var/mob/abstract/observer/G_found
for(var/mob/abstract/observer/G in player_list)
for(var/mob/abstract/observer/G in GLOB.player_list)
if(G.ckey == input)
G_found = G
break
@@ -408,7 +408,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
to_chat(usr, "<span class='warning'>There is no active key like that in the game or the person is not currently a ghost.</span>")
return
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/record/general/locked/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
@@ -505,12 +505,12 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/input = sanitize(input(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "") as text|null)
if(!input)
return
for(var/mob/living/silicon/ai/M in mob_list)
for(var/mob/living/silicon/ai/M in GLOB.mob_list)
if (M.stat == 2)
to_chat(usr, "Upload failed. No signal is being detected from the AI.")
else
M.add_ion_law(input)
for(var/mob/living/silicon/ai/O in mob_list)
for(var/mob/living/silicon/ai/O in GLOB.mob_list)
to_chat(O, "<span class='danger'>" + input + "...LAWS UPDATED</span>")
O.show_laws()
@@ -522,7 +522,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
command_announcement.Announce("Incoming ion storm detected near the ship. Please check all AI-controlled equipment for errors.", "Anomaly Alert", new_sound = 'sound/AI/ionstorm.ogg')
feedback_add_details("admin_verb","IONC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_rejuvenate(mob/living/M as mob in mob_list)
/client/proc/cmd_admin_rejuvenate(mob/living/M as mob in GLOB.mob_list)
set category = "Special Verbs"
set name = "Rejuvenate"
if(!holder)
@@ -533,7 +533,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!istype(M))
alert("Cannot revive a ghost")
return
if(config.allow_admin_rev)
if(GLOB.config.allow_admin_rev)
M.revive()
log_admin("[key_name(usr)] healed / revived [key_name(M)]",admin_key=key_name(usr),ckey=key_name(M))
@@ -558,10 +558,10 @@ Traitors and the like can also be revived with the previous role mostly intact.
return
switch(reporttype)
if("Template")
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
to_chat(src, "<span class='notice'>Unable to connect to the database.</span>")
return
var/DBQuery/query = dbcon.NewQuery("SELECT title, message FROM ss13_ccia_general_notice_list WHERE deleted_at IS NULL")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT title, message FROM ss13_ccia_general_notice_list WHERE deleted_at IS NULL")
query.Execute()
var/list/template_names = list()
@@ -706,7 +706,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
else
return
/client/proc/cmd_admin_gib(mob/M as mob in mob_list)
/client/proc/cmd_admin_gib(mob/M as mob in GLOB.mob_list)
set category = "Special Verbs"
set name = "Gib"
@@ -742,7 +742,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
message_admins("<span class='notice'>[key_name_admin(usr)] used gibself.</span>", 1)
feedback_add_details("admin_verb","GIBS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_dust(mob/M as mob in mob_list)
/client/proc/cmd_admin_dust(mob/M as mob in GLOB.mob_list)
set category = "Special Verbs"
set name = "Turn to dust"
@@ -797,7 +797,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
to_chat(M, "\red To try to resolve this matter head to http://ss13.donglabs.com/forum/")
log_admin("[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
world.Export("http://216.38.134.132/adminlog.php?type=ban&key=[usr.client.key]&key2=[M.key]&msg=[html_decode(reason)]&time=[mins]&server=[replacetext(config.server_name, "#", "")]")
world.Export("http://216.38.134.132/adminlog.php?type=ban&key=[usr.client.key]&key2=[M.key]&msg=[html_decode(reason)]&time=[mins]&server=[replacetext(GLOB.config.server_name, "#", "")]")
del(M.client)
qdel(M)
else
@@ -812,7 +812,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
to_chat(M, "\red To try to resolve this matter head to http://ss13.donglabs.com/forum/")
log_admin("[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.")
message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.")
world.Export("http://216.38.134.132/adminlog.php?type=ban&key=[usr.client.key]&key2=[M.key]&msg=[html_decode(reason)]&time=perma&server=[replacetext(config.server_name, "#", "")]")
world.Export("http://216.38.134.132/adminlog.php?type=ban&key=[usr.client.key]&key2=[M.key]&msg=[html_decode(reason)]&time=perma&server=[replacetext(GLOB.config.server_name, "#", "")]")
del(M.client)
qdel(M)
*/
@@ -822,7 +822,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
// I will both remove their SVN access and permanently ban them from my servers.
return
/client/proc/cmd_admin_check_contents(mob/living/M as mob in mob_list)
/client/proc/cmd_admin_check_contents(mob/living/M as mob in GLOB.mob_list)
set category = "Special Verbs"
set name = "Check Contents"
@@ -961,7 +961,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
log_admin("[key_name(src)] has [evacuation_controller.deny ? "denied" : "allowed"] the evacuation to be called.",admin_key=key_name(usr))
message_admins("[key_name_admin(usr)] has [evacuation_controller.deny ? "denied" : "allowed"] the evacuation to be called.")
/client/proc/cmd_admin_attack_log(mob/M as mob in mob_list)
/client/proc/cmd_admin_attack_log(mob/M as mob in GLOB.mob_list)
set category = "Special Verbs"
set name = "Attack Log"
@@ -1012,12 +1012,12 @@ Traitors and the like can also be revived with the previous role mostly intact.
set desc = "Toggles random events such as meteors, black holes, blob (but not space dust) on/off"
if(!check_rights(R_SERVER)) return
if(!config.allow_random_events)
config.allow_random_events = 1
if(!GLOB.config.allow_random_events)
GLOB.config.allow_random_events = 1
to_chat(usr, "Random events enabled")
message_admins("Admin [key_name_admin(usr)] has enabled random events.", 1)
else
config.allow_random_events = 0
GLOB.config.allow_random_events = 0
to_chat(usr, "Random events disabled")
message_admins("Admin [key_name_admin(usr)] has disabled random events.", 1)
feedback_add_details("admin_verb","TRE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -1050,17 +1050,17 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!holder)
return
var/list/possible_categories = list("Random") + tips_by_category.Copy()
var/list/possible_categories = list("Random") + GLOB.tips_by_category.Copy()
var/input = input(usr, "Please specify the tip category that you want to send to the players.", "Tip", "Random") as null|anything in possible_categories
if(!input)
return
var/datum/tip/tip_datum
if(input == "Random")
var/chosen_tip_category = pick(tips_by_category)
tip_datum = tips_by_category[chosen_tip_category]
var/chosen_tip_category = pick(GLOB.tips_by_category)
tip_datum = GLOB.tips_by_category[chosen_tip_category]
else
tip_datum = tips_by_category[input]
tip_datum = GLOB.tips_by_category[input]
SSticker.send_tip_of_the_round(pick(tip_datum.messages))
+30 -30
View File
@@ -9,7 +9,7 @@
if (!warned_ckey || !istext(warned_ckey))
return
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
to_chat(usr, "<span class='warning'>Error: warn(): Database Connection failed, reverting to legacy systems.</span>")
usr.client.warn_legacy(warned_ckey)
return
@@ -30,19 +30,19 @@
var/warned_computerid = null
var/warned_ip = null
var/client/C = directory[warned_ckey]
var/client/C = GLOB.directory[warned_ckey]
if (C)
warned_computerid = C.computer_id
warned_ip = C.address
else
var/DBQuery/lookup_query = dbcon.NewQuery("SELECT ip, computerid FROM ss13_player WHERE ckey = :ckey:")
var/DBQuery/lookup_query = GLOB.dbcon.NewQuery("SELECT ip, computerid FROM ss13_player WHERE ckey = :ckey:")
lookup_query.Execute(list("ckey" = warned_ckey))
if (lookup_query.NextRow())
warned_ip = lookup_query.item[1]
warned_computerid = lookup_query.item[2]
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO ss13_warnings (id, time, game_id, severity, reason, notes, ckey, computerid, ip, a_ckey, a_ip, a_computerid) VALUES (null, Now(), :game_id:, :warning_severity:, :warning_reason:, :warning_notes:, :warned_ckey:, :warned_computerid:, :warned_ip:, :a_ckey:, :a_ip:, :a_computerid:)")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("INSERT INTO ss13_warnings (id, time, game_id, severity, reason, notes, ckey, computerid, ip, a_ckey, a_ip, a_computerid) VALUES (null, Now(), :game_id:, :warning_severity:, :warning_reason:, :warning_notes:, :warned_ckey:, :warned_computerid:, :warned_ip:, :a_ckey:, :a_ip:, :a_computerid:)")
insert_query.Execute(list("game_id" = game_id,"warning_severity" = warning_severity, "warning_reason" = warning_reason, "warning_notes" = warning_notes, "warned_ckey" = warned_ckey, "warned_computerid" = warned_computerid, "warned_ip" = warned_ip, "a_ckey" = ckey, "a_ip" = address, "a_computerid" = computer_id))
notes_add_sql(warned_ckey, "Warning added by [ckey], for: [warning_reason]. || Notes regarding the warning: [warning_notes].", src, warned_ip, warned_computerid)
@@ -66,7 +66,7 @@
return
var/datum/preferences/D
var/client/C = directory[warned_ckey]
var/client/C = GLOB.directory[warned_ckey]
if(C) D = C.prefs
else D = preferences_datums[warned_ckey]
@@ -109,7 +109,7 @@
var/dcolor = "#ffaaaa" //dark colour, severity = 1
var/ecolor = "#e3e3e3" //gray colour, expired = 1
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
alert("Connection to the SQL database lost. Aborting. Please alert an Administrator or a member of staff.")
return
@@ -119,7 +119,7 @@
// Notifications
//
var/DBQuery/notification_query = dbcon.NewQuery({"SELECT
var/DBQuery/notification_query = GLOB.dbcon.NewQuery({"SELECT
id, message, created_by
FROM ss13_player_notifications
WHERE
@@ -163,7 +163,7 @@
dat += "<th width='60%'>REASON</th>"
dat += "</tr>"
var/DBQuery/search_query = dbcon.NewQuery("SELECT id, time, severity, reason, a_ckey, acknowledged, expired FROM ss13_warnings WHERE visible = 1 AND (ckey = :ckey: OR computerid = :computer_id: OR ip = :address:) ORDER BY time DESC;")
var/DBQuery/search_query = GLOB.dbcon.NewQuery("SELECT id, time, severity, reason, a_ckey, acknowledged, expired FROM ss13_warnings WHERE visible = 1 AND (ckey = :ckey: OR computerid = :computer_id: OR ip = :address:) ORDER BY time DESC;")
search_query.Execute(list("ckey" = ckey, "computer_id" = computer_id, "address" = address))
while (search_query.NextRow())
@@ -211,11 +211,11 @@
if (!warning_id)
return
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
alert("Connection to SQL database failed while attempting to update your warning's status!")
return
var/DBQuery/query = dbcon.NewQuery("UPDATE ss13_warnings SET acknowledged = 1 WHERE id = :warning_id:;")
var/DBQuery/query = GLOB.dbcon.NewQuery("UPDATE ss13_warnings SET acknowledged = 1 WHERE id = :warning_id:;")
query.Execute(list("warning_id" = warning_id))
warnings_check()
@@ -226,11 +226,11 @@
log_world("ERROR: Error: Argument ID for notificaton acknowledgement not supplied.")
return
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
log_world("ERROR: Unable to establish db connection during notification acknowledgement.")
return
var/DBQuery/query = dbcon.NewQuery({"UPDATE ss13_player_notifications
var/DBQuery/query = GLOB.dbcon.NewQuery({"UPDATE ss13_player_notifications
SET acked_by = :ckey:, acked_at = NOW()
WHERE id = :id: AND ckey = :ckey:
"})
@@ -246,20 +246,20 @@
var/count = 0
var/count_expire = 0
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
return
var/list/client_details = list("ckey" = ckey, "computer_id" = computer_id, "address" = address)
var/DBQuery/expire_query = dbcon.NewQuery("SELECT id FROM ss13_warnings WHERE (acknowledged = 1 AND expired = 0 AND DATE_SUB(CURDATE(),INTERVAL 3 MONTH) > time) AND (ckey = :ckey: OR computerid = :computer_id: OR ip = :address:)")
var/DBQuery/expire_query = GLOB.dbcon.NewQuery("SELECT id FROM ss13_warnings WHERE (acknowledged = 1 AND expired = 0 AND DATE_SUB(CURDATE(),INTERVAL 3 MONTH) > time) AND (ckey = :ckey: OR computerid = :computer_id: OR ip = :address:)")
expire_query.Execute(client_details)
while (expire_query.NextRow())
var/warning_id = text2num(expire_query.item[1])
var/DBQuery/update_query = dbcon.NewQuery("UPDATE ss13_warnings SET expired = 1 WHERE id = :warning_id:")
var/DBQuery/update_query = GLOB.dbcon.NewQuery("UPDATE ss13_warnings SET expired = 1 WHERE id = :warning_id:")
update_query.Execute(list("warning_id" = warning_id))
count_expire++
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM ss13_warnings WHERE (visible = 1 AND acknowledged = 0 AND expired = 0) AND (ckey = :ckey: OR computerid = :computer_id: OR ip = :address:)")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id FROM ss13_warnings WHERE (visible = 1 AND acknowledged = 0 AND expired = 0) AND (ckey = :ckey: OR computerid = :computer_id: OR ip = :address:)")
query.Execute(client_details)
while (query.NextRow())
count++
@@ -276,18 +276,18 @@
* A proc used to gather if someone has Unacknowledged Warnings
*/
/client/proc/fetch_unacked_warning_count()
if (!dbcon)
if (!GLOB.dbcon)
return
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
return
var/count = 0
var/DBQuery/warning_count_query = dbcon.NewQuery("SELECT COUNT(*) FROM ss13_warnings WHERE (visible = 1 AND acknowledged = 0 AND expired = 0) AND (ckey = :ckey: OR computerid = :computer_id: OR ip = :address:)")
var/DBQuery/warning_count_query = GLOB.dbcon.NewQuery("SELECT COUNT(*) FROM ss13_warnings WHERE (visible = 1 AND acknowledged = 0 AND expired = 0) AND (ckey = :ckey: OR computerid = :computer_id: OR ip = :address:)")
warning_count_query.Execute(list("ckey" = ckey, "computer_id" = computer_id, "address" = address))
if(warning_count_query.NextRow())
count += text2num(warning_count_query.item[1])
var/DBQuery/notification_count_query = dbcon.NewQuery("SELECT COUNT(*) FROM ss13_player_notifications WHERE ckey = :ckey: AND acked_at is NULL and type IN ('player_greeting','player_greeting_chat')")
var/DBQuery/notification_count_query = GLOB.dbcon.NewQuery("SELECT COUNT(*) FROM ss13_player_notifications WHERE ckey = :ckey: AND acked_at is NULL and type IN ('player_greeting','player_greeting_chat')")
notification_count_query.Execute(list("ckey" = ckey))
if(notification_count_query.NextRow())
count += text2num(notification_count_query.item[1])
@@ -317,7 +317,7 @@
var/dcolor = "#ffdddd" //dark colour, severity = 1
var/ecolor = "#e3e3e3" //gray colour, expired = 1
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
alert("Connection to the SQL database lost. Aborting. Please alert the database admin!")
return
@@ -352,7 +352,7 @@
paramtwo = "AND ckey = :ckey: "
query_details["ckey"] = playerckey
var/DBQuery/search_query = dbcon.NewQuery("SELECT id, time, severity, reason, notes, ckey, a_ckey, acknowledged, expired, edited, lasteditor, lasteditdate FROM ss13_warnings WHERE visible = 1 [paramone] [paramtwo] ORDER BY time DESC;")
var/DBQuery/search_query = GLOB.dbcon.NewQuery("SELECT id, time, severity, reason, notes, ckey, a_ckey, acknowledged, expired, edited, lasteditor, lasteditdate FROM ss13_warnings WHERE visible = 1 [paramone] [paramtwo] ORDER BY time DESC;")
search_query.Execute(query_details)
while (search_query.NextRow())
@@ -419,7 +419,7 @@
if(!check_rights(R_ADMIN|R_MOD|R_DEV|R_CCIAA))
return
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
log_world("ERROR: Unable to establish db connection while adding a notification.")
return
@@ -429,7 +429,7 @@
return
//Validate ckey
var/DBQuery/validatequery = dbcon.NewQuery("SELECT id FROM ss13_player WHERE ckey = :ckey:")
var/DBQuery/validatequery = GLOB.dbcon.NewQuery("SELECT id FROM ss13_player WHERE ckey = :ckey:")
validatequery.Execute(list("ckey" = ckey))
if (validatequery.RowCount() == 0)
@@ -450,7 +450,7 @@
to_chat(usr,"You need to specify a notification message.")
return
var/DBQuery/addquery = dbcon.NewQuery("INSERT INTO ss13_player_notifications (`ckey`, `type`, `message`, `created_by`) VALUES (:ckey:, :type:, :message:, :a_ckey:)")
var/DBQuery/addquery = GLOB.dbcon.NewQuery("INSERT INTO ss13_player_notifications (`ckey`, `type`, `message`, `created_by`) VALUES (:ckey:, :type:, :message:, :a_ckey:)")
addquery.Execute(list("ckey" = ckey, "type" = type, "message" = message, "a_ckey" = usr.ckey))
to_chat(usr,"Notification added.")
@@ -463,7 +463,7 @@
if(!warning_id || !warning_edit)
return
if(!establish_db_connection(dbcon))
if(!establish_db_connection(GLOB.dbcon))
alert("Connection to the SQL database lost. Aborting. Please alert the database admin!")
return
@@ -473,7 +473,7 @@
var/notes
var/list/query_details = list("warning_id" = warning_id, "a_ckey" = usr.ckey)
var/DBQuery/initial_query = dbcon.NewQuery("SELECT ckey, reason, notes FROM ss13_warnings WHERE id = :warning_id:")
var/DBQuery/initial_query = GLOB.dbcon.NewQuery("SELECT ckey, reason, notes FROM ss13_warnings WHERE id = :warning_id:")
initial_query.Execute(query_details)
while (initial_query.NextRow())
ckey = initial_query.item[1]
@@ -494,7 +494,7 @@
switch (warning_edit)
if ("delete")
if(alert("Delete this warning?", "Delete?", "Yes", "No") == "Yes")
var/DBQuery/deleteQuery = dbcon.NewQuery("UPDATE ss13_warnings SET visible = 0 WHERE id = :warning_id:")
var/DBQuery/deleteQuery = GLOB.dbcon.NewQuery("UPDATE ss13_warnings SET visible = 0 WHERE id = :warning_id:")
deleteQuery.Execute(query_details)
message_admins("<span class='notice'>[key_name_admin(usr)] deleted one of [ckey]'s warnings.</span>")
@@ -510,7 +510,7 @@
to_chat(usr, "Cancelled")
return
var/DBQuery/reason_query = dbcon.NewQuery("UPDATE ss13_warnings SET reason = :new_reason:, edited = 1, lasteditor = :a_ckey:, lasteditdate = NOW() WHERE id = :warning_id:")
var/DBQuery/reason_query = GLOB.dbcon.NewQuery("UPDATE ss13_warnings SET reason = :new_reason:, edited = 1, lasteditor = :a_ckey:, lasteditdate = NOW() WHERE id = :warning_id:")
reason_query.Execute(query_details)
message_admins("<span class='notice'>[key_name_admin(usr)] edited one of [ckey]'s warning reasons.</span>")
@@ -523,7 +523,7 @@
to_chat(usr, "Cancelled")
return
var/DBQuery/notes_query = dbcon.NewQuery("UPDATE ss13_warnings SET notes = :new_notes:, edited = 1, lasteditor = :a_ckey:, lasteditdate = NOW() WHERE id = :warning_id:")
var/DBQuery/notes_query = GLOB.dbcon.NewQuery("UPDATE ss13_warnings SET notes = :new_notes:, edited = 1, lasteditor = :a_ckey:, lasteditdate = NOW() WHERE id = :warning_id:")
notes_query.Execute(query_details)
message_admins("<span class='notice'>[key_name_admin(usr)] edited one of [ckey]'s warning notes.</span>")
+2 -2
View File
@@ -329,7 +329,7 @@
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
var/new_species = input("Please choose a new species.","Species",null) as null|anything in all_species
var/new_species = input("Please choose a new species.","Species",null) as null|anything in GLOB.all_species
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
@@ -348,7 +348,7 @@
to_chat(usr, "This can only be done to instances of type /mob")
return
var/new_language = input("Please choose a language to add.","Language",null) as null|anything in all_languages
var/new_language = input("Please choose a language to add.","Language",null) as null|anything in GLOB.all_languages
if(!new_language)
return
@@ -116,19 +116,23 @@
/proc/make_view_variables_var_list(datum/D)
. = ""
var/list/variables = list()
for(var/x in D.vars)
CHECK_TICK
if(x in view_variables_hide_vars)
continue
if(!D.can_vv_get(x))
continue
variables += x
var/list/variables = D.make_variable_list()
variables = sortList(variables)
for(var/x in variables)
CHECK_TICK
. += make_view_variables_var_entry(D, x, D.vars[x])
/datum/proc/make_variable_list()
. = list()
for(var/x in vars)
CHECK_TICK
if(x in view_variables_hide_vars)
continue
if(!can_vv_get(x))
continue
. += x
return .
/proc/make_view_variables_value(value, varname = "*")
var/vtext = ""
var/debug_type = get_debug_type(value, FALSE)