mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 16:44:33 +01:00
Makes all global variables handled by the GLOB controller (#13152)
* Handlers converted, now to fix 3532 compile errors * 3532 compile fixes later, got runtimes on startup * Well the server loads now atleast * Take 2 * Oops
This commit is contained in:
@@ -5,7 +5,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
|
||||
if(!check_rights(R_BAN)) return
|
||||
|
||||
establish_db_connection()
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
return
|
||||
|
||||
var/serverip = "[world.internet_address]:[world.port]"
|
||||
@@ -86,7 +86,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
|
||||
message_admins("<font color='red'>[key_name_admin(usr)] attempted to add a ban based on a non-existent mob, with no ckey provided. Report this bug.",1)
|
||||
return
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM [format_table_name("player")] WHERE ckey = '[ckey]'")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("player")] WHERE ckey = '[ckey]'")
|
||||
query.Execute()
|
||||
var/validckey = 0
|
||||
if(query.NextRow())
|
||||
@@ -127,7 +127,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
|
||||
reason = sanitizeSQL(reason)
|
||||
|
||||
if(maxadminbancheck)
|
||||
var/DBQuery/adm_query = dbcon.NewQuery("SELECT count(id) AS num FROM [format_table_name("ban")] WHERE (a_ckey = '[a_ckey]') AND (bantype = 'ADMIN_PERMABAN' OR (bantype = 'ADMIN_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)")
|
||||
var/DBQuery/adm_query = GLOB.dbcon.NewQuery("SELECT count(id) AS num FROM [format_table_name("ban")] WHERE (a_ckey = '[a_ckey]') AND (bantype = 'ADMIN_PERMABAN' OR (bantype = 'ADMIN_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)")
|
||||
adm_query.Execute()
|
||||
if(adm_query.NextRow())
|
||||
var/adm_bans = text2num(adm_query.item[1])
|
||||
@@ -136,7 +136,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
|
||||
return
|
||||
|
||||
var/sql = "INSERT INTO [format_table_name("ban")] (`id`,`bantime`,`serverip`,`bantype`,`reason`,`job`,`duration`,`rounds`,`expiration_time`,`ckey`,`computerid`,`ip`,`a_ckey`,`a_computerid`,`a_ip`,`who`,`adminwho`,`edits`,`unbanned`,`unbanned_datetime`,`unbanned_ckey`,`unbanned_computerid`,`unbanned_ip`) VALUES (null, Now(), '[serverip]', '[bantype_str]', '[reason]', '[job]', [(duration)?"[duration]":"0"], [(rounds)?"[rounds]":"0"], Now() + INTERVAL [(duration>0) ? duration : 0] MINUTE, '[ckey]', '[computerid]', '[ip]', '[a_ckey]', '[a_computerid]', '[a_ip]', '[who]', '[adminwho]', '', null, null, null, null, null)"
|
||||
var/DBQuery/query_insert = dbcon.NewQuery(sql)
|
||||
var/DBQuery/query_insert = GLOB.dbcon.NewQuery(sql)
|
||||
query_insert.Execute()
|
||||
to_chat(usr, "<span class='notice'>Ban saved to database.</span>")
|
||||
message_admins("[key_name_admin(usr)] has added a [bantype_str] for [ckey] [(job)?"([job])":""] [(duration > 0)?"([duration] minutes)":""] with the reason: \"[reason]\" to the ban database.",1)
|
||||
@@ -201,13 +201,13 @@ datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "")
|
||||
sql += " AND job = '[job]'"
|
||||
|
||||
establish_db_connection()
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
return
|
||||
|
||||
var/ban_id
|
||||
var/ban_number = 0 //failsafe
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery(sql)
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery(sql)
|
||||
query.Execute()
|
||||
while(query.NextRow())
|
||||
ban_id = query.item[1]
|
||||
@@ -241,7 +241,7 @@ datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null)
|
||||
to_chat(usr, "Cancelled")
|
||||
return
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, duration, reason, job FROM [format_table_name("ban")] WHERE id = [banid]")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, duration, reason, job FROM [format_table_name("ban")] WHERE id = [banid]")
|
||||
query.Execute()
|
||||
|
||||
var/eckey = usr.ckey //Editing admin ckey
|
||||
@@ -271,7 +271,7 @@ datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null)
|
||||
to_chat(usr, "Cancelled")
|
||||
return
|
||||
|
||||
var/DBQuery/update_query = dbcon.NewQuery("UPDATE [format_table_name("ban")] SET reason = '[value]', edits = CONCAT(edits,'- [eckey] changed ban reason from <cite><b>\\\"[reason]\\\"</b></cite> to <cite><b>\\\"[value]\\\"</b></cite><BR>') WHERE id = [banid]")
|
||||
var/DBQuery/update_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("ban")] SET reason = '[value]', edits = CONCAT(edits,'- [eckey] changed ban reason from <cite><b>\\\"[reason]\\\"</b></cite> to <cite><b>\\\"[value]\\\"</b></cite><BR>') WHERE id = [banid]")
|
||||
update_query.Execute()
|
||||
message_admins("[key_name_admin(usr)] has edited a ban for [pckey]'s reason from [reason] to [value]",1)
|
||||
if("duration")
|
||||
@@ -281,7 +281,7 @@ datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null)
|
||||
to_chat(usr, "Cancelled")
|
||||
return
|
||||
|
||||
var/DBQuery/update_query = dbcon.NewQuery("UPDATE [format_table_name("ban")] SET duration = [value], edits = CONCAT(edits,'- [eckey] changed ban duration from [duration] to [value]<br>'), expiration_time = DATE_ADD(bantime, INTERVAL [value] MINUTE) WHERE id = [banid]")
|
||||
var/DBQuery/update_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("ban")] SET duration = [value], edits = CONCAT(edits,'- [eckey] changed ban duration from [duration] to [value]<br>'), expiration_time = DATE_ADD(bantime, INTERVAL [value] MINUTE) WHERE id = [banid]")
|
||||
message_admins("[key_name_admin(usr)] has edited a ban for [pckey]'s duration from [duration] to [value]",1)
|
||||
update_query.Execute()
|
||||
if("unban")
|
||||
@@ -304,13 +304,13 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
|
||||
var/sql = "SELECT ckey FROM [format_table_name("ban")] WHERE id = [id]"
|
||||
|
||||
establish_db_connection()
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
return
|
||||
|
||||
var/ban_number = 0 //failsafe
|
||||
|
||||
var/pckey
|
||||
var/DBQuery/query = dbcon.NewQuery(sql)
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery(sql)
|
||||
query.Execute()
|
||||
while(query.NextRow())
|
||||
pckey = query.item[1]
|
||||
@@ -334,7 +334,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
|
||||
var/sql_update = "UPDATE [format_table_name("ban")] SET unbanned = 1, unbanned_datetime = Now(), unbanned_ckey = '[unban_ckey]', unbanned_computerid = '[unban_computerid]', unbanned_ip = '[unban_ip]' WHERE id = [id]"
|
||||
message_admins("[key_name_admin(usr)] has lifted [pckey]'s ban.",1)
|
||||
|
||||
var/DBQuery/query_update = dbcon.NewQuery(sql_update)
|
||||
var/DBQuery/query_update = GLOB.dbcon.NewQuery(sql_update)
|
||||
query_update.Execute()
|
||||
|
||||
flag_account_for_forum_sync(pckey)
|
||||
@@ -359,7 +359,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
|
||||
if(!check_rights(R_BAN)) return
|
||||
|
||||
establish_db_connection()
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
to_chat(usr, "<span class='warning'>Failed to establish database connection</span>")
|
||||
return
|
||||
|
||||
@@ -392,13 +392,13 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
|
||||
output += "<option value=''>--</option>"
|
||||
for(var/j in get_all_jobs())
|
||||
output += "<option value='[j]'>[j]</option>"
|
||||
for(var/j in nonhuman_positions)
|
||||
for(var/j in GLOB.nonhuman_positions)
|
||||
output += "<option value='[j]'>[j]</option>"
|
||||
for(var/j in other_roles)
|
||||
for(var/j in GLOB.other_roles)
|
||||
output += "<option value='[j]'>[j]</option>"
|
||||
for(var/j in list("commanddept","securitydept","engineeringdept","medicaldept","sciencedept","supportdept","nonhumandept"))
|
||||
output += "<option value='[j]'>[j]</option>"
|
||||
for(var/j in list("Syndicate") + antag_roles)
|
||||
for(var/j in list("Syndicate") + GLOB.antag_roles)
|
||||
output += "<option value='[j]'>[j]</option>"
|
||||
output += "</select></td></tr></table>"
|
||||
output += "<b>Reason:<br></b><textarea name='dbbanreason' cols='50'></textarea><br>"
|
||||
@@ -498,7 +498,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
|
||||
bantypesearch += "'PERMABAN' "
|
||||
|
||||
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, bantime, bantype, reason, job, duration, expiration_time, ckey, a_ckey, unbanned, unbanned_ckey, unbanned_datetime, edits, ip, computerid FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch] [ipsearch] [cidsearch] [bantypesearch] ORDER BY bantime DESC LIMIT 100")
|
||||
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT id, bantime, bantype, reason, job, duration, expiration_time, ckey, a_ckey, unbanned, unbanned_ckey, unbanned_datetime, edits, ip, computerid FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch] [ipsearch] [cidsearch] [bantypesearch] ORDER BY bantime DESC LIMIT 100")
|
||||
select_query.Execute()
|
||||
|
||||
while(select_query.NextRow())
|
||||
@@ -575,9 +575,9 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
|
||||
usr << browse(output,"window=lookupbans;size=900x700")
|
||||
|
||||
/proc/flag_account_for_forum_sync(ckey)
|
||||
if(!dbcon)
|
||||
if(!GLOB.dbcon)
|
||||
return
|
||||
var/skey = sanitizeSQL(ckey)
|
||||
var/sql = "UPDATE [format_table_name("player")] SET fupdate = 1 WHERE ckey = '[skey]'"
|
||||
var/DBQuery/adm_query = dbcon.NewQuery(sql)
|
||||
var/DBQuery/adm_query = GLOB.dbcon.NewQuery(sql)
|
||||
adm_query.Execute()
|
||||
|
||||
@@ -25,13 +25,13 @@ world/IsBanned(key, address, computer_id, type, check_ipintel = TRUE)
|
||||
if (C && ckey == C.ckey && computer_id == C.computer_id && address == C.address)
|
||||
return //don't recheck connected clients.
|
||||
|
||||
if((ckey in admin_datums) || (ckey in GLOB.deadmins))
|
||||
var/datum/admins/A = admin_datums[ckey]
|
||||
if((ckey in GLOB.admin_datums) || (ckey in GLOB.deadmins))
|
||||
var/datum/admins/A = GLOB.admin_datums[ckey]
|
||||
if(A && (A.rights & R_ADMIN))
|
||||
admin = 1
|
||||
|
||||
//Guest Checking
|
||||
if(!guests_allowed && IsGuestKey(key))
|
||||
if(!GLOB.guests_allowed && IsGuestKey(key))
|
||||
log_adminwarn("Failed Login: [key] [computer_id] [address] - Guests not allowed")
|
||||
// message_admins("<span class='notice'>Failed Login: [key] - Guests not allowed</span>")
|
||||
return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a BYOND account.")
|
||||
@@ -82,7 +82,7 @@ world/IsBanned(key, address, computer_id, type, check_ipintel = TRUE)
|
||||
if(computer_id)
|
||||
cidquery = " OR computerid = '[computer_id]' "
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, ip, computerid, a_ckey, reason, expiration_time, duration, bantime, bantype FROM [format_table_name("ban")] WHERE (ckey = '[ckeytext]' [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR bantype = 'ADMIN_PERMABAN' OR ((bantype = 'TEMPBAN' OR bantype = 'ADMIN_TEMPBAN') AND expiration_time > Now())) AND isnull(unbanned)")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, ip, computerid, a_ckey, reason, expiration_time, duration, bantime, bantype FROM [format_table_name("ban")] WHERE (ckey = '[ckeytext]' [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR bantype = 'ADMIN_PERMABAN' OR ((bantype = 'TEMPBAN' OR bantype = 'ADMIN_TEMPBAN') AND expiration_time > Now())) AND isnull(unbanned)")
|
||||
|
||||
query.Execute()
|
||||
|
||||
|
||||
@@ -1,61 +1,61 @@
|
||||
var/CMinutes = null
|
||||
var/savefile/Banlist
|
||||
|
||||
GLOBAL_VAR(CMinutes)
|
||||
GLOBAL_DATUM(banlist_savefile, /savefile)
|
||||
GLOBAL_PROTECT(banlist_savefile) // Obvious reasons
|
||||
|
||||
/proc/CheckBan(var/ckey, var/id, var/address)
|
||||
if(!Banlist) // if Banlist cannot be located for some reason
|
||||
if(!GLOB.banlist_savefile) // if banlist_savefile cannot be located for some reason
|
||||
LoadBans() // try to load the bans
|
||||
if(!Banlist) // uh oh, can't find bans!
|
||||
if(!GLOB.banlist_savefile) // uh oh, can't find bans!
|
||||
return 0 // ABORT ABORT ABORT
|
||||
|
||||
. = list()
|
||||
var/appeal
|
||||
if(config && config.banappeals)
|
||||
appeal = "\nFor more information on your ban, or to appeal, head to <a href='[config.banappeals]'>[config.banappeals]</a>"
|
||||
Banlist.cd = "/base"
|
||||
if( "[ckey][id]" in Banlist.dir )
|
||||
Banlist.cd = "[ckey][id]"
|
||||
if(Banlist["temp"])
|
||||
if(!GetExp(Banlist["minutes"]))
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
if( "[ckey][id]" in GLOB.banlist_savefile.dir )
|
||||
GLOB.banlist_savefile.cd = "[ckey][id]"
|
||||
if(GLOB.banlist_savefile["temp"])
|
||||
if(!GetExp(GLOB.banlist_savefile["minutes"]))
|
||||
ClearTempbans()
|
||||
return 0
|
||||
else
|
||||
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]"
|
||||
.["desc"] = "\nReason: [GLOB.banlist_savefile["reason"]]\nExpires: [GetExp(GLOB.banlist_savefile["minutes"])]\nBy: [GLOB.banlist_savefile["bannedby"]][appeal]"
|
||||
else
|
||||
Banlist.cd = "/base/[ckey][id]"
|
||||
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: <B>PERMENANT</B>\nBy: [Banlist["bannedby"]][appeal]"
|
||||
GLOB.banlist_savefile.cd = "/base/[ckey][id]"
|
||||
.["desc"] = "\nReason: [GLOB.banlist_savefile["reason"]]\nExpires: <B>PERMENANT</B>\nBy: [GLOB.banlist_savefile["bannedby"]][appeal]"
|
||||
.["reason"] = "ckey/id"
|
||||
return .
|
||||
else
|
||||
for(var/A in Banlist.dir)
|
||||
Banlist.cd = "/base/[A]"
|
||||
for(var/A in GLOB.banlist_savefile.dir)
|
||||
GLOB.banlist_savefile.cd = "/base/[A]"
|
||||
var/matches
|
||||
if( ckey == Banlist["key"] )
|
||||
if( ckey == GLOB.banlist_savefile["key"] )
|
||||
matches += "ckey"
|
||||
if( id == Banlist["id"] )
|
||||
if( id == GLOB.banlist_savefile["id"] )
|
||||
if(matches)
|
||||
matches += "/"
|
||||
matches += "id"
|
||||
if( address == Banlist["ip"] )
|
||||
if( address == GLOB.banlist_savefile["ip"] )
|
||||
if(matches)
|
||||
matches += "/"
|
||||
matches += "ip"
|
||||
|
||||
if(matches)
|
||||
if(Banlist["temp"])
|
||||
if(!GetExp(Banlist["minutes"]))
|
||||
if(GLOB.banlist_savefile["temp"])
|
||||
if(!GetExp(GLOB.banlist_savefile["minutes"]))
|
||||
ClearTempbans()
|
||||
return 0
|
||||
else
|
||||
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]"
|
||||
.["desc"] = "\nReason: [GLOB.banlist_savefile["reason"]]\nExpires: [GetExp(GLOB.banlist_savefile["minutes"])]\nBy: [GLOB.banlist_savefile["bannedby"]][appeal]"
|
||||
else
|
||||
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: <B>PERMENANT</B>\nBy: [Banlist["bannedby"]][appeal]"
|
||||
.["desc"] = "\nReason: [GLOB.banlist_savefile["reason"]]\nExpires: <B>PERMENANT</B>\nBy: [GLOB.banlist_savefile["bannedby"]][appeal]"
|
||||
.["reason"] = matches
|
||||
return .
|
||||
return 0
|
||||
|
||||
/proc/UpdateTime() //No idea why i made this a proc.
|
||||
CMinutes = (world.realtime / 10) / 60
|
||||
GLOB.CMinutes = (world.realtime / 10) / 60
|
||||
return 1
|
||||
|
||||
/hook/startup/proc/loadBans()
|
||||
@@ -63,17 +63,17 @@ var/savefile/Banlist
|
||||
|
||||
/proc/LoadBans()
|
||||
|
||||
Banlist = new("data/banlist.bdb")
|
||||
GLOB.banlist_savefile = new("data/banlist.bdb")
|
||||
log_admin("Loading Banlist")
|
||||
|
||||
if(!length(Banlist.dir)) log_admin("Banlist is empty.")
|
||||
if(!length(GLOB.banlist_savefile.dir)) log_admin("Banlist is empty.")
|
||||
|
||||
if(!Banlist.dir.Find("base"))
|
||||
if(!GLOB.banlist_savefile.dir.Find("base"))
|
||||
log_admin("Banlist missing base dir.")
|
||||
Banlist.dir.Add("base")
|
||||
Banlist.cd = "/base"
|
||||
else if(Banlist.dir.Find("base"))
|
||||
Banlist.cd = "/base"
|
||||
GLOB.banlist_savefile.dir.Add("base")
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
else if(GLOB.banlist_savefile.dir.Find("base"))
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
|
||||
ClearTempbans()
|
||||
return 1
|
||||
@@ -81,17 +81,17 @@ var/savefile/Banlist
|
||||
/proc/ClearTempbans()
|
||||
UpdateTime()
|
||||
|
||||
Banlist.cd = "/base"
|
||||
for(var/A in Banlist.dir)
|
||||
Banlist.cd = "/base/[A]"
|
||||
if(!Banlist["key"] || !Banlist["id"])
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
for(var/A in GLOB.banlist_savefile.dir)
|
||||
GLOB.banlist_savefile.cd = "/base/[A]"
|
||||
if(!GLOB.banlist_savefile["key"] || !GLOB.banlist_savefile["id"])
|
||||
RemoveBan(A)
|
||||
log_admin("Invalid Ban.")
|
||||
message_admins("Invalid Ban.")
|
||||
continue
|
||||
|
||||
if(!Banlist["temp"]) continue
|
||||
if(CMinutes >= Banlist["minutes"]) RemoveBan(A)
|
||||
if(!GLOB.banlist_savefile["temp"]) continue
|
||||
if(GLOB.CMinutes >= GLOB.banlist_savefile["minutes"]) RemoveBan(A)
|
||||
|
||||
return 1
|
||||
|
||||
@@ -102,23 +102,23 @@ var/savefile/Banlist
|
||||
|
||||
if(temp)
|
||||
UpdateTime()
|
||||
bantimestamp = CMinutes + minutes
|
||||
bantimestamp = GLOB.CMinutes + minutes
|
||||
|
||||
Banlist.cd = "/base"
|
||||
if( Banlist.dir.Find("[ckey][computerid]") )
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
if( GLOB.banlist_savefile.dir.Find("[ckey][computerid]") )
|
||||
to_chat(usr, "<span class='danger'>Ban already exists.</span>")
|
||||
return 0
|
||||
else
|
||||
Banlist.dir.Add("[ckey][computerid]")
|
||||
Banlist.cd = "/base/[ckey][computerid]"
|
||||
Banlist["key"] << ckey
|
||||
Banlist["id"] << computerid
|
||||
Banlist["ip"] << address
|
||||
Banlist["reason"] << reason
|
||||
Banlist["bannedby"] << bannedby
|
||||
Banlist["temp"] << temp
|
||||
GLOB.banlist_savefile.dir.Add("[ckey][computerid]")
|
||||
GLOB.banlist_savefile.cd = "/base/[ckey][computerid]"
|
||||
GLOB.banlist_savefile["key"] << ckey
|
||||
GLOB.banlist_savefile["id"] << computerid
|
||||
GLOB.banlist_savefile["ip"] << address
|
||||
GLOB.banlist_savefile["reason"] << reason
|
||||
GLOB.banlist_savefile["bannedby"] << bannedby
|
||||
GLOB.banlist_savefile["temp"] << temp
|
||||
if(temp)
|
||||
Banlist["minutes"] << bantimestamp
|
||||
GLOB.banlist_savefile["minutes"] << bantimestamp
|
||||
if(!temp)
|
||||
add_note(ckey, "Permanently banned - [reason]", null, bannedby, 0)
|
||||
else
|
||||
@@ -129,12 +129,12 @@ var/savefile/Banlist
|
||||
var/key
|
||||
var/id
|
||||
|
||||
Banlist.cd = "/base/[foldername]"
|
||||
Banlist["key"] >> key
|
||||
Banlist["id"] >> id
|
||||
Banlist.cd = "/base"
|
||||
GLOB.banlist_savefile.cd = "/base/[foldername]"
|
||||
GLOB.banlist_savefile["key"] >> key
|
||||
GLOB.banlist_savefile["id"] >> id
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
|
||||
if(!Banlist.dir.Remove(foldername)) return 0
|
||||
if(!GLOB.banlist_savefile.dir.Remove(foldername)) return 0
|
||||
|
||||
if(!usr)
|
||||
log_admin("Ban Expired: [key]")
|
||||
@@ -145,18 +145,18 @@ var/savefile/Banlist
|
||||
message_admins("[key_name_admin(usr)] unbanned: [key]")
|
||||
feedback_inc("ban_unban",1)
|
||||
usr.client.holder.DB_ban_unban( ckey(key), BANTYPE_ANY_FULLBAN)
|
||||
for(var/A in Banlist.dir)
|
||||
Banlist.cd = "/base/[A]"
|
||||
if(key == Banlist["key"] /*|| id == Banlist["id"]*/)
|
||||
Banlist.cd = "/base"
|
||||
Banlist.dir.Remove(A)
|
||||
for(var/A in GLOB.banlist_savefile.dir)
|
||||
GLOB.banlist_savefile.cd = "/base/[A]"
|
||||
if(key == GLOB.banlist_savefile["key"] /*|| id == GLOB.banlist_savefile["id"]*/)
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
GLOB.banlist_savefile.dir.Remove(A)
|
||||
continue
|
||||
|
||||
return 1
|
||||
|
||||
/proc/GetExp(minutes as num)
|
||||
UpdateTime()
|
||||
var/exp = minutes - CMinutes
|
||||
var/exp = minutes - GLOB.CMinutes
|
||||
if(exp <= 0)
|
||||
return 0
|
||||
else
|
||||
@@ -172,19 +172,19 @@ var/savefile/Banlist
|
||||
/datum/admins/proc/unbanpanel()
|
||||
var/count = 0
|
||||
var/dat
|
||||
Banlist.cd = "/base"
|
||||
for(var/A in Banlist.dir)
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
for(var/A in GLOB.banlist_savefile.dir)
|
||||
count++
|
||||
Banlist.cd = "/base/[A]"
|
||||
GLOB.banlist_savefile.cd = "/base/[A]"
|
||||
var/ref = UID()
|
||||
var/key = Banlist["key"]
|
||||
var/id = Banlist["id"]
|
||||
var/ip = Banlist["ip"]
|
||||
var/reason = Banlist["reason"]
|
||||
var/by = Banlist["bannedby"]
|
||||
var/key = GLOB.banlist_savefile["key"]
|
||||
var/id = GLOB.banlist_savefile["id"]
|
||||
var/ip = GLOB.banlist_savefile["ip"]
|
||||
var/reason = GLOB.banlist_savefile["reason"]
|
||||
var/by = GLOB.banlist_savefile["bannedby"]
|
||||
var/expiry
|
||||
if(Banlist["temp"])
|
||||
expiry = GetExp(Banlist["minutes"])
|
||||
if(GLOB.banlist_savefile["temp"])
|
||||
expiry = GetExp(GLOB.banlist_savefile["minutes"])
|
||||
if(!expiry) expiry = "Removal Pending"
|
||||
else expiry = "Permaban"
|
||||
|
||||
@@ -207,26 +207,26 @@ var/savefile/Banlist
|
||||
var/a = pick(1,0)
|
||||
var/b = pick(1,0)
|
||||
if(b)
|
||||
Banlist.cd = "/base"
|
||||
Banlist.dir.Add("trash[i]trashid[i]")
|
||||
Banlist.cd = "/base/trash[i]trashid[i]"
|
||||
Banlist["key"] << "trash[i]"
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
GLOB.banlist_savefile.dir.Add("trash[i]trashid[i]")
|
||||
GLOB.banlist_savefile.cd = "/base/trash[i]trashid[i]"
|
||||
GLOB.banlist_savefile["key"] << "trash[i]"
|
||||
else
|
||||
Banlist.cd = "/base"
|
||||
Banlist.dir.Add("[last]trashid[i]")
|
||||
Banlist.cd = "/base/[last]trashid[i]"
|
||||
Banlist["key"] << last
|
||||
Banlist["id"] << "trashid[i]"
|
||||
Banlist["reason"] << "Trashban[i]."
|
||||
Banlist["temp"] << a
|
||||
Banlist["minutes"] << CMinutes + rand(1,2000)
|
||||
Banlist["bannedby"] << "trashmin"
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
GLOB.banlist_savefile.dir.Add("[last]trashid[i]")
|
||||
GLOB.banlist_savefile.cd = "/base/[last]trashid[i]"
|
||||
GLOB.banlist_savefile["key"] << last
|
||||
GLOB.banlist_savefile["id"] << "trashid[i]"
|
||||
GLOB.banlist_savefile["reason"] << "Trashban[i]."
|
||||
GLOB.banlist_savefile["temp"] << a
|
||||
GLOB.banlist_savefile["minutes"] << GLOB.CMinutes + rand(1,2000)
|
||||
GLOB.banlist_savefile["bannedby"] << "trashmin"
|
||||
last = "trash[i]"
|
||||
|
||||
Banlist.cd = "/base"
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
|
||||
/proc/ClearAllBans()
|
||||
Banlist.cd = "/base"
|
||||
for(var/A in Banlist.dir)
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
for(var/A in GLOB.banlist_savefile.dir)
|
||||
RemoveBan(A)
|
||||
|
||||
|
||||
+43
-43
@@ -1,5 +1,5 @@
|
||||
var/global/BSACooldown = 0
|
||||
var/global/nologevent = 0
|
||||
GLOBAL_VAR_INIT(BSACooldown, 0)
|
||||
GLOBAL_VAR_INIT(nologevent, 0)
|
||||
|
||||
////////////////////////////////
|
||||
/proc/message_admins(var/msg)
|
||||
@@ -10,7 +10,7 @@ var/global/nologevent = 0
|
||||
to_chat(C, msg)
|
||||
|
||||
/proc/msg_admin_attack(var/text, var/loglevel)
|
||||
if(!nologevent)
|
||||
if(!GLOB.nologevent)
|
||||
var/rendered = "<span class=\"admin\"><span class=\"prefix\">ATTACK:</span> <span class=\"message\">[text]</span></span>"
|
||||
for(var/client/C in GLOB.admins)
|
||||
if(R_ADMIN & C.holder.rights)
|
||||
@@ -197,7 +197,7 @@ var/global/nologevent = 0
|
||||
for(var/block=1;block<=DNA_SE_LENGTH;block++)
|
||||
if(((block-1)%5)==0)
|
||||
body += "</tr><tr><th>[block-1]</th>"
|
||||
bname = assigned_blocks[block]
|
||||
bname = GLOB.assigned_blocks[block]
|
||||
body += "<td>"
|
||||
if(bname)
|
||||
var/bstate=M.dna.GetSEState(block)
|
||||
@@ -306,7 +306,7 @@ var/global/nologevent = 0
|
||||
<BR>Feed channels and stories entered through here will be uneditable and handled as official news by the rest of the units.
|
||||
<BR>Note that this panel allows full freedom over the news network, there are no constrictions except the few basic ones. Don't break things!</FONT>
|
||||
"}
|
||||
if(news_network.wanted_issue)
|
||||
if(GLOB.news_network.wanted_issue)
|
||||
dat+= "<HR><A href='?src=[UID()];ac_view_wanted=1'>Read Wanted Issue</A>"
|
||||
|
||||
dat+= {"<HR><BR><A href='?src=[UID()];ac_create_channel=1'>Create Feed Channel</A>
|
||||
@@ -316,7 +316,7 @@ var/global/nologevent = 0
|
||||
"}
|
||||
|
||||
var/wanted_already = 0
|
||||
if(news_network.wanted_issue)
|
||||
if(GLOB.news_network.wanted_issue)
|
||||
wanted_already = 1
|
||||
|
||||
dat+={"<HR><B>Feed Security functions:</B><BR>
|
||||
@@ -327,10 +327,10 @@ var/global/nologevent = 0
|
||||
"}
|
||||
if(1)
|
||||
dat+= "Station Feed Channels<HR>"
|
||||
if( isemptylist(news_network.network_channels) )
|
||||
if( isemptylist(GLOB.news_network.network_channels) )
|
||||
dat+="<I>No active channels found...</I>"
|
||||
else
|
||||
for(var/datum/feed_channel/CHANNEL in news_network.network_channels)
|
||||
for(var/datum/feed_channel/CHANNEL in GLOB.news_network.network_channels)
|
||||
if(CHANNEL.is_admin_channel)
|
||||
dat+="<B><FONT style='BACKGROUND-COLOR: LightGreen'><A href='?src=[UID()];ac_show_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A></FONT></B><BR>"
|
||||
else
|
||||
@@ -377,7 +377,7 @@ var/global/nologevent = 0
|
||||
if(src.admincaster_feed_channel.channel_name =="" || src.admincaster_feed_channel.channel_name == "\[REDACTED\]")
|
||||
dat+="<FONT COLOR='maroon'>Invalid channel name.</FONT><BR>"
|
||||
var/check = 0
|
||||
for(var/datum/feed_channel/FC in news_network.network_channels)
|
||||
for(var/datum/feed_channel/FC in GLOB.news_network.network_channels)
|
||||
if(FC.channel_name == src.admincaster_feed_channel.channel_name)
|
||||
check = 1
|
||||
break
|
||||
@@ -414,10 +414,10 @@ var/global/nologevent = 0
|
||||
Keep in mind that users attempting to view a censored feed will instead see the \[REDACTED\] tag above it.</FONT>
|
||||
<HR>Select Feed channel to get Stories from:<BR>
|
||||
"}
|
||||
if(isemptylist(news_network.network_channels))
|
||||
if(isemptylist(GLOB.news_network.network_channels))
|
||||
dat+="<I>No feed channels found active...</I><BR>"
|
||||
else
|
||||
for(var/datum/feed_channel/CHANNEL in news_network.network_channels)
|
||||
for(var/datum/feed_channel/CHANNEL in GLOB.news_network.network_channels)
|
||||
dat+="<A href='?src=[UID()];ac_pick_censor_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ""]<BR>"
|
||||
dat+="<BR><A href='?src=[UID()];ac_setScreen=[0]'>Cancel</A>"
|
||||
if(11)
|
||||
@@ -427,10 +427,10 @@ var/global/nologevent = 0
|
||||
morale, integrity or disciplinary behaviour. A D-Notice will render a channel unable to be updated by anyone, without deleting any feed
|
||||
stories it might contain at the time. You can lift a D-Notice if you have the required access at any time.</FONT><HR>
|
||||
"}
|
||||
if(isemptylist(news_network.network_channels))
|
||||
if(isemptylist(GLOB.news_network.network_channels))
|
||||
dat+="<I>No feed channels found active...</I><BR>"
|
||||
else
|
||||
for(var/datum/feed_channel/CHANNEL in news_network.network_channels)
|
||||
for(var/datum/feed_channel/CHANNEL in GLOB.news_network.network_channels)
|
||||
dat+="<A href='?src=[UID()];ac_pick_d_notice=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ""]<BR>"
|
||||
|
||||
dat+="<BR><A href='?src=[UID()];ac_setScreen=[0]'>Back</A>"
|
||||
@@ -470,7 +470,7 @@ var/global/nologevent = 0
|
||||
dat+="<B>Wanted Issue Handler:</B>"
|
||||
var/wanted_already = 0
|
||||
var/end_param = 1
|
||||
if(news_network.wanted_issue)
|
||||
if(GLOB.news_network.wanted_issue)
|
||||
wanted_already = 1
|
||||
end_param = 2
|
||||
if(wanted_already)
|
||||
@@ -481,7 +481,7 @@ var/global/nologevent = 0
|
||||
<A href='?src=[UID()];ac_set_wanted_desc=1'>Description</A>: [src.admincaster_feed_message.body] <BR>
|
||||
"}
|
||||
if(wanted_already)
|
||||
dat+="<B>Wanted Issue created by:</B><FONT COLOR='green'> [news_network.wanted_issue.backup_author]</FONT><BR>"
|
||||
dat+="<B>Wanted Issue created by:</B><FONT COLOR='green'> [GLOB.news_network.wanted_issue.backup_author]</FONT><BR>"
|
||||
else
|
||||
dat+="<B>Wanted Issue will be created under prosecutor:</B><FONT COLOR='green'> [src.admincaster_signature]</FONT><BR>"
|
||||
dat+="<BR><A href='?src=[UID()];ac_submit_wanted=[end_param]'>[(wanted_already) ? ("Edit Issue") : ("Submit")]</A>"
|
||||
@@ -507,13 +507,13 @@ var/global/nologevent = 0
|
||||
"}
|
||||
if(18)
|
||||
dat+={"
|
||||
<B><FONT COLOR ='maroon'>-- STATIONWIDE WANTED ISSUE --</B></FONT><BR><FONT SIZE=2>\[Submitted by: <FONT COLOR='green'>[news_network.wanted_issue.backup_author]</FONT>\]</FONT><HR>
|
||||
<B>Criminal</B>: [news_network.wanted_issue.author]<BR>
|
||||
<B>Description</B>: [news_network.wanted_issue.body]<BR>
|
||||
<B><FONT COLOR ='maroon'>-- STATIONWIDE WANTED ISSUE --</B></FONT><BR><FONT SIZE=2>\[Submitted by: <FONT COLOR='green'>[GLOB.news_network.wanted_issue.backup_author]</FONT>\]</FONT><HR>
|
||||
<B>Criminal</B>: [GLOB.news_network.wanted_issue.author]<BR>
|
||||
<B>Description</B>: [GLOB.news_network.wanted_issue.body]<BR>
|
||||
<B>Photo:</B>:
|
||||
"}
|
||||
if(news_network.wanted_issue.img)
|
||||
usr << browse_rsc(news_network.wanted_issue.img, "tmp_photow.png")
|
||||
if(GLOB.news_network.wanted_issue.img)
|
||||
usr << browse_rsc(GLOB.news_network.wanted_issue.img, "tmp_photow.png")
|
||||
dat+="<BR><img src='tmp_photow.png' width = '180'>"
|
||||
else
|
||||
dat+="None"
|
||||
@@ -536,7 +536,7 @@ var/global/nologevent = 0
|
||||
return
|
||||
|
||||
var/dat = "<B>Job Bans!</B><HR><table>"
|
||||
for(var/t in jobban_keylist)
|
||||
for(var/t in GLOB.jobban_keylist)
|
||||
var/r = t
|
||||
if( findtext(r,"##") )
|
||||
r = copytext( r, 1, findtext(r,"##") )//removes the description
|
||||
@@ -552,7 +552,7 @@ var/global/nologevent = 0
|
||||
<center><B>Game Panel</B></center><hr>\n
|
||||
<A href='?src=[UID()];c_mode=1'>Change Game Mode</A><br>
|
||||
"}
|
||||
if(master_mode == "secret")
|
||||
if(GLOB.master_mode == "secret")
|
||||
dat += "<A href='?src=[UID()];f_secret=1'>(Force Secret Mode)</A><br>"
|
||||
|
||||
dat += {"
|
||||
@@ -714,8 +714,8 @@ var/global/nologevent = 0
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
enter_allowed = !( enter_allowed )
|
||||
if(!( enter_allowed ))
|
||||
GLOB.enter_allowed = !( GLOB.enter_allowed )
|
||||
if(!( GLOB.enter_allowed ))
|
||||
to_chat(world, "<B>New players may no longer enter the game.</B>")
|
||||
else
|
||||
to_chat(world, "<B>New players may now enter the game.</B>")
|
||||
@@ -750,13 +750,13 @@ var/global/nologevent = 0
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
abandon_allowed = !( abandon_allowed )
|
||||
if(abandon_allowed)
|
||||
GLOB.abandon_allowed = !( GLOB.abandon_allowed )
|
||||
if(GLOB.abandon_allowed)
|
||||
to_chat(world, "<B>You may now respawn.</B>")
|
||||
else
|
||||
to_chat(world, "<B>You may no longer respawn :(</B>")
|
||||
message_admins("[key_name_admin(usr)] toggled respawn to [abandon_allowed ? "On" : "Off"].", 1)
|
||||
log_admin("[key_name(usr)] toggled respawn to [abandon_allowed ? "On" : "Off"].")
|
||||
message_admins("[key_name_admin(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].", 1)
|
||||
log_admin("[key_name(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].")
|
||||
world.update_status()
|
||||
feedback_add_details("admin_verb","TR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -768,9 +768,9 @@ var/global/nologevent = 0
|
||||
if(!check_rights(R_EVENT))
|
||||
return
|
||||
|
||||
aliens_allowed = !aliens_allowed
|
||||
log_admin("[key_name(usr)] toggled aliens to [aliens_allowed].")
|
||||
message_admins("[key_name_admin(usr)] toggled aliens [aliens_allowed ? "on" : "off"].")
|
||||
GLOB.aliens_allowed = !GLOB.aliens_allowed
|
||||
log_admin("[key_name(usr)] toggled aliens to [GLOB.aliens_allowed].")
|
||||
message_admins("[key_name_admin(usr)] toggled aliens [GLOB.aliens_allowed ? "on" : "off"].")
|
||||
feedback_add_details("admin_verb","TA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/delay()
|
||||
@@ -786,13 +786,13 @@ var/global/nologevent = 0
|
||||
log_admin("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].")
|
||||
message_admins("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].", 1)
|
||||
return //alert("Round end delayed", null, null, null, null, null)
|
||||
if(going)
|
||||
going = FALSE
|
||||
if(SSticker.ticker_going)
|
||||
SSticker.ticker_going = FALSE
|
||||
SSticker.delay_end = TRUE
|
||||
to_chat(world, "<b>The game start has been delayed.</b>")
|
||||
log_admin("[key_name(usr)] delayed the game.")
|
||||
else
|
||||
going = TRUE
|
||||
SSticker.ticker_going = TRUE
|
||||
to_chat(world, "<b>The game will start soon.</b>")
|
||||
log_admin("[key_name(usr)] removed the delay.")
|
||||
feedback_add_details("admin_verb","DELAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -899,13 +899,13 @@ var/global/nologevent = 0
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
guests_allowed = !( guests_allowed )
|
||||
if(!( guests_allowed ))
|
||||
GLOB.guests_allowed = !( GLOB.guests_allowed )
|
||||
if(!( GLOB.guests_allowed ))
|
||||
to_chat(world, "<B>Guests may no longer enter the game.</B>")
|
||||
else
|
||||
to_chat(world, "<B>Guests may now enter the game.</B>")
|
||||
log_admin("[key_name(usr)] toggled guests game entering [guests_allowed ? "" : "dis"]allowed.")
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] toggled guests game entering [guests_allowed ? "" : "dis"]allowed.</span>", 1)
|
||||
log_admin("[key_name(usr)] toggled guests game entering [GLOB.guests_allowed ? "" : "dis"]allowed.")
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] toggled guests game entering [GLOB.guests_allowed ? "" : "dis"]allowed.</span>", 1)
|
||||
feedback_add_details("admin_verb","TGU") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/output_ai_laws()
|
||||
@@ -954,12 +954,12 @@ var/global/nologevent = 0
|
||||
//ALL DONE
|
||||
//*********************************************************************************************************
|
||||
|
||||
var/gamma_ship_location = 1 // 0 = station , 1 = space
|
||||
GLOBAL_VAR_INIT(gamma_ship_location, 1) // 0 = station , 1 = space
|
||||
|
||||
/proc/move_gamma_ship()
|
||||
var/area/fromArea
|
||||
var/area/toArea
|
||||
if(gamma_ship_location == 1)
|
||||
if(GLOB.gamma_ship_location == 1)
|
||||
fromArea = locate(/area/shuttle/gamma/space)
|
||||
toArea = locate(/area/shuttle/gamma/station)
|
||||
else
|
||||
@@ -970,10 +970,10 @@ var/gamma_ship_location = 1 // 0 = station , 1 = space
|
||||
for(var/obj/machinery/mech_bay_recharge_port/P in toArea)
|
||||
P.update_recharge_turf()
|
||||
|
||||
if(gamma_ship_location)
|
||||
gamma_ship_location = 0
|
||||
if(GLOB.gamma_ship_location)
|
||||
GLOB.gamma_ship_location = 0
|
||||
else
|
||||
gamma_ship_location = 1
|
||||
GLOB.gamma_ship_location = 1
|
||||
return
|
||||
|
||||
/proc/formatJumpTo(var/location,var/where="")
|
||||
|
||||
@@ -23,18 +23,18 @@
|
||||
if(!message) return
|
||||
var/F = investigate_subject2file(subject)
|
||||
if(!F) return
|
||||
investigate_log_subjects |= subject
|
||||
GLOB.investigate_log_subjects |= subject
|
||||
F << "<small>[time_stamp()] \ref[src] ([x],[y],[z])</small> || [src] [message]<br>"
|
||||
|
||||
/proc/log_investigate(message, subject)
|
||||
if(!message) return
|
||||
var/F = investigate_subject2file(subject)
|
||||
if(!F) return
|
||||
investigate_log_subjects |= subject
|
||||
GLOB.investigate_log_subjects |= subject
|
||||
F << "<small>[time_stamp()] || [message]<br>"
|
||||
|
||||
//ADMINVERBS
|
||||
/client/proc/investigate_show( subject in investigate_log_subjects )
|
||||
/client/proc/investigate_show( subject in GLOB.investigate_log_subjects )
|
||||
set name = "Investigate"
|
||||
set category = "Admin"
|
||||
if(!holder) return
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
set category = "Server"
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
var/memotask = input(usr,"Choose task.","Memo") in list("Show","Write","Edit","Remove")
|
||||
@@ -16,13 +16,13 @@
|
||||
return
|
||||
if(!task)
|
||||
return
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
var/sql_ckey = sanitizeSQL(src.ckey)
|
||||
switch(task)
|
||||
if("Write")
|
||||
var/DBQuery/query_memocheck = dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")] WHERE ckey = '[sql_ckey]'")
|
||||
var/DBQuery/query_memocheck = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")] WHERE ckey = '[sql_ckey]'")
|
||||
if(!query_memocheck.Execute())
|
||||
var/err = query_memocheck.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining ckey from memo table. Error : \[[err]\]\n")
|
||||
@@ -35,7 +35,7 @@
|
||||
return
|
||||
memotext = sanitizeSQL(memotext)
|
||||
var/timestamp = SQLtime()
|
||||
var/DBQuery/query_memoadd = dbcon.NewQuery("INSERT INTO [format_table_name("memo")] (ckey, memotext, timestamp) VALUES ('[sql_ckey]', '[memotext]', '[timestamp]')")
|
||||
var/DBQuery/query_memoadd = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("memo")] (ckey, memotext, timestamp) VALUES ('[sql_ckey]', '[memotext]', '[timestamp]')")
|
||||
if(!query_memoadd.Execute())
|
||||
var/err = query_memoadd.ErrorMsg()
|
||||
log_game("SQL ERROR adding new memo. Error : \[[err]\]\n")
|
||||
@@ -43,7 +43,7 @@
|
||||
log_admin("[key_name(src)] has set a memo: [memotext]")
|
||||
message_admins("[key_name_admin(src)] has set a memo:<br>[memotext]")
|
||||
if("Edit")
|
||||
var/DBQuery/query_memolist = dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")]")
|
||||
var/DBQuery/query_memolist = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")]")
|
||||
if(!query_memolist.Execute())
|
||||
var/err = query_memolist.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining ckey from memo table. Error : \[[err]\]\n")
|
||||
@@ -59,7 +59,7 @@
|
||||
if(!target_ckey)
|
||||
return
|
||||
var/target_sql_ckey = sanitizeSQL(target_ckey)
|
||||
var/DBQuery/query_memofind = dbcon.NewQuery("SELECT memotext FROM [format_table_name("memo")] WHERE ckey = '[target_sql_ckey]'")
|
||||
var/DBQuery/query_memofind = GLOB.dbcon.NewQuery("SELECT memotext FROM [format_table_name("memo")] WHERE ckey = '[target_sql_ckey]'")
|
||||
if(!query_memofind.Execute())
|
||||
var/err = query_memofind.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining memotext from memo table. Error : \[[err]\]\n")
|
||||
@@ -72,7 +72,7 @@
|
||||
new_memo = sanitizeSQL(new_memo)
|
||||
var/edit_text = "Edited by [sql_ckey] on [SQLtime()] from<br>[old_memo]<br>to<br>[new_memo]<hr>"
|
||||
edit_text = sanitizeSQL(edit_text)
|
||||
var/DBQuery/update_query = dbcon.NewQuery("UPDATE [format_table_name("memo")] SET memotext = '[new_memo]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE ckey = '[target_sql_ckey]'")
|
||||
var/DBQuery/update_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("memo")] SET memotext = '[new_memo]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE ckey = '[target_sql_ckey]'")
|
||||
if(!update_query.Execute())
|
||||
var/err = update_query.ErrorMsg()
|
||||
log_game("SQL ERROR editing memo. Error : \[[err]\]\n")
|
||||
@@ -84,7 +84,7 @@
|
||||
log_admin("[key_name(src)] has edited [target_sql_ckey]'s memo from \"[old_memo]\" to \"[new_memo]\"")
|
||||
message_admins("[key_name_admin(src)] has edited [target_sql_ckey]'s memo from \"[old_memo]\" to \"[new_memo]\"")
|
||||
if("Show")
|
||||
var/DBQuery/query_memoshow = dbcon.NewQuery("SELECT ckey, memotext, timestamp, last_editor FROM [format_table_name("memo")]")
|
||||
var/DBQuery/query_memoshow = GLOB.dbcon.NewQuery("SELECT ckey, memotext, timestamp, last_editor FROM [format_table_name("memo")]")
|
||||
if(!query_memoshow.Execute())
|
||||
var/err = query_memoshow.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining ckey, memotext, timestamp, last_editor from memo table. Error : \[[err]\]\n")
|
||||
@@ -104,7 +104,7 @@
|
||||
else if(!silent)
|
||||
to_chat(src, "No memos found in database.")
|
||||
if("Remove")
|
||||
var/DBQuery/query_memodellist = dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")]")
|
||||
var/DBQuery/query_memodellist = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")]")
|
||||
if(!query_memodellist.Execute())
|
||||
var/err = query_memodellist.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining ckey from memo table. Error : \[[err]\]\n")
|
||||
@@ -120,7 +120,7 @@
|
||||
if(!target_ckey)
|
||||
return
|
||||
var/target_sql_ckey = sanitizeSQL(target_ckey)
|
||||
var/DBQuery/query_memodel = dbcon.NewQuery("DELETE FROM [format_table_name("memo")] WHERE ckey = '[target_sql_ckey]'")
|
||||
var/DBQuery/query_memodel = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("memo")] WHERE ckey = '[target_sql_ckey]'")
|
||||
if(!query_memodel.Execute())
|
||||
var/err = query_memodel.ErrorMsg()
|
||||
log_game("SQL ERROR removing memo. Error : \[[err]\]\n")
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
var/list/admin_ranks = list() //list of all ranks with associated rights
|
||||
GLOBAL_LIST_EMPTY(admin_ranks) //list of all ranks with associated rights
|
||||
GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
|
||||
|
||||
//load our rank - > rights associations
|
||||
/proc/load_admin_ranks()
|
||||
admin_ranks.Cut()
|
||||
GLOB.admin_ranks.Cut()
|
||||
|
||||
var/previous_rights = 0
|
||||
|
||||
@@ -44,13 +45,13 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
|
||||
if("mentor") rights |= R_MENTOR
|
||||
if("proccall") rights |= R_PROCCALL
|
||||
|
||||
admin_ranks[rank] = rights
|
||||
GLOB.admin_ranks[rank] = rights
|
||||
previous_rights = rights
|
||||
|
||||
#ifdef TESTING
|
||||
var/msg = "Permission Sets Built:\n"
|
||||
for(var/rank in admin_ranks)
|
||||
msg += "\t[rank] - [admin_ranks[rank]]\n"
|
||||
msg += "\t[rank] - [GLOB.admin_ranks[rank]]\n"
|
||||
testing(msg)
|
||||
#endif
|
||||
|
||||
@@ -60,7 +61,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
|
||||
|
||||
/proc/load_admins()
|
||||
//clear the datums references
|
||||
admin_datums.Cut()
|
||||
GLOB.admin_datums.Cut()
|
||||
for(var/client/C in GLOB.admins)
|
||||
C.remove_admin_verbs()
|
||||
C.holder = null
|
||||
@@ -91,7 +92,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
|
||||
rank = ckeyEx(List[2])
|
||||
|
||||
//load permissions associated with this rank
|
||||
var/rights = admin_ranks[rank]
|
||||
var/rights = GLOB.admin_ranks[rank]
|
||||
|
||||
//create the admin datum and store it for later use
|
||||
var/datum/admins/D = new /datum/admins(rank, rights, ckey)
|
||||
@@ -103,13 +104,13 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
|
||||
//The current admin system uses SQL
|
||||
|
||||
establish_db_connection()
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
log_world("Failed to connect to database in load_admins(). Reverting to legacy system.")
|
||||
config.admin_legacy_system = 1
|
||||
load_admins()
|
||||
return
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, rank, level, flags FROM [format_table_name("admin")]")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, rank, level, flags FROM [format_table_name("admin")]")
|
||||
query.Execute()
|
||||
while(query.NextRow())
|
||||
var/ckey = query.item[1]
|
||||
@@ -122,7 +123,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
|
||||
|
||||
//find the client for a ckey if they are connected and associate them with the new admin datum
|
||||
D.associate(GLOB.directory[ckey])
|
||||
if(!admin_datums)
|
||||
if(!GLOB.admin_datums)
|
||||
log_world("The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system.")
|
||||
config.admin_legacy_system = 1
|
||||
load_admins()
|
||||
@@ -130,9 +131,9 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
|
||||
|
||||
#ifdef TESTING
|
||||
var/msg = "Admins Built:\n"
|
||||
for(var/ckey in admin_datums)
|
||||
for(var/ckey in GLOB.admin_datums)
|
||||
var/rank
|
||||
var/datum/admins/D = admin_datums[ckey]
|
||||
var/datum/admins/D = GLOB.admin_datums[ckey]
|
||||
if(D) rank = D.rank
|
||||
msg += "\t[ckey] - [rank]\n"
|
||||
testing(msg)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
//admin verb groups - They can overlap if you so wish. Only one of each verb will exist in the verbs list regardless
|
||||
var/list/admin_verbs_default = list(
|
||||
GLOBAL_LIST_INIT(admin_verbs_default, list(
|
||||
/client/proc/deadmin_self, /*destroys our own admin datum so we can play as a regular player*/
|
||||
/client/proc/hide_verbs, /*hides all our adminverbs*/
|
||||
/client/proc/toggleadminhelpsound,
|
||||
/client/proc/togglementorhelpsound,
|
||||
/client/proc/cmd_mentor_check_new_players,
|
||||
/client/proc/cmd_mentor_check_player_exp /* shows players by playtime */
|
||||
)
|
||||
var/list/admin_verbs_admin = list(
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_admin, list(
|
||||
/client/proc/check_antagonists, /*shows all antags*/
|
||||
/datum/admins/proc/show_player_panel,
|
||||
/client/proc/player_panel, /*shows an interface for all players, with links to various panels (old style)*/
|
||||
@@ -79,20 +79,20 @@ var/list/admin_verbs_admin = list(
|
||||
/client/proc/list_ssds_afks,
|
||||
/client/proc/cmd_admin_headset_message,
|
||||
/client/proc/spawn_floor_cluwne
|
||||
)
|
||||
var/list/admin_verbs_ban = list(
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_ban, list(
|
||||
/client/proc/unban_panel,
|
||||
/client/proc/jobbans,
|
||||
/client/proc/stickybanpanel
|
||||
)
|
||||
var/list/admin_verbs_sounds = list(
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_sounds, list(
|
||||
/client/proc/play_local_sound,
|
||||
/client/proc/play_sound,
|
||||
/client/proc/play_server_sound,
|
||||
/client/proc/play_intercomm_sound,
|
||||
/client/proc/stop_global_admin_sounds
|
||||
)
|
||||
var/list/admin_verbs_event = list(
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_event, list(
|
||||
/client/proc/object_talk,
|
||||
/client/proc/cmd_admin_dress,
|
||||
/client/proc/cmd_admin_gib_self,
|
||||
@@ -117,14 +117,14 @@ var/list/admin_verbs_event = list(
|
||||
/client/proc/event_manager_panel,
|
||||
/client/proc/modify_goals,
|
||||
/client/proc/outfit_manager
|
||||
)
|
||||
))
|
||||
|
||||
var/list/admin_verbs_spawn = list(
|
||||
GLOBAL_LIST_INIT(admin_verbs_spawn, list(
|
||||
/datum/admins/proc/spawn_atom, /*allows us to spawn instances*/
|
||||
/client/proc/respawn_character,
|
||||
/client/proc/admin_deserialize
|
||||
)
|
||||
var/list/admin_verbs_server = list(
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_server, list(
|
||||
/client/proc/ToRban,
|
||||
/client/proc/Set_Holiday,
|
||||
/datum/admins/proc/startnow,
|
||||
@@ -144,8 +144,8 @@ var/list/admin_verbs_server = list(
|
||||
/client/proc/toggle_antagHUD_restrictions,
|
||||
/client/proc/set_ooc,
|
||||
/client/proc/reset_ooc
|
||||
)
|
||||
var/list/admin_verbs_debug = list(
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_debug, list(
|
||||
/client/proc/cmd_admin_list_open_jobs,
|
||||
/client/proc/Debug2,
|
||||
/client/proc/cmd_debug_make_powernets,
|
||||
@@ -172,21 +172,21 @@ var/list/admin_verbs_debug = list(
|
||||
/client/proc/admin_serialize,
|
||||
/client/proc/jump_to_ruin,
|
||||
/client/proc/toggle_medal_disable,
|
||||
)
|
||||
var/list/admin_verbs_possess = list(
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_possess, list(
|
||||
/proc/possess,
|
||||
/proc/release
|
||||
)
|
||||
var/list/admin_verbs_permissions = list(
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_permissions, list(
|
||||
/client/proc/edit_admin_permissions,
|
||||
/client/proc/create_poll,
|
||||
/client/proc/big_brother
|
||||
)
|
||||
var/list/admin_verbs_rejuv = list(
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_rejuv, list(
|
||||
/client/proc/respawn_character,
|
||||
/client/proc/cmd_admin_rejuvenate
|
||||
)
|
||||
var/list/admin_verbs_mod = list(
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_mod, list(
|
||||
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
|
||||
/client/proc/cmd_admin_pm_panel, /*admin-pm list*/
|
||||
/client/proc/cmd_admin_pm_by_key_panel, /*admin-pm list by key*/
|
||||
@@ -199,8 +199,8 @@ var/list/admin_verbs_mod = list(
|
||||
/datum/admins/proc/show_player_panel,
|
||||
/client/proc/jobbans,
|
||||
/client/proc/debug_variables /*allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify*/
|
||||
)
|
||||
var/list/admin_verbs_mentor = list(
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_mentor, list(
|
||||
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
|
||||
/client/proc/cmd_admin_pm_panel, /*admin-pm list*/
|
||||
/client/proc/cmd_admin_pm_by_key_panel, /*admin-pm list by key*/
|
||||
@@ -208,20 +208,20 @@ var/list/admin_verbs_mentor = list(
|
||||
/client/proc/toggleMentorTicketLogs,
|
||||
/client/proc/cmd_mentor_say /* mentor say*/
|
||||
// cmd_mentor_say is added/removed by the toggle_mentor_chat verb
|
||||
)
|
||||
var/list/admin_verbs_proccall = list(
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_proccall, list(
|
||||
/client/proc/callproc,
|
||||
/client/proc/callproc_datum,
|
||||
/client/proc/SDQL2_query
|
||||
)
|
||||
var/list/admin_verbs_ticket = list(
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_ticket, list(
|
||||
/client/proc/openAdminTicketUI,
|
||||
/client/proc/toggleticketlogs,
|
||||
/client/proc/openMentorTicketUI,
|
||||
/client/proc/toggleMentorTicketLogs,
|
||||
/client/proc/resolveAllAdminTickets,
|
||||
/client/proc/resolveAllMentorTickets
|
||||
)
|
||||
))
|
||||
|
||||
/client/proc/on_holder_add()
|
||||
if(chatOutput && chatOutput.loaded)
|
||||
@@ -229,62 +229,62 @@ var/list/admin_verbs_ticket = list(
|
||||
|
||||
/client/proc/add_admin_verbs()
|
||||
if(holder)
|
||||
verbs += admin_verbs_default
|
||||
verbs += GLOB.admin_verbs_default
|
||||
if(holder.rights & R_BUILDMODE)
|
||||
verbs += /client/proc/togglebuildmodeself
|
||||
if(holder.rights & R_ADMIN)
|
||||
verbs += admin_verbs_admin
|
||||
verbs += admin_verbs_ticket
|
||||
verbs += GLOB.admin_verbs_admin
|
||||
verbs += GLOB.admin_verbs_ticket
|
||||
spawn(1)
|
||||
control_freak = 0
|
||||
if(holder.rights & R_BAN)
|
||||
verbs += admin_verbs_ban
|
||||
verbs += GLOB.admin_verbs_ban
|
||||
if(holder.rights & R_EVENT)
|
||||
verbs += admin_verbs_event
|
||||
verbs += GLOB.admin_verbs_event
|
||||
if(holder.rights & R_SERVER)
|
||||
verbs += admin_verbs_server
|
||||
verbs += GLOB.admin_verbs_server
|
||||
if(holder.rights & R_DEBUG)
|
||||
verbs += admin_verbs_debug
|
||||
verbs += GLOB.admin_verbs_debug
|
||||
if(holder.rights & R_POSSESS)
|
||||
verbs += admin_verbs_possess
|
||||
verbs += GLOB.admin_verbs_possess
|
||||
if(holder.rights & R_PERMISSIONS)
|
||||
verbs += admin_verbs_permissions
|
||||
verbs += GLOB.admin_verbs_permissions
|
||||
if(holder.rights & R_STEALTH)
|
||||
verbs += /client/proc/stealth
|
||||
if(holder.rights & R_REJUVINATE)
|
||||
verbs += admin_verbs_rejuv
|
||||
verbs += GLOB.admin_verbs_rejuv
|
||||
if(holder.rights & R_SOUNDS)
|
||||
verbs += admin_verbs_sounds
|
||||
verbs += GLOB.admin_verbs_sounds
|
||||
if(holder.rights & R_SPAWN)
|
||||
verbs += admin_verbs_spawn
|
||||
verbs += GLOB.admin_verbs_spawn
|
||||
if(holder.rights & R_MOD)
|
||||
verbs += admin_verbs_mod
|
||||
verbs += GLOB.admin_verbs_mod
|
||||
if(holder.rights & R_MENTOR)
|
||||
verbs += admin_verbs_mentor
|
||||
verbs += GLOB.admin_verbs_mentor
|
||||
if(holder.rights & R_PROCCALL)
|
||||
verbs += admin_verbs_proccall
|
||||
verbs += GLOB.admin_verbs_proccall
|
||||
|
||||
/client/proc/remove_admin_verbs()
|
||||
verbs.Remove(
|
||||
admin_verbs_default,
|
||||
GLOB.admin_verbs_default,
|
||||
/client/proc/togglebuildmodeself,
|
||||
admin_verbs_admin,
|
||||
admin_verbs_ban,
|
||||
admin_verbs_event,
|
||||
admin_verbs_server,
|
||||
admin_verbs_debug,
|
||||
admin_verbs_possess,
|
||||
admin_verbs_permissions,
|
||||
GLOB.admin_verbs_admin,
|
||||
GLOB.admin_verbs_ban,
|
||||
GLOB.admin_verbs_event,
|
||||
GLOB.admin_verbs_server,
|
||||
GLOB.admin_verbs_debug,
|
||||
GLOB.admin_verbs_possess,
|
||||
GLOB.admin_verbs_permissions,
|
||||
/client/proc/stealth,
|
||||
admin_verbs_rejuv,
|
||||
admin_verbs_sounds,
|
||||
admin_verbs_spawn,
|
||||
admin_verbs_mod,
|
||||
admin_verbs_mentor,
|
||||
admin_verbs_proccall,
|
||||
admin_verbs_show_debug_verbs,
|
||||
GLOB.admin_verbs_rejuv,
|
||||
GLOB.admin_verbs_sounds,
|
||||
GLOB.admin_verbs_spawn,
|
||||
GLOB.admin_verbs_mod,
|
||||
GLOB.admin_verbs_mentor,
|
||||
GLOB.admin_verbs_proccall,
|
||||
GLOB.admin_verbs_show_debug_verbs,
|
||||
/client/proc/readmin,
|
||||
admin_verbs_ticket
|
||||
GLOB.admin_verbs_ticket
|
||||
)
|
||||
|
||||
/client/proc/hide_verbs()
|
||||
@@ -514,14 +514,14 @@ var/list/admin_verbs_ticket = list(
|
||||
return
|
||||
|
||||
if(!warned_ckey || !istext(warned_ckey)) return
|
||||
if(warned_ckey in admin_datums)
|
||||
if(warned_ckey in GLOB.admin_datums)
|
||||
to_chat(usr, "<font color='red'>Error: warn(): You can't warn admins.</font>")
|
||||
return
|
||||
|
||||
var/datum/preferences/D
|
||||
var/client/C = GLOB.directory[warned_ckey]
|
||||
if(C) D = C.prefs
|
||||
else D = preferences_datums[warned_ckey]
|
||||
else D = GLOB.preferences_datums[warned_ckey]
|
||||
|
||||
if(!D)
|
||||
to_chat(src, "<font color='red'>Error: warn(): No such ckey found.</font>")
|
||||
@@ -601,7 +601,7 @@ var/list/admin_verbs_ticket = list(
|
||||
|
||||
var/list/spell_list = list()
|
||||
var/type_length = length("/obj/effect/proc_holder/spell") + 2
|
||||
for(var/A in spells)
|
||||
for(var/A in GLOB.spells)
|
||||
spell_list[copytext("[A]", type_length)] = A
|
||||
var/obj/effect/proc_holder/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in spell_list
|
||||
if(!S)
|
||||
@@ -620,7 +620,7 @@ var/list/admin_verbs_ticket = list(
|
||||
set category = "Event"
|
||||
set name = "Give Disease"
|
||||
set desc = "Gives a Disease to a mob."
|
||||
var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in diseases
|
||||
var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in GLOB.diseases
|
||||
if(!D) return
|
||||
T.ForceContractDisease(new D)
|
||||
feedback_add_details("admin_verb","GD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -694,7 +694,7 @@ var/list/admin_verbs_ticket = list(
|
||||
set category = "Admin"
|
||||
set desc = "Regain your admin powers."
|
||||
|
||||
var/datum/admins/D = admin_datums[ckey]
|
||||
var/datum/admins/D = GLOB.admin_datums[ckey]
|
||||
var/rank = null
|
||||
if(config.admin_legacy_system)
|
||||
//load text from file
|
||||
@@ -707,26 +707,26 @@ var/list/admin_verbs_ticket = list(
|
||||
break
|
||||
continue
|
||||
else
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
message_admins("Warning, MySQL database is not connected.")
|
||||
to_chat(src, "Warning, MYSQL database is not connected.")
|
||||
return
|
||||
var/sql_ckey = sanitizeSQL(ckey)
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT rank FROM [format_table_name("admin")] WHERE ckey = '[sql_ckey]'")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT rank FROM [format_table_name("admin")] WHERE ckey = '[sql_ckey]'")
|
||||
query.Execute()
|
||||
while(query.NextRow())
|
||||
rank = ckeyEx(query.item[1])
|
||||
if(!D)
|
||||
if(config.admin_legacy_system)
|
||||
if(admin_ranks[rank] == null)
|
||||
if(GLOB.admin_ranks[rank] == null)
|
||||
error("Error while re-adminning [src], admin rank ([rank]) does not exist.")
|
||||
to_chat(src, "Error while re-adminning, admin rank ([rank]) does not exist.")
|
||||
return
|
||||
|
||||
D = new(rank, admin_ranks[rank], ckey)
|
||||
D = new(rank, GLOB.admin_ranks[rank], ckey)
|
||||
else
|
||||
var/sql_ckey = sanitizeSQL(ckey)
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, rank, flags FROM [format_table_name("admin")] WHERE ckey = '[sql_ckey]'")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, rank, flags FROM [format_table_name("admin")] WHERE ckey = '[sql_ckey]'")
|
||||
query.Execute()
|
||||
while(query.NextRow())
|
||||
var/admin_ckey = query.item[1]
|
||||
@@ -791,7 +791,7 @@ var/list/admin_verbs_ticket = list(
|
||||
if(!S) return
|
||||
|
||||
var/datum/nano_module/law_manager/L = new(S)
|
||||
L.ui_interact(usr, state = admin_state)
|
||||
L.ui_interact(usr, state = GLOB.admin_state)
|
||||
log_and_message_admins("has opened [S]'s law manager.")
|
||||
feedback_add_details("admin_verb","MSL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
//ban people from using custom names and appearances. that'll show 'em.
|
||||
|
||||
var/appearanceban_runonce //Updates legacy bans with new info
|
||||
var/appearance_keylist[0] //to store the keys
|
||||
GLOBAL_VAR(appearanceban_runonce) //Updates legacy bans with new info
|
||||
GLOBAL_LIST_EMPTY(appearance_keylist) //to store the keys
|
||||
|
||||
/proc/appearance_fullban(mob/M, reason)
|
||||
if(!M || !M.key) return
|
||||
appearance_keylist.Add(text("[M.ckey] ## [reason]"))
|
||||
GLOB.appearance_keylist.Add(text("[M.ckey] ## [reason]"))
|
||||
appearance_savebanfile()
|
||||
|
||||
/proc/appearance_client_fullban(ckey)
|
||||
if(!ckey) return
|
||||
appearance_keylist.Add(text("[ckey]"))
|
||||
GLOB.appearance_keylist.Add(text("[ckey]"))
|
||||
appearance_savebanfile()
|
||||
|
||||
//returns a reason if M is banned, returns 0 otherwise
|
||||
/proc/appearance_isbanned(mob/M)
|
||||
if(M)
|
||||
for(var/s in appearance_keylist)
|
||||
for(var/s in GLOB.appearance_keylist)
|
||||
if(findtext(s, "[M.ckey]") == 1)
|
||||
var/startpos = findtext(s, "## ") + 3
|
||||
if(startpos && startpos < length(s))
|
||||
@@ -43,12 +43,12 @@ DEBUG
|
||||
/proc/appearance_loadbanfile()
|
||||
if(config.ban_legacy_system)
|
||||
var/savefile/S=new("data/appearance_full.ban")
|
||||
S["keys[0]"] >> appearance_keylist
|
||||
S["keys[0]"] >> GLOB.appearance_keylist
|
||||
log_admin("Loading appearance_rank")
|
||||
S["runonce"] >> appearanceban_runonce
|
||||
S["runonce"] >> GLOB.appearanceban_runonce
|
||||
|
||||
if(!length(appearance_keylist))
|
||||
appearance_keylist=list()
|
||||
if(!length(GLOB.appearance_keylist))
|
||||
GLOB.appearance_keylist=list()
|
||||
log_admin("appearance_keylist was empty")
|
||||
else
|
||||
if(!establish_db_connection())
|
||||
@@ -58,17 +58,17 @@ DEBUG
|
||||
return
|
||||
|
||||
//appearance bans
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT ckey FROM [format_table_name("ban")] WHERE bantype = 'APPEARANCE_BAN' AND NOT unbanned = 1")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("ban")] WHERE bantype = 'APPEARANCE_BAN' AND NOT unbanned = 1")
|
||||
query.Execute()
|
||||
|
||||
while(query.NextRow())
|
||||
var/ckey = query.item[1]
|
||||
|
||||
appearance_keylist.Add("[ckey]")
|
||||
GLOB.appearance_keylist.Add("[ckey]")
|
||||
|
||||
/proc/appearance_savebanfile()
|
||||
var/savefile/S=new("data/appearance_full.ban")
|
||||
to_chat(S["keys[0]"], appearance_keylist)
|
||||
to_chat(S["keys[0]"], GLOB.appearance_keylist)
|
||||
|
||||
/proc/appearance_unban(mob/M)
|
||||
appearance_remove("[M.ckey]")
|
||||
@@ -76,18 +76,18 @@ DEBUG
|
||||
|
||||
|
||||
/proc/appearance_updatelegacybans()
|
||||
if(!appearanceban_runonce)
|
||||
if(!GLOB.appearanceban_runonce)
|
||||
log_admin("Updating appearancefile!")
|
||||
// Updates bans.. Or fixes them. Either way.
|
||||
for(var/T in appearance_keylist)
|
||||
for(var/T in GLOB.appearance_keylist)
|
||||
if(!T) continue
|
||||
appearanceban_runonce++ //don't run this update again
|
||||
GLOB.appearanceban_runonce++ //don't run this update again
|
||||
|
||||
|
||||
/proc/appearance_remove(X)
|
||||
for(var/i = 1; i <= length(appearance_keylist); i++)
|
||||
if( findtext(appearance_keylist[i], "[X]") )
|
||||
appearance_keylist.Remove(appearance_keylist[i])
|
||||
for(var/i = 1; i <= length(GLOB.appearance_keylist); i++)
|
||||
if( findtext(GLOB.appearance_keylist[i], "[X]") )
|
||||
GLOB.appearance_keylist.Remove(GLOB.appearance_keylist[i])
|
||||
appearance_savebanfile()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
var/jobban_runonce // Updates legacy bans with new info
|
||||
var/jobban_keylist[0] // Linear list of jobban strings, kept around for the legacy system
|
||||
var/jobban_assoclist[0] // Associative list, for efficiency
|
||||
GLOBAL_VAR(jobban_runonce) // Updates legacy bans with new info
|
||||
GLOBAL_LIST_INIT(jobban_keylist, new()) // Linear list of jobban strings, kept around for the legacy system
|
||||
GLOBAL_LIST_INIT(jobban_assoclist, new()) // Associative list, for efficiency
|
||||
|
||||
// Matches string-based jobbans into ckey, rank, and reason groups
|
||||
var/regex/jobban_regex = regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## (.+))?")
|
||||
GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## (.+))?"))
|
||||
|
||||
/proc/jobban_assoc_insert(ckey, rank, reason)
|
||||
if(!ckey || !rank)
|
||||
return
|
||||
if(!jobban_assoclist[ckey])
|
||||
jobban_assoclist[ckey] = list()
|
||||
jobban_assoclist[ckey][rank] = reason || "Reason Unspecified"
|
||||
if(!GLOB.jobban_assoclist[ckey])
|
||||
GLOB.jobban_assoclist[ckey] = list()
|
||||
GLOB.jobban_assoclist[ckey][rank] = reason || "Reason Unspecified"
|
||||
|
||||
/proc/jobban_fullban(mob/M, rank, reason)
|
||||
if(!M || !M.key)
|
||||
return
|
||||
jobban_keylist.Add(text("[M.ckey] - [rank] ## [reason]"))
|
||||
GLOB.jobban_keylist.Add(text("[M.ckey] - [rank] ## [reason]"))
|
||||
jobban_assoc_insert(M.ckey, rank, reason)
|
||||
if(config.ban_legacy_system)
|
||||
jobban_savebanfile()
|
||||
@@ -23,7 +23,7 @@ var/regex/jobban_regex = regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## (.+))?")
|
||||
/proc/jobban_client_fullban(ckey, rank)
|
||||
if(!ckey || !rank)
|
||||
return
|
||||
jobban_keylist.Add(text("[ckey] - [rank]"))
|
||||
GLOB.jobban_keylist.Add(text("[ckey] - [rank]"))
|
||||
jobban_assoc_insert(ckey, rank)
|
||||
if(config.ban_legacy_system)
|
||||
jobban_savebanfile()
|
||||
@@ -37,8 +37,8 @@ var/regex/jobban_regex = regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## (.+))?")
|
||||
if(IsGuestKey(M.key))
|
||||
return "Guest Job-ban"
|
||||
|
||||
if(jobban_assoclist[M.ckey])
|
||||
return jobban_assoclist[M.ckey][rank]
|
||||
if(GLOB.jobban_assoclist[M.ckey])
|
||||
return GLOB.jobban_assoclist[M.ckey][rank]
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -63,17 +63,17 @@ DEBUG
|
||||
/proc/jobban_loadbanfile()
|
||||
if(config.ban_legacy_system)
|
||||
var/savefile/S=new("data/job_full.ban")
|
||||
S["keys[0]"] >> jobban_keylist
|
||||
S["keys[0]"] >> GLOB.jobban_keylist
|
||||
log_admin("Loading jobban_rank")
|
||||
S["runonce"] >> jobban_runonce
|
||||
S["runonce"] >> GLOB.jobban_runonce
|
||||
|
||||
if(!length(jobban_keylist))
|
||||
jobban_keylist=list()
|
||||
if(!length(GLOB.jobban_keylist))
|
||||
GLOB.jobban_keylist=list()
|
||||
log_admin("jobban_keylist was empty")
|
||||
|
||||
for(var/s in jobban_keylist)
|
||||
if(jobban_regex.Find(s))
|
||||
jobban_assoc_insert(jobban_regex.group[1], jobban_regex.group[2], jobban_regex.group[3])
|
||||
for(var/s in GLOB.jobban_keylist)
|
||||
if(GLOB.jobban_regex.Find(s))
|
||||
jobban_assoc_insert(GLOB.jobban_regex.group[1], GLOB.jobban_regex.group[2], GLOB.jobban_regex.group[3])
|
||||
else
|
||||
log_runtime(EXCEPTION("Skipping malformed job ban: [s]"))
|
||||
else
|
||||
@@ -84,10 +84,10 @@ DEBUG
|
||||
return
|
||||
|
||||
//Job permabans
|
||||
var/DBQuery/permabans = dbcon.NewQuery("SELECT ckey, job FROM [format_table_name("ban")] WHERE bantype = 'JOB_PERMABAN' AND isnull(unbanned)")
|
||||
var/DBQuery/permabans = GLOB.dbcon.NewQuery("SELECT ckey, job FROM [format_table_name("ban")] WHERE bantype = 'JOB_PERMABAN' AND isnull(unbanned)")
|
||||
permabans.Execute()
|
||||
// Job tempbans
|
||||
var/DBQuery/tempbans = dbcon.NewQuery("SELECT ckey, job FROM [format_table_name("ban")] WHERE bantype = 'JOB_TEMPBAN' AND isnull(unbanned) AND expiration_time > Now()")
|
||||
var/DBQuery/tempbans = GLOB.dbcon.NewQuery("SELECT ckey, job FROM [format_table_name("ban")] WHERE bantype = 'JOB_TEMPBAN' AND isnull(unbanned) AND expiration_time > Now()")
|
||||
tempbans.Execute()
|
||||
|
||||
while(TRUE)
|
||||
@@ -102,12 +102,12 @@ DEBUG
|
||||
else
|
||||
break
|
||||
|
||||
jobban_keylist.Add("[ckey] - [job]")
|
||||
GLOB.jobban_keylist.Add("[ckey] - [job]")
|
||||
jobban_assoc_insert(ckey, job)
|
||||
|
||||
/proc/jobban_savebanfile()
|
||||
var/savefile/S=new("data/job_full.ban")
|
||||
S["keys[0]"] << jobban_keylist
|
||||
S["keys[0]"] << GLOB.jobban_keylist
|
||||
|
||||
/proc/jobban_unban(mob/M, rank)
|
||||
jobban_remove("[M.ckey] - [rank]")
|
||||
@@ -120,19 +120,19 @@ DEBUG
|
||||
|
||||
|
||||
/proc/jobban_remove(X)
|
||||
for(var/i = 1; i <= length(jobban_keylist); i++)
|
||||
if( findtext(jobban_keylist[i], "[X]") )
|
||||
for(var/i = 1; i <= length(GLOB.jobban_keylist); i++)
|
||||
if( findtext(GLOB.jobban_keylist[i], "[X]") )
|
||||
// This need to be here, instead of jobban_unban, due to direct calls to jobban_remove
|
||||
if(jobban_regex.Find(X))
|
||||
var/ckey = jobban_regex.group[1]
|
||||
var/rank = jobban_regex.group[2]
|
||||
if(jobban_assoclist[ckey] && jobban_assoclist[ckey][rank])
|
||||
jobban_assoclist[ckey] -= rank
|
||||
if(GLOB.jobban_regex.Find(X))
|
||||
var/ckey = GLOB.jobban_regex.group[1]
|
||||
var/rank = GLOB.jobban_regex.group[2]
|
||||
if(GLOB.jobban_assoclist[ckey] && GLOB.jobban_assoclist[ckey][rank])
|
||||
GLOB.jobban_assoclist[ckey] -= rank
|
||||
else
|
||||
log_runtime(EXCEPTION("Attempted to remove non-existent job ban: [X]"))
|
||||
else
|
||||
log_runtime(EXCEPTION("Failed to remove malformed job ban from associative list: [X]"))
|
||||
jobban_keylist.Remove(jobban_keylist[i])
|
||||
GLOB.jobban_keylist.Remove(GLOB.jobban_keylist[i])
|
||||
if(config.ban_legacy_system)
|
||||
jobban_savebanfile()
|
||||
return 1
|
||||
@@ -152,7 +152,7 @@ DEBUG
|
||||
else
|
||||
//using the SQL ban system
|
||||
var/is_actually_banned = FALSE
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT bantime, bantype, reason, job, duration, expiration_time, a_ckey FROM [format_table_name("ban")] WHERE ckey like '[ckey]' AND ((bantype like 'JOB_TEMPBAN' AND expiration_time > Now()) OR (bantype like 'JOB_PERMABAN')) AND isnull(unbanned) ORDER BY bantime DESC LIMIT 100")
|
||||
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT bantime, bantype, reason, job, duration, expiration_time, a_ckey FROM [format_table_name("ban")] WHERE ckey like '[ckey]' AND ((bantype like 'JOB_TEMPBAN' AND expiration_time > Now()) OR (bantype like 'JOB_PERMABAN')) AND isnull(unbanned) ORDER BY bantime DESC LIMIT 100")
|
||||
select_query.Execute()
|
||||
|
||||
while(select_query.NextRow())
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/var/create_mob_html = null
|
||||
GLOBAL_VAR(create_mob_html)
|
||||
/datum/admins/proc/create_mob(var/mob/user)
|
||||
if(!create_mob_html)
|
||||
if(!GLOB.create_mob_html)
|
||||
var/mobjs = null
|
||||
mobjs = jointext(typesof(/mob), ";")
|
||||
create_mob_html = file2text('html/create_object.html')
|
||||
create_mob_html = replacetext(create_mob_html, "null /* object types */", "\"[mobjs]\"")
|
||||
GLOB.create_mob_html = file2text('html/create_object.html')
|
||||
GLOB.create_mob_html = replacetext(GLOB.create_mob_html, "null /* object types */", "\"[mobjs]\"")
|
||||
|
||||
user << browse(replacetext(create_mob_html, "/* ref src */", UID()), "window=create_mob;size=425x475")
|
||||
user << browse(replacetext(GLOB.create_mob_html, "/* ref src */", UID()), "window=create_mob;size=425x475")
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
var/create_object_html = null
|
||||
var/list/create_object_forms = list(/obj, /obj/structure, /obj/machinery, /obj/effect, /obj/item, /obj/mecha, /obj/item/clothing, /obj/item/stack, /obj/item/reagent_containers, /obj/item/gun)
|
||||
GLOBAL_VAR(create_object_html)
|
||||
GLOBAL_LIST_INIT(create_object_forms, list(/obj, /obj/structure, /obj/machinery, /obj/effect, /obj/item, /obj/mecha, /obj/item/clothing, /obj/item/stack, /obj/item/reagent_containers, /obj/item/gun))
|
||||
|
||||
/datum/admins/proc/create_object(var/mob/user)
|
||||
if(!create_object_html)
|
||||
if(!GLOB.create_object_html)
|
||||
var/objectjs = null
|
||||
objectjs = jointext(typesof(/obj), ";")
|
||||
create_object_html = file2text('html/create_object.html')
|
||||
create_object_html = replacetext(create_object_html, "null /* object types */", "\"[objectjs]\"")
|
||||
GLOB.create_object_html = file2text('html/create_object.html')
|
||||
GLOB.create_object_html = replacetext(GLOB.create_object_html, "null /* object types */", "\"[objectjs]\"")
|
||||
|
||||
user << browse(replacetext(create_object_html, "/* ref src */", UID()), "window=create_object;size=425x475")
|
||||
user << browse(replacetext(GLOB.create_object_html, "/* ref src */", UID()), "window=create_object;size=425x475")
|
||||
|
||||
/datum/admins/proc/quick_create_object(var/mob/user)
|
||||
var/path = input("Select the path of the object you wish to create.", "Path", /obj) in create_object_forms
|
||||
var/html_form = create_object_forms[path]
|
||||
var/path = input("Select the path of the object you wish to create.", "Path", /obj) in GLOB.create_object_forms
|
||||
var/html_form = GLOB.create_object_forms[path]
|
||||
|
||||
if(!html_form)
|
||||
var/objectjs = jointext(typesof(path), ";")
|
||||
html_form = file2text('html/create_object.html')
|
||||
html_form = replacetext(html_form, "null /* object types */", "\"[objectjs]\"")
|
||||
create_object_forms[path] = html_form
|
||||
GLOB.create_object_forms[path] = html_form
|
||||
|
||||
user << browse(replacetext(html_form, "/* ref src */", UID()), "window=qco[path];size=425x475")
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
/client/proc/create_poll()
|
||||
set name = "Create Server Poll"
|
||||
set category = "Server"
|
||||
if(!check_rights(R_SERVER))
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
create_poll_window()
|
||||
|
||||
/client/proc/create_poll_window(var/errormessage = "")
|
||||
if(!check_rights(R_SERVER))
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
var/output={"<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -75,7 +75,7 @@ function onload() {
|
||||
<form name='createpoll' action='byond://' method='post' style='padding-left:30px;padding-right:30px;padding-top:10px'>
|
||||
<input type='hidden' name='createpollnumoptions' id='createpollnumoptions' value='0'>
|
||||
<table><tr><td style='width:50%' style="vertical-align:top"><div id='polloptions'><div id='polloptionsinner'>
|
||||
|
||||
|
||||
</div>
|
||||
<input type='button' onclick='add_option()' value="Add Option"></input>
|
||||
<input type='button' onclick='del_option()' value="Delete Option"></input>
|
||||
@@ -99,7 +99,7 @@ function onload() {
|
||||
src << browse(output, "window=createplayerpoll;size=950x500")
|
||||
|
||||
/client/proc/create_poll_function(href_list)
|
||||
if(!check_rights(R_SERVER))
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
var/polltype = href_list["createpoll"]
|
||||
if(polltype != POLLTYPE_OPTION && polltype != POLLTYPE_TEXT && polltype != POLLTYPE_RATING && polltype != POLLTYPE_MULTI)
|
||||
@@ -122,15 +122,15 @@ function onload() {
|
||||
create_poll_window("<font color='red'>Question cannot be blank.</font>")
|
||||
return
|
||||
question = sanitizeSQL(question)
|
||||
|
||||
|
||||
var/starttime
|
||||
var/endtime
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT Now() AS starttime, ADDDATE(Now(), INTERVAL [poll_len] DAY) AS endtime")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT Now() AS starttime, ADDDATE(Now(), INTERVAL [poll_len] DAY) AS endtime")
|
||||
query.Execute()
|
||||
while(query.NextRow())
|
||||
starttime = query.item[1]
|
||||
endtime = query.item[2]
|
||||
|
||||
|
||||
var/pollquery = "INSERT INTO [format_table_name("poll_question")] (polltype, starttime, endtime, question, adminonly, multiplechoiceoptions, createdby_ckey, createdby_ip) VALUES ('[polltype]', '[starttime]', '[endtime]', '[question]', '[adminonly]', '[choice_amount]', '[sql_ckey]', '[address]')"
|
||||
var/idquery = "SELECT id FROM [format_table_name("poll_question")] WHERE question = '[question]' AND starttime = '[starttime]' AND endtime = '[endtime]' AND createdby_ckey = '[sql_ckey]' AND createdby_ip = '[address]'"
|
||||
var/list/option_queries = list()
|
||||
@@ -175,15 +175,15 @@ function onload() {
|
||||
if(descmax)
|
||||
descmax = sanitizeSQL(descmax)
|
||||
option_queries += "INSERT INTO [format_table_name("poll_option")] (pollid, text, percentagecalc, minval, maxval, descmin, descmid, descmax) VALUES ('{POLLID}', '[option]', '[percentagecalc]', '[minval]', '[maxval]', '[descmin]', '[descmid]', '[descmax]')"
|
||||
|
||||
query = dbcon.NewQuery(pollquery)
|
||||
|
||||
query = GLOB.dbcon.NewQuery(pollquery)
|
||||
if(!query.Execute())
|
||||
var/err = query.ErrorMsg()
|
||||
create_poll_window("<font color='red'>An SQL error has occured while creating your poll</font>")
|
||||
log_game("SQL ERROR adding new poll question to table. Error : \[[err]\]\n")
|
||||
return
|
||||
var/pollid = 0
|
||||
query = dbcon.NewQuery(idquery)
|
||||
query = GLOB.dbcon.NewQuery(idquery)
|
||||
if(!query.Execute())
|
||||
var/err = query.ErrorMsg()
|
||||
create_poll_window("<font color='red'>An SQL error has occured while creating your poll</font>")
|
||||
@@ -192,7 +192,7 @@ function onload() {
|
||||
if(query.NextRow())
|
||||
pollid = text2num(query.item[1])
|
||||
for(var/querytext in option_queries)
|
||||
query = dbcon.NewQuery(replacetext(idquery, "{POLLID}", pollid))
|
||||
query = GLOB.dbcon.NewQuery(replacetext(idquery, "{POLLID}", pollid))
|
||||
if(!query.Execute())
|
||||
var/err = query.ErrorMsg()
|
||||
create_poll_window("<font color='red'>An SQL error has occured while creating your poll</font>")
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/var/create_turf_html = null
|
||||
GLOBAL_VAR(create_turf_html)
|
||||
/datum/admins/proc/create_turf(var/mob/user)
|
||||
if(!create_turf_html)
|
||||
if(!GLOB.create_turf_html)
|
||||
var/turfjs = null
|
||||
turfjs = jointext(typesof(/turf), ";")
|
||||
create_turf_html = file2text('html/create_object.html')
|
||||
create_turf_html = replacetext(create_turf_html, "null /* object types */", "\"[turfjs]\"")
|
||||
GLOB.create_turf_html = file2text('html/create_object.html')
|
||||
GLOB.create_turf_html = replacetext(GLOB.create_turf_html, "null /* object types */", "\"[turfjs]\"")
|
||||
|
||||
user << browse(replacetext(create_turf_html, "/* ref src */", UID()), "window=create_turf;size=425x475")
|
||||
user << browse(replacetext(GLOB.create_turf_html, "/* ref src */", UID()), "window=create_turf;size=425x475")
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
var/list/admin_datums = list()
|
||||
GLOBAL_LIST_EMPTY(admin_datums)
|
||||
GLOBAL_PROTECT(admin_datums) // This is protected because we dont want people making their own admin ranks, for obvious reasons
|
||||
|
||||
/datum/admins
|
||||
var/rank = "Temporary Admin"
|
||||
@@ -22,7 +23,7 @@ var/list/admin_datums = list()
|
||||
admincaster_signature = "Nanotrasen Officer #[rand(0,9)][rand(0,9)][rand(0,9)]"
|
||||
rank = initial_rank
|
||||
rights = initial_rights
|
||||
admin_datums[ckey] = src
|
||||
GLOB.admin_datums[ckey] = src
|
||||
|
||||
/datum/admins/Destroy()
|
||||
..()
|
||||
@@ -87,7 +88,7 @@ you will have to do something like if(client.holder.rights & R_ADMIN) yourself.
|
||||
return 0
|
||||
|
||||
/client/proc/deadmin()
|
||||
admin_datums -= ckey
|
||||
GLOB.admin_datums -= ckey
|
||||
if(holder)
|
||||
holder.disassociate()
|
||||
qdel(holder)
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
cachedintel.cache = TRUE
|
||||
return cachedintel
|
||||
|
||||
if(dbcon.IsConnected())
|
||||
if(GLOB.dbcon.IsConnected())
|
||||
var/rating_bad = config.ipintel_rating_bad
|
||||
var/DBQuery/query_get_ip_intel = dbcon.NewQuery({"
|
||||
var/DBQuery/query_get_ip_intel = GLOB.dbcon.NewQuery({"
|
||||
SELECT date, intel, TIMESTAMPDIFF(MINUTE,date,NOW())
|
||||
FROM [format_table_name("ipintel")]
|
||||
WHERE
|
||||
@@ -67,8 +67,8 @@
|
||||
res.intel = ip_intel_query(ip)
|
||||
if(updatecache && res.intel >= 0)
|
||||
SSipintel.cache[ip] = res
|
||||
if(dbcon.IsConnected())
|
||||
var/DBQuery/query_add_ip_intel = dbcon.NewQuery("INSERT INTO [format_table_name("ipintel")] (ip, intel) VALUES (INET_ATON('[ip]'), [res.intel]) ON DUPLICATE KEY UPDATE intel = VALUES(intel), date = NOW()")
|
||||
if(GLOB.dbcon.IsConnected())
|
||||
var/DBQuery/query_add_ip_intel = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("ipintel")] (ip, intel) VALUES (INET_ATON('[ip]'), [res.intel]) ON DUPLICATE KEY UPDATE intel = VALUES(intel), date = NOW()")
|
||||
query_add_ip_intel.Execute()
|
||||
qdel(query_add_ip_intel)
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
return FALSE
|
||||
if(!config.ipintel_whitelist)
|
||||
return FALSE
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
return FALSE
|
||||
if(!ipintel_badip_check(t_ip))
|
||||
return FALSE
|
||||
@@ -160,7 +160,7 @@
|
||||
rating_bad = sanitizeSQL(rating_bad)
|
||||
valid_hours = sanitizeSQL(valid_hours)
|
||||
var/check_sql = {"SELECT * FROM [format_table_name("ipintel")] WHERE ip = INET_ATON('[target_ip]') AND intel >= [rating_bad] AND (date + INTERVAL [valid_hours] HOUR) > NOW()"}
|
||||
var/DBQuery/query_get_ip_intel = dbcon.NewQuery(check_sql)
|
||||
var/DBQuery/query_get_ip_intel = GLOB.dbcon.NewQuery(check_sql)
|
||||
if(!query_get_ip_intel.Execute())
|
||||
log_debug("ipintel_badip_check reports failed query execution")
|
||||
qdel(query_get_ip_intel)
|
||||
@@ -175,7 +175,7 @@
|
||||
if(!config.ipintel_whitelist)
|
||||
return FALSE
|
||||
var/target_sql_ckey = ckey(target_ckey)
|
||||
var/DBQuery/query_whitelist_check = dbcon.NewQuery("SELECT * FROM [format_table_name("vpn_whitelist")] WHERE ckey = '[target_sql_ckey]'")
|
||||
var/DBQuery/query_whitelist_check = GLOB.dbcon.NewQuery("SELECT * FROM [format_table_name("vpn_whitelist")] WHERE ckey = '[target_sql_ckey]'")
|
||||
if(!query_whitelist_check.Execute())
|
||||
var/err = query_whitelist_check.ErrorMsg()
|
||||
log_debug("SQL ERROR on proc/vpn_whitelist_check for ckey '[target_sql_ckey]'. Error : \[[err]\]\n")
|
||||
@@ -190,7 +190,7 @@
|
||||
if(!reason_string)
|
||||
return FALSE
|
||||
reason_string = sanitizeSQL(reason_string)
|
||||
var/DBQuery/query_whitelist_add = dbcon.NewQuery("INSERT INTO [format_table_name("vpn_whitelist")] (ckey,reason) VALUES ('[target_sql_ckey]','[reason_string]')")
|
||||
var/DBQuery/query_whitelist_add = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("vpn_whitelist")] (ckey,reason) VALUES ('[target_sql_ckey]','[reason_string]')")
|
||||
if(!query_whitelist_add.Execute())
|
||||
var/err = query_whitelist_add.ErrorMsg()
|
||||
log_debug("SQL ERROR on proc/vpn_whitelist_add for ckey '[target_sql_ckey]'. Error : \[[err]\]\n")
|
||||
@@ -199,7 +199,7 @@
|
||||
|
||||
/proc/vpn_whitelist_remove(target_ckey)
|
||||
var/target_sql_ckey = ckey(target_ckey)
|
||||
var/DBQuery/query_whitelist_remove = dbcon.NewQuery("DELETE FROM [format_table_name("vpn_whitelist")] WHERE ckey = '[target_sql_ckey]'")
|
||||
var/DBQuery/query_whitelist_remove = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("vpn_whitelist")] WHERE ckey = '[target_sql_ckey]'")
|
||||
if(!query_whitelist_remove.Execute())
|
||||
var/err = query_whitelist_remove.ErrorMsg()
|
||||
log_debug("SQL ERROR on proc/vpn_whitelist_remove for ckey '[target_sql_ckey]'. Error : \[[err]\]\n")
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
</tr>
|
||||
"}
|
||||
|
||||
for(var/adm_ckey in admin_datums)
|
||||
var/datum/admins/D = admin_datums[adm_ckey]
|
||||
for(var/adm_ckey in GLOB.admin_datums)
|
||||
var/datum/admins/D = GLOB.admin_datums[adm_ckey]
|
||||
if(!D) continue
|
||||
var/rank = D.rank ? D.rank : "*none*"
|
||||
var/rights = rights2text(D.rights," ")
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
establish_db_connection()
|
||||
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
to_chat(usr, "<span class='warning'>Failed to establish database connection</span>")
|
||||
return
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
if(!istext(adm_ckey) || !istext(new_rank))
|
||||
return
|
||||
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT id FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'")
|
||||
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'")
|
||||
select_query.Execute()
|
||||
|
||||
var/new_admin = 1
|
||||
@@ -88,16 +88,16 @@
|
||||
|
||||
flag_account_for_forum_sync(adm_ckey)
|
||||
if(new_admin)
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO [format_table_name("admin")] (`id`, `ckey`, `rank`, `level`, `flags`) VALUES (null, '[adm_ckey]', '[new_rank]', -1, 0)")
|
||||
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("admin")] (`id`, `ckey`, `rank`, `level`, `flags`) VALUES (null, '[adm_ckey]', '[new_rank]', -1, 0)")
|
||||
insert_query.Execute()
|
||||
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Added new admin [adm_ckey] to rank [new_rank]');")
|
||||
var/DBQuery/log_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Added new admin [adm_ckey] to rank [new_rank]');")
|
||||
log_query.Execute()
|
||||
to_chat(usr, "<span class='notice'>New admin added.</span>")
|
||||
else
|
||||
if(!isnull(admin_id) && isnum(admin_id))
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE [format_table_name("admin")] SET rank = '[new_rank]' WHERE id = [admin_id]")
|
||||
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("admin")] SET rank = '[new_rank]' WHERE id = [admin_id]")
|
||||
insert_query.Execute()
|
||||
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Edited the rank of [adm_ckey] to [new_rank]');")
|
||||
var/DBQuery/log_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Edited the rank of [adm_ckey] to [new_rank]');")
|
||||
log_query.Execute()
|
||||
to_chat(usr, "<span class='notice'>Admin rank changed.</span>")
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
return
|
||||
|
||||
establish_db_connection()
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
to_chat(usr, "<span class='warning'>Failed to establish database connection</span>")
|
||||
return
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
if(!istext(adm_ckey) || !isnum(new_permission))
|
||||
return
|
||||
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, flags FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'")
|
||||
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT id, flags FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'")
|
||||
select_query.Execute()
|
||||
|
||||
var/admin_id
|
||||
@@ -144,27 +144,27 @@
|
||||
|
||||
flag_account_for_forum_sync(adm_ckey)
|
||||
if(admin_rights & new_permission) //This admin already has this permission, so we are removing it.
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE [format_table_name("admin")] SET flags = [admin_rights & ~new_permission] WHERE id = [admin_id]")
|
||||
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("admin")] SET flags = [admin_rights & ~new_permission] WHERE id = [admin_id]")
|
||||
insert_query.Execute()
|
||||
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Removed permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]');")
|
||||
var/DBQuery/log_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Removed permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]');")
|
||||
log_query.Execute()
|
||||
to_chat(usr, "<span class='notice'>Permission removed.</span>")
|
||||
else //This admin doesn't have this permission, so we are adding it.
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE [format_table_name("admin")] SET flags = '[admin_rights | new_permission]' WHERE id = [admin_id]")
|
||||
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("admin")] SET flags = '[admin_rights | new_permission]' WHERE id = [admin_id]")
|
||||
insert_query.Execute()
|
||||
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Added permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]')")
|
||||
var/DBQuery/log_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Added permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]')")
|
||||
log_query.Execute()
|
||||
to_chat(usr, "<span class='notice'>Permission added.</span>")
|
||||
|
||||
/datum/admins/proc/updateranktodb(ckey,newrank)
|
||||
establish_db_connection()
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
return
|
||||
if(!check_rights(R_PERMISSIONS))
|
||||
return
|
||||
var/sql_ckey = sanitizeSQL(ckey)
|
||||
var/sql_admin_rank = sanitizeSQL(newrank)
|
||||
|
||||
var/DBQuery/query_update = dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastadminrank = '[sql_admin_rank]' WHERE ckey = '[sql_ckey]'")
|
||||
var/DBQuery/query_update = GLOB.dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastadminrank = '[sql_admin_rank]' WHERE ckey = '[sql_ckey]'")
|
||||
query_update.Execute()
|
||||
flag_account_for_forum_sync(sql_ckey)
|
||||
|
||||
@@ -465,7 +465,7 @@
|
||||
if(GAMEMODE_IS_BLOB)
|
||||
var/datum/game_mode/blob/mode = SSticker.mode
|
||||
dat += "<br><table cellspacing=5><tr><td><B>Blob</B></td><td></td><td></td></tr>"
|
||||
dat += "<tr><td><i>Progress: [blobs.len]/[mode.blobwincount]</i></td></tr>"
|
||||
dat += "<tr><td><i>Progress: [GLOB.blobs.len]/[mode.blobwincount]</i></td></tr>"
|
||||
|
||||
for(var/datum/mind/blob in mode.infected_crew)
|
||||
var/mob/M = blob.current
|
||||
@@ -475,7 +475,7 @@
|
||||
else
|
||||
dat += "<tr><td><i>Blob not found!</i></td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
|
||||
if(SSticker.mode.blob_overminds.len)
|
||||
dat += check_role_table("Blob Overminds", SSticker.mode.blob_overminds)
|
||||
|
||||
@@ -541,9 +541,9 @@
|
||||
if(SSticker.mode.eventmiscs.len)
|
||||
dat += check_role_table("Event Roles", SSticker.mode.eventmiscs)
|
||||
|
||||
if(ts_spiderlist.len)
|
||||
if(GLOB.ts_spiderlist.len)
|
||||
var/list/spider_minds = list()
|
||||
for(var/mob/living/simple_animal/hostile/poison/terror_spider/S in ts_spiderlist)
|
||||
for(var/mob/living/simple_animal/hostile/poison/terror_spider/S in GLOB.ts_spiderlist)
|
||||
if(S.ckey)
|
||||
spider_minds += S.mind
|
||||
if(spider_minds.len)
|
||||
@@ -551,10 +551,10 @@
|
||||
|
||||
var/count_eggs = 0
|
||||
var/count_spiderlings = 0
|
||||
for(var/obj/structure/spider/eggcluster/terror_eggcluster/E in ts_egg_list)
|
||||
for(var/obj/structure/spider/eggcluster/terror_eggcluster/E in GLOB.ts_egg_list)
|
||||
if(is_station_level(E.z))
|
||||
count_eggs += E.spiderling_number
|
||||
for(var/obj/structure/spider/spiderling/terror_spiderling/L in ts_spiderling_list)
|
||||
for(var/obj/structure/spider/spiderling/terror_spiderling/L in GLOB.ts_spiderling_list)
|
||||
if(!L.stillborn && is_station_level(L.z))
|
||||
count_spiderlings += 1
|
||||
dat += "<table cellspacing=5><TR><TD>Growing TS on-station: [count_eggs] egg[count_eggs != 1 ? "s" : ""], [count_spiderlings] spiderling[count_spiderlings != 1 ? "s" : ""]. </TD></TR></TABLE>"
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
<B>Bombs</b><br>
|
||||
[check_rights(R_SERVER, 0) ? " <A href='?src=[UID()];secretsfun=togglebombcap'>Toggle bomb cap</A><br>" : "<br>"]
|
||||
<B>Lists</b><br>
|
||||
<A href='?src=[UID()];secretsadmin=list_signalers'>Show last [length(lastsignalers)] signalers</A>
|
||||
<A href='?src=[UID()];secretsadmin=list_lawchanges'>Show last [length(lawchanges)] law changes</A><BR>
|
||||
<A href='?src=[UID()];secretsadmin=list_signalers'>Show last [length(GLOB.lastsignalers)] signalers</A>
|
||||
<A href='?src=[UID()];secretsadmin=list_lawchanges'>Show last [length(GLOB.lawchanges)] law changes</A><BR>
|
||||
<A href='?src=[UID()];secretsadmin=DNA'>List DNA (Blood)</A>
|
||||
<A href='?src=[UID()];secretsadmin=fingerprints'>List Fingerprints</A><BR>
|
||||
<B>Power</b><br>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/proc/add_note(target_ckey, notetext, timestamp, adminckey, logged = 1, server, checkrights = 1)
|
||||
if(checkrights && !check_rights(R_ADMIN|R_MOD))
|
||||
return
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
else
|
||||
target_ckey = ckey(target_ckey)
|
||||
|
||||
var/DBQuery/query_find_ckey = dbcon.NewQuery("SELECT ckey, exp FROM [format_table_name("player")] WHERE ckey = '[target_ckey]'")
|
||||
var/DBQuery/query_find_ckey = GLOB.dbcon.NewQuery("SELECT ckey, exp FROM [format_table_name("player")] WHERE ckey = '[target_ckey]'")
|
||||
if(!query_find_ckey.Execute())
|
||||
var/err = query_find_ckey.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining ckey from player table. Error : \[[err]\]\n")
|
||||
@@ -46,7 +46,7 @@
|
||||
if(config && config.server_name)
|
||||
server = config.server_name
|
||||
server = sanitizeSQL(server)
|
||||
var/DBQuery/query_noteadd = dbcon.NewQuery("INSERT INTO [format_table_name("notes")] (ckey, timestamp, notetext, adminckey, server, crew_playtime) VALUES ('[target_ckey]', '[timestamp]', '[notetext]', '[admin_sql_ckey]', '[server]', '[crew_number]')")
|
||||
var/DBQuery/query_noteadd = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("notes")] (ckey, timestamp, notetext, adminckey, server, crew_playtime) VALUES ('[target_ckey]', '[timestamp]', '[notetext]', '[admin_sql_ckey]', '[server]', '[crew_number]')")
|
||||
if(!query_noteadd.Execute())
|
||||
var/err = query_noteadd.ErrorMsg()
|
||||
log_game("SQL ERROR adding new note to table. Error : \[[err]\]\n")
|
||||
@@ -62,13 +62,13 @@
|
||||
var/ckey
|
||||
var/notetext
|
||||
var/adminckey
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
if(!note_id)
|
||||
return
|
||||
note_id = text2num(note_id)
|
||||
var/DBQuery/query_find_note_del = dbcon.NewQuery("SELECT ckey, notetext, adminckey FROM [format_table_name("notes")] WHERE id = [note_id]")
|
||||
var/DBQuery/query_find_note_del = GLOB.dbcon.NewQuery("SELECT ckey, notetext, adminckey FROM [format_table_name("notes")] WHERE id = [note_id]")
|
||||
if(!query_find_note_del.Execute())
|
||||
var/err = query_find_note_del.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining ckey, notetext, adminckey from player table. Error : \[[err]\]\n")
|
||||
@@ -77,7 +77,7 @@
|
||||
ckey = query_find_note_del.item[1]
|
||||
notetext = query_find_note_del.item[2]
|
||||
adminckey = query_find_note_del.item[3]
|
||||
var/DBQuery/query_del_note = dbcon.NewQuery("DELETE FROM [format_table_name("notes")] WHERE id = [note_id]")
|
||||
var/DBQuery/query_del_note = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("notes")] WHERE id = [note_id]")
|
||||
if(!query_del_note.Execute())
|
||||
var/err = query_del_note.ErrorMsg()
|
||||
log_game("SQL ERROR removing note from table. Error : \[[err]\]\n")
|
||||
@@ -89,7 +89,7 @@
|
||||
/proc/edit_note(note_id)
|
||||
if(!check_rights(R_ADMIN|R_MOD))
|
||||
return
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
if(!note_id)
|
||||
@@ -97,7 +97,7 @@
|
||||
note_id = text2num(note_id)
|
||||
var/target_ckey
|
||||
var/sql_ckey = usr.ckey
|
||||
var/DBQuery/query_find_note_edit = dbcon.NewQuery("SELECT ckey, notetext, adminckey FROM [format_table_name("notes")] WHERE id = [note_id]")
|
||||
var/DBQuery/query_find_note_edit = GLOB.dbcon.NewQuery("SELECT ckey, notetext, adminckey FROM [format_table_name("notes")] WHERE id = [note_id]")
|
||||
if(!query_find_note_edit.Execute())
|
||||
var/err = query_find_note_edit.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining notetext from notes table. Error : \[[err]\]\n")
|
||||
@@ -112,7 +112,7 @@
|
||||
new_note = sanitizeSQL(new_note)
|
||||
var/edit_text = "Edited by [sql_ckey] on [SQLtime()] from \"[old_note]\" to \"[new_note]\"<hr>"
|
||||
edit_text = sanitizeSQL(edit_text)
|
||||
var/DBQuery/query_update_note = dbcon.NewQuery("UPDATE [format_table_name("notes")] SET notetext = '[new_note]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE id = [note_id]")
|
||||
var/DBQuery/query_update_note = GLOB.dbcon.NewQuery("UPDATE [format_table_name("notes")] SET notetext = '[new_note]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE id = [note_id]")
|
||||
if(!query_update_note.Execute())
|
||||
var/err = query_update_note.ErrorMsg()
|
||||
log_game("SQL ERROR editing note. Error : \[[err]\]\n")
|
||||
@@ -139,7 +139,7 @@
|
||||
output = navbar
|
||||
if(target_ckey)
|
||||
var/target_sql_ckey = ckey(target_ckey)
|
||||
var/DBQuery/query_get_notes = dbcon.NewQuery("SELECT id, timestamp, notetext, adminckey, last_editor, server, crew_playtime FROM [format_table_name("notes")] WHERE ckey = '[target_sql_ckey]' ORDER BY timestamp")
|
||||
var/DBQuery/query_get_notes = GLOB.dbcon.NewQuery("SELECT id, timestamp, notetext, adminckey, last_editor, server, crew_playtime FROM [format_table_name("notes")] WHERE ckey = '[target_sql_ckey]' ORDER BY timestamp")
|
||||
if(!query_get_notes.Execute())
|
||||
var/err = query_get_notes.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining ckey, notetext, adminckey, last_editor, server, crew_playtime from notes table. Error : \[[err]\]\n")
|
||||
@@ -181,7 +181,7 @@
|
||||
search = "^\[^\[:alpha:\]\]"
|
||||
else
|
||||
search = "^[index]"
|
||||
var/DBQuery/query_list_notes = dbcon.NewQuery("SELECT DISTINCT ckey FROM [format_table_name("notes")] WHERE ckey REGEXP '[search]' ORDER BY ckey")
|
||||
var/DBQuery/query_list_notes = GLOB.dbcon.NewQuery("SELECT DISTINCT ckey FROM [format_table_name("notes")] WHERE ckey REGEXP '[search]' ORDER BY ckey")
|
||||
if(!query_list_notes.Execute())
|
||||
var/err = query_list_notes.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining ckey from notes table. Error : \[[err]\]\n")
|
||||
@@ -196,7 +196,7 @@
|
||||
|
||||
/proc/show_player_info_irc(var/key as text)
|
||||
var/target_sql_ckey = ckey(key)
|
||||
var/DBQuery/query_get_notes = dbcon.NewQuery("SELECT timestamp, notetext, adminckey, server, crew_playtime FROM [format_table_name("notes")] WHERE ckey = '[target_sql_ckey]' ORDER BY timestamp")
|
||||
var/DBQuery/query_get_notes = GLOB.dbcon.NewQuery("SELECT timestamp, notetext, adminckey, server, crew_playtime FROM [format_table_name("notes")] WHERE ckey = '[target_sql_ckey]' ORDER BY timestamp")
|
||||
if(!query_get_notes.Execute())
|
||||
var/err = query_get_notes.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining timestamp, notetext, adminckey, server, crew_playtime from notes table. Error : \[[err]\]\n")
|
||||
|
||||
+133
-132
@@ -183,7 +183,7 @@
|
||||
if(task == "add")
|
||||
var/new_ckey = ckey(clean_input("New admin's ckey","Admin ckey", null))
|
||||
if(!new_ckey) return
|
||||
if(new_ckey in admin_datums)
|
||||
if(new_ckey in GLOB.admin_datums)
|
||||
to_chat(usr, "<font color='red'>Error: Topic 'editrights': [new_ckey] is already an admin</font>")
|
||||
return
|
||||
adm_ckey = new_ckey
|
||||
@@ -194,12 +194,12 @@
|
||||
to_chat(usr, "<font color='red'>Error: Topic 'editrights': No valid ckey</font>")
|
||||
return
|
||||
|
||||
var/datum/admins/D = admin_datums[adm_ckey]
|
||||
var/datum/admins/D = GLOB.admin_datums[adm_ckey]
|
||||
|
||||
if(task == "remove")
|
||||
if(alert("Are you sure you want to remove [adm_ckey]?","Message","Yes","Cancel") == "Yes")
|
||||
if(!D) return
|
||||
admin_datums -= adm_ckey
|
||||
GLOB.admin_datums -= adm_ckey
|
||||
D.disassociate()
|
||||
|
||||
updateranktodb(adm_ckey, "player")
|
||||
@@ -209,8 +209,8 @@
|
||||
|
||||
else if(task == "rank")
|
||||
var/new_rank
|
||||
if(admin_ranks.len)
|
||||
new_rank = input("Please select a rank", "New rank", null, null) as null|anything in (admin_ranks|"*New Rank*")
|
||||
if(GLOB.admin_ranks.len)
|
||||
new_rank = input("Please select a rank", "New rank", null, null) as null|anything in (GLOB.admin_ranks|"*New Rank*")
|
||||
else
|
||||
new_rank = input("Please select a rank", "New rank", null, null) as null|anything in list("Mentor", "Trial Admin", "Game Admin", "*New Rank*")
|
||||
|
||||
@@ -227,15 +227,15 @@
|
||||
to_chat(usr, "<font color='red'>Error: Topic 'editrights': Invalid rank</font>")
|
||||
return
|
||||
if(config.admin_legacy_system)
|
||||
if(admin_ranks.len)
|
||||
if(new_rank in admin_ranks)
|
||||
rights = admin_ranks[new_rank] //we typed a rank which already exists, use its rights
|
||||
if(GLOB.admin_ranks.len)
|
||||
if(new_rank in GLOB.admin_ranks)
|
||||
rights = GLOB.admin_ranks[new_rank] //we typed a rank which already exists, use its rights
|
||||
else
|
||||
admin_ranks[new_rank] = 0 //add the new rank to admin_ranks
|
||||
GLOB.admin_ranks[new_rank] = 0 //add the new rank to admin_ranks
|
||||
else
|
||||
if(config.admin_legacy_system)
|
||||
new_rank = ckeyEx(new_rank)
|
||||
rights = admin_ranks[new_rank] //we input an existing rank, use its rights
|
||||
rights = GLOB.admin_ranks[new_rank] //we input an existing rank, use its rights
|
||||
|
||||
if(D)
|
||||
D.disassociate() //remove adminverbs and unlink from client
|
||||
@@ -308,7 +308,7 @@
|
||||
var/timer = input("Enter new shuttle duration (seconds):","Edit Shuttle Timeleft", SSshuttle.emergency.timeLeft() ) as num
|
||||
SSshuttle.emergency.setTimer(timer*10)
|
||||
log_admin("[key_name(usr)] edited the Emergency Shuttle's timeleft to [timer] seconds")
|
||||
minor_announcement.Announce("The emergency shuttle will reach its destination in [round(SSshuttle.emergency.timeLeft(600))] minutes.")
|
||||
GLOB.minor_announcement.Announce("The emergency shuttle will reach its destination in [round(SSshuttle.emergency.timeLeft(600))] minutes.")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] edited the Emergency Shuttle's timeleft to [timer] seconds</span>")
|
||||
href_list["secrets"] = "check_antagonist"
|
||||
|
||||
@@ -369,8 +369,8 @@
|
||||
if(!check_rights(R_BAN)) return
|
||||
|
||||
var/banfolder = href_list["unbanf"]
|
||||
Banlist.cd = "/base/[banfolder]"
|
||||
var/key = Banlist["key"]
|
||||
GLOB.banlist_savefile.cd = "/base/[banfolder]"
|
||||
var/key = GLOB.banlist_savefile["key"]
|
||||
if(alert(usr, "Are you sure you want to unban [key]?", "Confirmation", "Yes", "No") == "Yes")
|
||||
if(RemoveBan(banfolder))
|
||||
unbanpanel()
|
||||
@@ -388,14 +388,14 @@
|
||||
var/reason
|
||||
|
||||
var/banfolder = href_list["unbane"]
|
||||
Banlist.cd = "/base/[banfolder]"
|
||||
var/reason2 = Banlist["reason"]
|
||||
var/temp = Banlist["temp"]
|
||||
GLOB.banlist_savefile.cd = "/base/[banfolder]"
|
||||
var/reason2 = GLOB.banlist_savefile["reason"]
|
||||
var/temp = GLOB.banlist_savefile["temp"]
|
||||
|
||||
var/minutes = Banlist["minutes"]
|
||||
var/minutes = GLOB.banlist_savefile["minutes"]
|
||||
|
||||
var/banned_key = Banlist["key"]
|
||||
Banlist.cd = "/base"
|
||||
var/banned_key = GLOB.banlist_savefile["key"]
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
|
||||
var/duration
|
||||
|
||||
@@ -403,12 +403,12 @@
|
||||
if("Yes")
|
||||
temp = 1
|
||||
var/mins = 0
|
||||
if(minutes > CMinutes)
|
||||
mins = minutes - CMinutes
|
||||
if(minutes > GLOB.CMinutes)
|
||||
mins = minutes - GLOB.CMinutes
|
||||
mins = input(usr,"How long (in minutes)? (Default: 1440)","Ban time",mins ? mins : 1440) as num|null
|
||||
if(!mins) return
|
||||
mins = min(525599,mins)
|
||||
minutes = CMinutes + mins
|
||||
minutes = GLOB.CMinutes + mins
|
||||
duration = GetExp(minutes)
|
||||
reason = input(usr,"Please state the reason","Reason",reason2) as message|null
|
||||
if(!reason) return
|
||||
@@ -421,12 +421,12 @@
|
||||
log_admin("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]")
|
||||
ban_unban_log_save("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]")
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]</span>", 1)
|
||||
Banlist.cd = "/base/[banfolder]"
|
||||
to_chat(Banlist["reason"], reason)
|
||||
to_chat(Banlist["temp"], temp)
|
||||
to_chat(Banlist["minutes"], minutes)
|
||||
to_chat(Banlist["bannedby"], usr.ckey)
|
||||
Banlist.cd = "/base"
|
||||
GLOB.banlist_savefile.cd = "/base/[banfolder]"
|
||||
to_chat(GLOB.banlist_savefile["reason"], reason)
|
||||
to_chat(GLOB.banlist_savefile["temp"], temp)
|
||||
to_chat(GLOB.banlist_savefile["minutes"], minutes)
|
||||
to_chat(GLOB.banlist_savefile["bannedby"], usr.ckey)
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
feedback_inc("ban_edit",1)
|
||||
unbanpanel()
|
||||
|
||||
@@ -512,8 +512,8 @@
|
||||
//Regular jobs
|
||||
//Command (Blue)
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr align='center' bgcolor='ccccff'><th colspan='[length(command_positions)]'><a href='?src=[UID()];jobban3=commanddept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Command Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in command_positions)
|
||||
jobs += "<tr align='center' bgcolor='ccccff'><th colspan='[length(GLOB.command_positions)]'><a href='?src=[UID()];jobban3=commanddept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Command Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in GLOB.command_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
@@ -533,8 +533,8 @@
|
||||
//Security (Red)
|
||||
counter = 0
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='ffddf0'><th colspan='[length(security_positions)]'><a href='?src=[UID()];jobban3=securitydept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Security Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in security_positions)
|
||||
jobs += "<tr bgcolor='ffddf0'><th colspan='[length(GLOB.security_positions)]'><a href='?src=[UID()];jobban3=securitydept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Security Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in GLOB.security_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
@@ -554,8 +554,8 @@
|
||||
//Engineering (Yellow)
|
||||
counter = 0
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='fff5cc'><th colspan='[length(engineering_positions)]'><a href='?src=[UID()];jobban3=engineeringdept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Engineering Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in engineering_positions)
|
||||
jobs += "<tr bgcolor='fff5cc'><th colspan='[length(GLOB.engineering_positions)]'><a href='?src=[UID()];jobban3=engineeringdept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Engineering Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in GLOB.engineering_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
@@ -575,8 +575,8 @@
|
||||
//Medical (White)
|
||||
counter = 0
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='ffeef0'><th colspan='[length(medical_positions)]'><a href='?src=[UID()];jobban3=medicaldept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Medical Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in medical_positions)
|
||||
jobs += "<tr bgcolor='ffeef0'><th colspan='[length(GLOB.medical_positions)]'><a href='?src=[UID()];jobban3=medicaldept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Medical Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in GLOB.medical_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
@@ -596,8 +596,8 @@
|
||||
//Science (Purple)
|
||||
counter = 0
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='e79fff'><th colspan='[length(science_positions)]'><a href='?src=[UID()];jobban3=sciencedept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Science Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in science_positions)
|
||||
jobs += "<tr bgcolor='e79fff'><th colspan='[length(GLOB.science_positions)]'><a href='?src=[UID()];jobban3=sciencedept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Science Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in GLOB.science_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
@@ -617,8 +617,8 @@
|
||||
//Support (Grey)
|
||||
counter = 0
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='dddddd'><th colspan='[length(support_positions)]'><a href='?src=[UID()];jobban3=supportdept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Support Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in support_positions)
|
||||
jobs += "<tr bgcolor='dddddd'><th colspan='[length(GLOB.support_positions)]'><a href='?src=[UID()];jobban3=supportdept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Support Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in GLOB.support_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
@@ -638,8 +638,8 @@
|
||||
//Non-Human (Green)
|
||||
counter = 0
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='ccffcc'><th colspan='[length(nonhuman_positions)+1]'><a href='?src=[UID()];jobban3=nonhumandept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Non-human Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in nonhuman_positions)
|
||||
jobs += "<tr bgcolor='ccffcc'><th colspan='[length(GLOB.nonhuman_positions)+1]'><a href='?src=[UID()];jobban3=nonhumandept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Non-human Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in GLOB.nonhuman_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
@@ -675,7 +675,7 @@
|
||||
jobs += "<tr bgcolor='ffeeaa'><th colspan='10'><a href='?src=[UID()];jobban3=Syndicate;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Antagonist Positions</a></th></tr><tr align='center'>"
|
||||
|
||||
counter = 0
|
||||
for(var/role in antag_roles)
|
||||
for(var/role in GLOB.antag_roles)
|
||||
if(jobban_isbanned(M, role) || isbanned_dept)
|
||||
jobs += "<td width='20%'><a href='?src=[UID()];jobban3=[role];jobban4=[M.UID()];dbbanaddckey=[M.ckey]'><font color=red>[replacetext(role, " ", " ")]</font></a></td>"
|
||||
else
|
||||
@@ -692,7 +692,7 @@
|
||||
jobs += "<tr bgcolor='ccccff'><th colspan='10'>Other</th></tr><tr align='center'>"
|
||||
|
||||
counter = 0
|
||||
for(var/role in other_roles)
|
||||
for(var/role in GLOB.other_roles)
|
||||
if(jobban_isbanned(M, role) || isbanned_dept)
|
||||
jobs += "<td width='20%'><a href='?src=[UID()];jobban3=[role];jobban4=[M.UID()];dbbanaddckey=[M.ckey]'><font color=red>[replacetext(role, " ", " ")]</font></a></td>"
|
||||
else
|
||||
@@ -707,8 +707,8 @@
|
||||
//Whitelisted positions
|
||||
counter = 0
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='dddddd'><th colspan='[length(whitelisted_positions)]'><a href='?src=[UID()];jobban3=whitelistdept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Whitelisted Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in whitelisted_positions)
|
||||
jobs += "<tr bgcolor='dddddd'><th colspan='[length(GLOB.whitelisted_positions)]'><a href='?src=[UID()];jobban3=whitelistdept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Whitelisted Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in GLOB.whitelisted_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
@@ -754,50 +754,50 @@
|
||||
var/list/joblist = list()
|
||||
switch(href_list["jobban3"])
|
||||
if("commanddept")
|
||||
for(var/jobPos in command_positions)
|
||||
for(var/jobPos in GLOB.command_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("securitydept")
|
||||
for(var/jobPos in security_positions)
|
||||
for(var/jobPos in GLOB.security_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("engineeringdept")
|
||||
for(var/jobPos in engineering_positions)
|
||||
for(var/jobPos in GLOB.engineering_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("medicaldept")
|
||||
for(var/jobPos in medical_positions)
|
||||
for(var/jobPos in GLOB.medical_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("sciencedept")
|
||||
for(var/jobPos in science_positions)
|
||||
for(var/jobPos in GLOB.science_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("supportdept")
|
||||
for(var/jobPos in support_positions)
|
||||
for(var/jobPos in GLOB.support_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("nonhumandept")
|
||||
joblist += "pAI"
|
||||
for(var/jobPos in nonhuman_positions)
|
||||
for(var/jobPos in GLOB.nonhuman_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("whitelistdept")
|
||||
for(var/jobPos in whitelisted_positions)
|
||||
for(var/jobPos in GLOB.whitelisted_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
@@ -953,7 +953,7 @@
|
||||
|
||||
else if(href_list["noteedits"])
|
||||
var/note_id = sanitizeSQL("[href_list["noteedits"]]")
|
||||
var/DBQuery/query_noteedits = dbcon.NewQuery("SELECT edits FROM [format_table_name("notes")] WHERE id = '[note_id]'")
|
||||
var/DBQuery/query_noteedits = GLOB.dbcon.NewQuery("SELECT edits FROM [format_table_name("notes")] WHERE id = '[note_id]'")
|
||||
if(!query_noteedits.Execute())
|
||||
var/err = query_noteedits.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining edits from notes table. Error : \[[err]\]\n")
|
||||
@@ -1073,7 +1073,7 @@
|
||||
|
||||
else if(href_list["watcheditlog"])
|
||||
var/target_ckey = sanitizeSQL("[href_list["watcheditlog"]]")
|
||||
var/DBQuery/query_watchedits = dbcon.NewQuery("SELECT edits FROM [format_table_name("watch")] WHERE ckey = '[target_ckey]'")
|
||||
var/DBQuery/query_watchedits = GLOB.dbcon.NewQuery("SELECT edits FROM [format_table_name("watch")] WHERE ckey = '[target_ckey]'")
|
||||
if(!query_watchedits.Execute())
|
||||
var/err = query_watchedits.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining edits from watch table. Error : \[[err]\]\n")
|
||||
@@ -1106,7 +1106,7 @@
|
||||
dat += {"<A href='?src=[UID()];c_mode2=[mode]'>[config.mode_names[mode]]</A><br>"}
|
||||
dat += {"<A href='?src=[UID()];c_mode2=secret'>Secret</A><br>"}
|
||||
dat += {"<A href='?src=[UID()];c_mode2=random'>Random</A><br>"}
|
||||
dat += {"Now: [master_mode]"}
|
||||
dat += {"Now: [GLOB.master_mode]"}
|
||||
usr << browse(dat, "window=c_mode")
|
||||
|
||||
else if(href_list["f_secret"])
|
||||
@@ -1114,13 +1114,13 @@
|
||||
|
||||
if(SSticker && SSticker.mode)
|
||||
return alert(usr, "The game has already started.", null, null, null, null)
|
||||
if(master_mode != "secret")
|
||||
if(GLOB.master_mode != "secret")
|
||||
return alert(usr, "The game mode has to be secret!", null, null, null, null)
|
||||
var/dat = {"<B>What game mode do you want to force secret to be? Use this if you want to change the game mode, but want the players to believe it's secret. This will only work if the current game mode is secret.</B><HR>"}
|
||||
for(var/mode in config.modes)
|
||||
dat += {"<A href='?src=[UID()];f_secret2=[mode]'>[config.mode_names[mode]]</A><br>"}
|
||||
dat += {"<A href='?src=[UID()];f_secret2=secret'>Random (default)</A><br>"}
|
||||
dat += {"Now: [secret_force_mode]"}
|
||||
dat += {"Now: [GLOB.secret_force_mode]"}
|
||||
usr << browse(dat, "window=f_secret")
|
||||
|
||||
else if(href_list["c_mode2"])
|
||||
@@ -1128,12 +1128,12 @@
|
||||
|
||||
if(SSticker && SSticker.mode)
|
||||
return alert(usr, "The game has already started.", null, null, null, null)
|
||||
master_mode = href_list["c_mode2"]
|
||||
log_admin("[key_name(usr)] set the mode as [master_mode].")
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] set the mode as [master_mode].</span>", 1)
|
||||
to_chat(world, "<span class='boldnotice'>The mode is now: [master_mode]</span>")
|
||||
GLOB.master_mode = href_list["c_mode2"]
|
||||
log_admin("[key_name(usr)] set the mode as [GLOB.master_mode].")
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] set the mode as [GLOB.master_mode].</span>", 1)
|
||||
to_chat(world, "<span class='boldnotice'>The mode is now: [GLOB.master_mode]</span>")
|
||||
Game() // updates the main game menu
|
||||
world.save_mode(master_mode)
|
||||
world.save_mode(GLOB.master_mode)
|
||||
.(href, list("c_mode"=1))
|
||||
|
||||
else if(href_list["f_secret2"])
|
||||
@@ -1141,11 +1141,11 @@
|
||||
|
||||
if(SSticker && SSticker.mode)
|
||||
return alert(usr, "The game has already started.", null, null, null, null)
|
||||
if(master_mode != "secret")
|
||||
if(GLOB.master_mode != "secret")
|
||||
return alert(usr, "The game mode has to be secret!", null, null, null, null)
|
||||
secret_force_mode = href_list["f_secret2"]
|
||||
log_admin("[key_name(usr)] set the forced secret mode as [secret_force_mode].")
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] set the forced secret mode as [secret_force_mode].</span>", 1)
|
||||
GLOB.secret_force_mode = href_list["f_secret2"]
|
||||
log_admin("[key_name(usr)] set the forced secret mode as [GLOB.secret_force_mode].")
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] set the forced secret mode as [GLOB.secret_force_mode].</span>", 1)
|
||||
Game() // updates the main game menu
|
||||
.(href, list("f_secret"=1))
|
||||
|
||||
@@ -1231,7 +1231,7 @@
|
||||
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai")
|
||||
return
|
||||
|
||||
var/turf/prison_cell = pick(prisonwarp)
|
||||
var/turf/prison_cell = pick(GLOB.prisonwarp)
|
||||
if(!prison_cell) return
|
||||
|
||||
var/obj/structure/closet/secure_closet/brig/locker = new /obj/structure/closet/secure_closet/brig(prison_cell)
|
||||
@@ -1311,7 +1311,7 @@
|
||||
|
||||
M.Paralyse(5)
|
||||
sleep(5)
|
||||
M.loc = pick(tdome1)
|
||||
M.loc = pick(GLOB.tdome1)
|
||||
spawn(50)
|
||||
to_chat(M, "<span class='notice'>You have been sent to the Thunderdome.</span>")
|
||||
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 1)")
|
||||
@@ -1341,7 +1341,7 @@
|
||||
|
||||
M.Paralyse(5)
|
||||
sleep(5)
|
||||
M.loc = pick(tdome2)
|
||||
M.loc = pick(GLOB.tdome2)
|
||||
spawn(50)
|
||||
to_chat(M, "<span class='notice'>You have been sent to the Thunderdome.</span>")
|
||||
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 2)")
|
||||
@@ -1363,7 +1363,7 @@
|
||||
|
||||
M.Paralyse(5)
|
||||
sleep(5)
|
||||
M.loc = pick(tdomeadmin)
|
||||
M.loc = pick(GLOB.tdomeadmin)
|
||||
spawn(50)
|
||||
to_chat(M, "<span class='notice'>You have been sent to the Thunderdome.</span>")
|
||||
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Admin.)")
|
||||
@@ -1397,7 +1397,7 @@
|
||||
observer.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(observer), slot_shoes)
|
||||
M.Paralyse(5)
|
||||
sleep(5)
|
||||
M.loc = pick(tdomeobserve)
|
||||
M.loc = pick(GLOB.tdomeobserve)
|
||||
spawn(50)
|
||||
to_chat(M, "<span class='notice'>You have been sent to the Thunderdome.</span>")
|
||||
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Observer.)")
|
||||
@@ -1419,7 +1419,7 @@
|
||||
|
||||
M.Paralyse(5)
|
||||
sleep(5)
|
||||
M.loc = pick(aroomwarp)
|
||||
M.loc = pick(GLOB.aroomwarp)
|
||||
spawn(50)
|
||||
to_chat(M, "<span class='notice'>You have been sent to the <b>Admin Room!</b>.</span>")
|
||||
log_admin("[key_name(usr)] has sent [key_name(M)] to the Admin Room")
|
||||
@@ -1667,13 +1667,13 @@
|
||||
if(alert(owner, "Are you sure you wish to hit [key_name(M)] with Bluespace Artillery?", "Confirm Firing?" , "Yes" , "No") != "Yes")
|
||||
return
|
||||
|
||||
if(BSACooldown)
|
||||
if(GLOB.BSACooldown)
|
||||
to_chat(owner, "Standby. Reload cycle in progress. Gunnery crews ready in five seconds!")
|
||||
return
|
||||
|
||||
BSACooldown = 1
|
||||
GLOB.BSACooldown = 1
|
||||
spawn(50)
|
||||
BSACooldown = 0
|
||||
GLOB.BSACooldown = 0
|
||||
|
||||
to_chat(M, "You've been hit by bluespace artillery!")
|
||||
log_admin("[key_name(M)] has been hit by Bluespace Artillery fired by [key_name(owner)]")
|
||||
@@ -1787,7 +1787,7 @@
|
||||
var/logmsg = null
|
||||
switch(blessing)
|
||||
if("To Arrivals")
|
||||
M.forceMove(pick(latejoin))
|
||||
M.forceMove(pick(GLOB.latejoin))
|
||||
to_chat(M, "<span class='userdanger'>You are abruptly pulled through space!</span>")
|
||||
logmsg = "a teleport to arrivals."
|
||||
if("Moderate Heal")
|
||||
@@ -1803,13 +1803,13 @@
|
||||
H.reagents.add_reagent("spaceacillin", 20)
|
||||
logmsg = "a heal over time."
|
||||
if("Permanent Regeneration")
|
||||
H.dna.SetSEState(REGENERATEBLOCK, 1)
|
||||
genemutcheck(H, REGENERATEBLOCK, null, MUTCHK_FORCED)
|
||||
H.dna.SetSEState(GLOB.regenerateblock, 1)
|
||||
genemutcheck(H, GLOB.regenerateblock, null, MUTCHK_FORCED)
|
||||
H.update_mutations()
|
||||
H.gene_stability = 100
|
||||
logmsg = "permanent regeneration."
|
||||
if("Super Powers")
|
||||
var/list/default_genes = list(REGENERATEBLOCK, BREATHLESSBLOCK, COLDBLOCK)
|
||||
var/list/default_genes = list(GLOB.regenerateblock, GLOB.breathlessblock, GLOB.coldblock)
|
||||
for(var/gene in default_genes)
|
||||
H.dna.SetSEState(gene, 1)
|
||||
genemutcheck(H, gene, null, MUTCHK_FORCED)
|
||||
@@ -2056,7 +2056,7 @@
|
||||
P.name = "Central Command - paper"
|
||||
var/stypes = list("Handle it yourselves!","Illegible fax","Fax not signed","Not Right Now","You are wasting our time", "Keep up the good work", "ERT Instructions")
|
||||
var/stype = input(src.owner, "Which type of standard reply do you wish to send to [H]?","Choose your paperwork", "") as null|anything in stypes
|
||||
var/tmsg = "<font face='Verdana' color='black'><center><img src = 'ntlogo.png'><BR><BR><BR><font size='4'><B>Nanotrasen Science Station [using_map.station_short]</B></font><BR><BR><BR><font size='4'>NAS Trurl Communications Department Report</font></center><BR><BR>"
|
||||
var/tmsg = "<font face='Verdana' color='black'><center><img src = 'ntlogo.png'><BR><BR><BR><font size='4'><B>Nanotrasen Science Station [GLOB.using_map.station_short]</B></font><BR><BR><BR><font size='4'>NAS Trurl Communications Department Report</font></center><BR><BR>"
|
||||
if(stype == "Handle it yourselves!")
|
||||
tmsg += "Greetings, esteemed crewmember. Your fax has been <B><I>DECLINED</I></B> automatically by NAS Trurl Fax Registration.<BR><BR>Please proceed in accordance with Standard Operating Procedure and/or Space Law. You are fully trained to handle this situation without Central Command intervention.<BR><BR><i><small>This is an automatic message.</small>"
|
||||
else if(stype == "Illegible fax")
|
||||
@@ -2134,7 +2134,7 @@
|
||||
|
||||
var/input = input(src.owner, "Please enter a reason for denying [key_name(H)]'s ERT request.","Outgoing message from CentComm", "")
|
||||
if(!input) return
|
||||
ert_request_answered = TRUE
|
||||
GLOB.ert_request_answered = TRUE
|
||||
to_chat(src.owner, "You sent [input] to [H] via a secure channel.")
|
||||
log_admin("[src.owner] denied [key_name(H)]'s ERT request with the message [input].")
|
||||
to_chat(H, "<span class = 'specialnoticebold'>Incoming priority transmission from Central Command. Message as follows,</span><span class = 'specialnotice'> Your ERT request has been denied for the following reasons: [input].</span>")
|
||||
@@ -2198,13 +2198,13 @@
|
||||
var/obj/item/paper/P = new /obj/item/paper(null) //hopefully the null loc won't cause trouble for us
|
||||
|
||||
if(!fax)
|
||||
var/list/departmentoptions = alldepartments + hidden_departments + "All Departments"
|
||||
var/list/departmentoptions = GLOB.alldepartments + GLOB.hidden_departments + "All Departments"
|
||||
destination = input(usr, "To which department?", "Choose a department", "") as null|anything in departmentoptions
|
||||
if(!destination)
|
||||
qdel(P)
|
||||
return
|
||||
|
||||
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
|
||||
for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes)
|
||||
if(destination != "All Departments" && F.department == destination)
|
||||
fax = F
|
||||
|
||||
@@ -2300,7 +2300,7 @@
|
||||
to_chat(src.owner, "<span class='warning'>Message transmission failed.</span>")
|
||||
return
|
||||
else
|
||||
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
|
||||
for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes)
|
||||
if(is_station_level(F.z))
|
||||
spawn(0)
|
||||
if(!F.receivefax(P))
|
||||
@@ -2541,7 +2541,7 @@
|
||||
else if(href_list["memoeditlist"])
|
||||
if(!check_rights(R_SERVER)) return
|
||||
var/sql_key = sanitizeSQL("[href_list["memoeditlist"]]")
|
||||
var/DBQuery/query_memoedits = dbcon.NewQuery("SELECT edits FROM [format_table_name("memo")] WHERE (ckey = '[sql_key]')")
|
||||
var/DBQuery/query_memoedits = GLOB.dbcon.NewQuery("SELECT edits FROM [format_table_name("memo")] WHERE (ckey = '[sql_key]')")
|
||||
if(!query_memoedits.Execute())
|
||||
var/err = query_memoedits.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining edits from memo table. Error : \[[err]\]\n")
|
||||
@@ -2616,19 +2616,19 @@
|
||||
if(!(SSticker && SSticker.mode))
|
||||
to_chat(usr, "Please wait until the game starts! Not sure how it will work otherwise.")
|
||||
return
|
||||
gravity_is_on = !gravity_is_on
|
||||
GLOB.gravity_is_on = !GLOB.gravity_is_on
|
||||
for(var/area/A in world)
|
||||
A.gravitychange(gravity_is_on,A)
|
||||
A.gravitychange(GLOB.gravity_is_on,A)
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","Grav")
|
||||
if(gravity_is_on)
|
||||
if(GLOB.gravity_is_on)
|
||||
log_admin("[key_name(usr)] toggled gravity on.", 1)
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] toggled gravity on.</span>", 1)
|
||||
event_announcement.Announce("Gravity generators are again functioning within normal parameters. Sorry for any inconvenience.")
|
||||
GLOB.event_announcement.Announce("Gravity generators are again functioning within normal parameters. Sorry for any inconvenience.")
|
||||
else
|
||||
log_admin("[key_name(usr)] toggled gravity off.", 1)
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] toggled gravity off.</span>", 1)
|
||||
event_announcement.Announce("Feedback surge detected in mass-distributions systems. Artifical gravity has been disabled whilst the system reinitializes. Further failures may result in a gravitational collapse and formation of blackholes. Have a nice day.")
|
||||
GLOB.event_announcement.Announce("Feedback surge detected in mass-distributions systems. Artifical gravity has been disabled whilst the system reinitializes. Further failures may result in a gravitational collapse and formation of blackholes. Have a nice day.")
|
||||
|
||||
if("power")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
@@ -2658,7 +2658,7 @@
|
||||
for(var/mob/living/carbon/human/H in GLOB.mob_list)
|
||||
var/turf/loc = find_loc(H)
|
||||
var/security = 0
|
||||
if(!is_station_level(loc.z) || prisonwarped.Find(H))
|
||||
if(!is_station_level(loc.z) || GLOB.prisonwarped.Find(H))
|
||||
|
||||
//don't warp them if they aren't ready or are already there
|
||||
continue
|
||||
@@ -2683,13 +2683,13 @@
|
||||
W.layer = initial(W.layer)
|
||||
W.plane = initial(W.plane)
|
||||
//teleport person to cell
|
||||
H.loc = pick(prisonwarp)
|
||||
H.loc = pick(GLOB.prisonwarp)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(H), slot_shoes)
|
||||
else
|
||||
//teleport security person
|
||||
H.loc = pick(prisonsecuritywarp)
|
||||
prisonwarped += H
|
||||
H.loc = pick(GLOB.prisonsecuritywarp)
|
||||
GLOB.prisonwarped += H
|
||||
if("traitor_all")
|
||||
if(!SSticker)
|
||||
alert("The game hasn't started yet!")
|
||||
@@ -2716,21 +2716,21 @@
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","BC")
|
||||
|
||||
var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be between 4 and 128)", "New Bomb Cap", MAX_EX_LIGHT_RANGE) as num|null
|
||||
var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be between 4 and 128)", "New Bomb Cap", GLOB.max_ex_light_range) as num|null
|
||||
if(newBombCap < 4)
|
||||
return
|
||||
if(newBombCap > 128)
|
||||
newBombCap = 128
|
||||
|
||||
MAX_EX_DEVASTATION_RANGE = round(newBombCap/4)
|
||||
MAX_EX_HEAVY_RANGE = round(newBombCap/2)
|
||||
MAX_EX_LIGHT_RANGE = newBombCap
|
||||
GLOB.max_ex_devastation_range = round(newBombCap/4)
|
||||
GLOB.max_ex_heavy_range = round(newBombCap/2)
|
||||
GLOB.max_ex_light_range = newBombCap
|
||||
//I don't know why these are their own variables, but fuck it, they are.
|
||||
MAX_EX_FLASH_RANGE = newBombCap
|
||||
MAX_EX_FLAME_RANGE = newBombCap
|
||||
GLOB.max_ex_flash_range = newBombCap
|
||||
GLOB.max_ex_flame_range = newBombCap
|
||||
|
||||
message_admins("<span class='boldannounce'>[key_name_admin(usr)] changed the bomb cap to [MAX_EX_DEVASTATION_RANGE], [MAX_EX_HEAVY_RANGE], [MAX_EX_LIGHT_RANGE]</span>")
|
||||
log_admin("[key_name(usr)] changed the bomb cap to [MAX_EX_DEVASTATION_RANGE], [MAX_EX_HEAVY_RANGE], [MAX_EX_LIGHT_RANGE]")
|
||||
message_admins("<span class='boldannounce'>[key_name_admin(usr)] changed the bomb cap to [GLOB.max_ex_devastation_range], [GLOB.max_ex_heavy_range], [GLOB.max_ex_light_range]</span>")
|
||||
log_admin("[key_name(usr)] changed the bomb cap to [GLOB.max_ex_devastation_range], [GLOB.max_ex_heavy_range], [GLOB.max_ex_light_range]")
|
||||
|
||||
if("flicklights")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
@@ -2838,7 +2838,7 @@
|
||||
if(is_station_level(W.z) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison))
|
||||
W.req_access = list()
|
||||
message_admins("[key_name_admin(usr)] activated Egalitarian Station mode")
|
||||
event_announcement.Announce("Centcomm airlock control override activated. Please take this time to get acquainted with your coworkers.", new_sound = 'sound/AI/commandreport.ogg')
|
||||
GLOB.event_announcement.Announce("Centcomm airlock control override activated. Please take this time to get acquainted with your coworkers.", new_sound = 'sound/AI/commandreport.ogg')
|
||||
if("onlyone")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","OO")
|
||||
@@ -2958,13 +2958,13 @@
|
||||
var/ok = 0
|
||||
switch(href_list["secretsadmin"])
|
||||
if("list_signalers")
|
||||
var/dat = "<B>Showing last [length(lastsignalers)] signalers.</B><HR>"
|
||||
for(var/sig in lastsignalers)
|
||||
var/dat = "<B>Showing last [length(GLOB.lastsignalers)] signalers.</B><HR>"
|
||||
for(var/sig in GLOB.lastsignalers)
|
||||
dat += "[sig]<BR>"
|
||||
usr << browse(dat, "window=lastsignalers;size=800x500")
|
||||
if("list_lawchanges")
|
||||
var/dat = "<B>Showing last [length(lawchanges)] law changes.</B><HR>"
|
||||
for(var/sig in lawchanges)
|
||||
var/dat = "<B>Showing last [length(GLOB.lawchanges)] law changes.</B><HR>"
|
||||
for(var/sig in GLOB.lawchanges)
|
||||
dat += "[sig]<BR>"
|
||||
usr << browse(dat, "window=lawchanges;size=800x500")
|
||||
if("list_job_debug")
|
||||
@@ -3046,9 +3046,9 @@
|
||||
switch(href_list["secretscoder"])
|
||||
if("spawn_objects")
|
||||
var/dat = "<B>Admin Log<HR></B>"
|
||||
for(var/l in admin_log)
|
||||
for(var/l in GLOB.admin_log)
|
||||
dat += "<li>[l]</li>"
|
||||
if(!admin_log.len)
|
||||
if(!GLOB.admin_log.len)
|
||||
dat += "No-one has done anything this round!"
|
||||
usr << browse(dat, "window=admin_log")
|
||||
if("maint_ACCESS_BRIG")
|
||||
@@ -3085,7 +3085,7 @@
|
||||
|
||||
else if(href_list["ac_submit_new_channel"])
|
||||
var/check = 0
|
||||
for(var/datum/feed_channel/FC in news_network.network_channels)
|
||||
for(var/datum/feed_channel/FC in GLOB.news_network.network_channels)
|
||||
if(FC.channel_name == src.admincaster_feed_channel.channel_name)
|
||||
check = 1
|
||||
break
|
||||
@@ -3100,14 +3100,14 @@
|
||||
newChannel.locked = src.admincaster_feed_channel.locked
|
||||
newChannel.is_admin_channel = 1
|
||||
feedback_inc("newscaster_channels",1)
|
||||
news_network.network_channels += newChannel //Adding channel to the global network
|
||||
GLOB.news_network.network_channels += newChannel //Adding channel to the global network
|
||||
log_admin("[key_name_admin(usr)] created command feed channel: [src.admincaster_feed_channel.channel_name]!")
|
||||
src.admincaster_screen=5
|
||||
src.access_news_network()
|
||||
|
||||
else if(href_list["ac_set_channel_receiving"])
|
||||
var/list/available_channels = list()
|
||||
for(var/datum/feed_channel/F in news_network.network_channels)
|
||||
for(var/datum/feed_channel/F in GLOB.news_network.network_channels)
|
||||
available_channels += F.channel_name
|
||||
src.admincaster_feed_channel.channel_name = adminscrub(input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels )
|
||||
src.access_news_network()
|
||||
@@ -3127,13 +3127,13 @@
|
||||
newMsg.body = src.admincaster_feed_message.body
|
||||
newMsg.is_admin_message = 1
|
||||
feedback_inc("newscaster_stories",1)
|
||||
for(var/datum/feed_channel/FC in news_network.network_channels)
|
||||
for(var/datum/feed_channel/FC in GLOB.news_network.network_channels)
|
||||
if(FC.channel_name == src.admincaster_feed_channel.channel_name)
|
||||
FC.messages += newMsg //Adding message to the network's appropriate feed_channel
|
||||
break
|
||||
src.admincaster_screen=4
|
||||
|
||||
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
|
||||
for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allNewscasters)
|
||||
NEWSCASTER.newsAlert(src.admincaster_feed_channel.channel_name)
|
||||
|
||||
log_admin("[key_name_admin(usr)] submitted a feed story to channel: [src.admincaster_feed_channel.channel_name]!")
|
||||
@@ -3157,12 +3157,12 @@
|
||||
|
||||
else if(href_list["ac_menu_wanted"])
|
||||
var/already_wanted = 0
|
||||
if(news_network.wanted_issue)
|
||||
if(GLOB.news_network.wanted_issue)
|
||||
already_wanted = 1
|
||||
|
||||
if(already_wanted)
|
||||
src.admincaster_feed_message.author = news_network.wanted_issue.author
|
||||
src.admincaster_feed_message.body = news_network.wanted_issue.body
|
||||
src.admincaster_feed_message.author = GLOB.news_network.wanted_issue.author
|
||||
src.admincaster_feed_message.body = GLOB.news_network.wanted_issue.body
|
||||
src.admincaster_screen = 14
|
||||
src.access_news_network()
|
||||
|
||||
@@ -3191,15 +3191,15 @@
|
||||
WANTED.body = src.admincaster_feed_message.body //Wanted desc
|
||||
WANTED.backup_author = src.admincaster_signature //Submitted by
|
||||
WANTED.is_admin_message = 1
|
||||
news_network.wanted_issue = WANTED
|
||||
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
|
||||
GLOB.news_network.wanted_issue = WANTED
|
||||
for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allNewscasters)
|
||||
NEWSCASTER.newsAlert()
|
||||
NEWSCASTER.update_icon()
|
||||
src.admincaster_screen = 15
|
||||
else
|
||||
news_network.wanted_issue.author = src.admincaster_feed_message.author
|
||||
news_network.wanted_issue.body = src.admincaster_feed_message.body
|
||||
news_network.wanted_issue.backup_author = src.admincaster_feed_message.backup_author
|
||||
GLOB.news_network.wanted_issue.author = src.admincaster_feed_message.author
|
||||
GLOB.news_network.wanted_issue.body = src.admincaster_feed_message.body
|
||||
GLOB.news_network.wanted_issue.backup_author = src.admincaster_feed_message.backup_author
|
||||
src.admincaster_screen = 19
|
||||
log_admin("[key_name_admin(usr)] issued a Station-wide Wanted Notification for [src.admincaster_feed_message.author]!")
|
||||
src.access_news_network()
|
||||
@@ -3207,8 +3207,8 @@
|
||||
else if(href_list["ac_cancel_wanted"])
|
||||
var/choice = alert("Please confirm Wanted Issue removal","Network Security Handler","Confirm","Cancel")
|
||||
if(choice=="Confirm")
|
||||
news_network.wanted_issue = null
|
||||
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
|
||||
GLOB.news_network.wanted_issue = null
|
||||
for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allNewscasters)
|
||||
NEWSCASTER.update_icon()
|
||||
src.admincaster_screen=17
|
||||
src.access_news_network()
|
||||
@@ -3333,7 +3333,7 @@
|
||||
var/isbn = sanitizeSQL(href_list["library_book_id"])
|
||||
|
||||
if(href_list["view_library_book"])
|
||||
var/DBQuery/query_view_book = dbcon.NewQuery("SELECT content, title FROM [format_table_name("library")] WHERE id=[isbn]")
|
||||
var/DBQuery/query_view_book = GLOB.dbcon.NewQuery("SELECT content, title FROM [format_table_name("library")] WHERE id=[isbn]")
|
||||
if(!query_view_book.Execute())
|
||||
var/err = query_view_book.ErrorMsg()
|
||||
log_game("SQL ERROR viewing book. Error : \[[err]\]\n")
|
||||
@@ -3358,7 +3358,7 @@
|
||||
return
|
||||
|
||||
else if(href_list["unflag_library_book"])
|
||||
var/DBQuery/query_unflag_book = dbcon.NewQuery("UPDATE [format_table_name("library")] SET flagged = 0 WHERE id=[isbn]")
|
||||
var/DBQuery/query_unflag_book = GLOB.dbcon.NewQuery("UPDATE [format_table_name("library")] SET flagged = 0 WHERE id=[isbn]")
|
||||
if(!query_unflag_book.Execute())
|
||||
var/err = query_unflag_book.ErrorMsg()
|
||||
log_game("SQL ERROR unflagging book. Error : \[[err]\]\n")
|
||||
@@ -3368,7 +3368,7 @@
|
||||
message_admins("[key_name_admin(usr)] has unflagged the book [isbn].")
|
||||
|
||||
else if(href_list["delete_library_book"])
|
||||
var/DBQuery/query_delbook = dbcon.NewQuery("DELETE FROM [format_table_name("library")] WHERE id=[isbn]")
|
||||
var/DBQuery/query_delbook = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("library")] WHERE id=[isbn]")
|
||||
if(!query_delbook.Execute())
|
||||
var/err = query_delbook.ErrorMsg()
|
||||
log_game("SQL ERROR deleting book. Error : \[[err]\]\n")
|
||||
@@ -3381,11 +3381,12 @@
|
||||
src.view_flagged_books()
|
||||
|
||||
// Force unlink a discord key
|
||||
// TODO: Delete this
|
||||
else if(href_list["force_discord_unlink"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
var/target_ckey = href_list["force_discord_unlink"]
|
||||
var/DBQuery/admin_unlink_discord_id = dbcon.NewQuery("DELETE FROM [format_table_name("discord")] WHERE ckey = '[target_ckey]'")
|
||||
var/DBQuery/admin_unlink_discord_id = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("discord")] WHERE ckey = '[target_ckey]'")
|
||||
if(!admin_unlink_discord_id.Execute())
|
||||
var/err = admin_unlink_discord_id.ErrorMsg()
|
||||
log_game("SQL ERROR while admin-unlinking discord account. Error : \[[err]\]\n")
|
||||
@@ -3441,7 +3442,7 @@
|
||||
return
|
||||
var/datum/mind/hunter_mind = new /datum/mind(key_of_hunter)
|
||||
hunter_mind.active = 1
|
||||
var/mob/living/carbon/human/hunter_mob = new /mob/living/carbon/human(pick(latejoin))
|
||||
var/mob/living/carbon/human/hunter_mob = new /mob/living/carbon/human(pick(GLOB.latejoin))
|
||||
hunter_mind.transfer_to(hunter_mob)
|
||||
hunter_mob.equipOutfit(O, FALSE)
|
||||
var/obj/item/pinpointer/advpinpointer/N = new /obj/item/pinpointer/advpinpointer(hunter_mob)
|
||||
@@ -3471,7 +3472,7 @@
|
||||
if(killthem)
|
||||
to_chat(hunter_mob, "<B>If you kill [H.p_them()], [H.p_they()] cannot be revived.</B>");
|
||||
hunter_mob.mind.special_role = SPECIAL_ROLE_TRAITOR
|
||||
var/datum/atom_hud/antag/tatorhud = huds[ANTAG_HUD_TRAITOR]
|
||||
var/datum/atom_hud/antag/tatorhud = GLOB.huds[ANTAG_HUD_TRAITOR]
|
||||
tatorhud.join_hud(hunter_mob)
|
||||
set_antag_hud(hunter_mob, "hudsyndicate")
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
|
||||
//This is a list of words which are ignored by the parser when comparing message contents for names. MUST BE IN LOWER CASE!
|
||||
var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","alien","as")
|
||||
GLOBAL_LIST_INIT(adminhelp_ignored_words, list("unknown","the","a","an","of","monkey","alien","as"))
|
||||
|
||||
/client/verb/adminhelp()
|
||||
set category = "Admin"
|
||||
@@ -66,7 +66,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
|
||||
for(var/original_word in msglist)
|
||||
var/word = ckey(original_word)
|
||||
if(word)
|
||||
if(!(word in adminhelp_ignored_words))
|
||||
if(!(word in GLOB.adminhelp_ignored_words))
|
||||
if(word == "ai")
|
||||
ai_found = 1
|
||||
else
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
/client/proc/get_admin_say()
|
||||
var/msg = input(src, null, "asay \"text\"") as text|null
|
||||
cmd_admin_say(msg)
|
||||
|
||||
|
||||
/client/proc/cmd_mentor_say(msg as text)
|
||||
set category = "Admin"
|
||||
set name = "Msay"
|
||||
@@ -59,12 +59,12 @@
|
||||
var/enabling
|
||||
var/msay = /client/proc/cmd_mentor_say
|
||||
|
||||
if(msay in admin_verbs_mentor)
|
||||
if(msay in GLOB.admin_verbs_mentor)
|
||||
enabling = FALSE
|
||||
admin_verbs_mentor -= msay
|
||||
GLOB.admin_verbs_mentor -= msay
|
||||
else
|
||||
enabling = TRUE
|
||||
admin_verbs_mentor += msay
|
||||
GLOB.admin_verbs_mentor += msay
|
||||
|
||||
for(var/client/C in GLOB.admins)
|
||||
if(check_rights(R_ADMIN|R_MOD, 0, C.mob))
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<br>Additionally make an attempt to introduce new players to the server
|
||||
<HR>"}
|
||||
|
||||
if(dbcon.IsConnected())
|
||||
if(GLOB.dbcon.IsConnected())
|
||||
for(var/client/C in GLOB.clients)
|
||||
dat += "<p>[C.ckey] (Player Age: <font color = 'red'>[C.player_age]</font>) - <b>[C.computer_id]</b> / <b>[C.address]</b><br>"
|
||||
if(C.related_accounts_cid.len)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
to_chat(usr, "Checking for overlapping pipes...")
|
||||
for(var/turf/T in world)
|
||||
for(var/dir in cardinal)
|
||||
for(var/dir in GLOB.cardinal)
|
||||
var/list/check = list(0, 0, 0)
|
||||
var/done = 0
|
||||
for(var/obj/machinery/atmospherics/pipe in T)
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
var/input = input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg) as message|null
|
||||
var/input = input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", GLOB.custom_event_msg) as message|null
|
||||
if(!input || input == "")
|
||||
custom_event_msg = null
|
||||
GLOB.custom_event_msg = null
|
||||
log_admin("[key_name(usr)] has cleared the custom event text.")
|
||||
message_admins("[key_name_admin(usr)] has cleared the custom event text.")
|
||||
return
|
||||
@@ -17,11 +17,11 @@
|
||||
log_admin("[key_name(usr)] has changed the custom event text.")
|
||||
message_admins("[key_name_admin(usr)] has changed the custom event text.")
|
||||
|
||||
custom_event_msg = input
|
||||
GLOB.custom_event_msg = input
|
||||
|
||||
to_chat(world, "<h1 class='alert'>Custom Event</h1>")
|
||||
to_chat(world, "<h2 class='alert'>A custom event is starting. OOC Info:</h2>")
|
||||
to_chat(world, "<span class='alert'>[html_encode(custom_event_msg)]</span>")
|
||||
to_chat(world, "<span class='alert'>[html_encode(GLOB.custom_event_msg)]</span>")
|
||||
to_chat(world, "<br>")
|
||||
|
||||
// normal verb for players to view info
|
||||
@@ -29,12 +29,12 @@
|
||||
set category = "OOC"
|
||||
set name = "Custom Event Info"
|
||||
|
||||
if(!custom_event_msg || custom_event_msg == "")
|
||||
if(!GLOB.custom_event_msg || GLOB.custom_event_msg == "")
|
||||
to_chat(src, "There currently is no known custom event taking place.")
|
||||
to_chat(src, "Keep in mind: it is possible that an admin has not properly set this.")
|
||||
return
|
||||
|
||||
to_chat(src, "<h1 class='alert'>Custom Event</h1>")
|
||||
to_chat(src, "<h2 class='alert'>A custom event is taking place. OOC Info:</h2>")
|
||||
to_chat(src, "<span class='alert'>[html_encode(custom_event_msg)]</span>")
|
||||
to_chat(src, "<span class='alert'>[html_encode(GLOB.custom_event_msg)]</span>")
|
||||
to_chat(src, "<br>")
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
|
||||
if(Debug2)
|
||||
Debug2 = 0
|
||||
if(GLOB.debug2)
|
||||
GLOB.debug2 = 0
|
||||
message_admins("[key_name_admin(src)] toggled debugging off.")
|
||||
log_admin("[key_name(src)] toggled debugging off.")
|
||||
else
|
||||
Debug2 = 1
|
||||
GLOB.debug2 = 1
|
||||
message_admins("[key_name_admin(src)] toggled debugging on.")
|
||||
log_admin("[key_name(src)] toggled debugging on.")
|
||||
|
||||
@@ -291,9 +291,9 @@ GLOBAL_PROTECT(AdminProcCaller)
|
||||
pai.real_name = pai.name
|
||||
pai.key = choice.key
|
||||
card.setPersonality(pai)
|
||||
for(var/datum/paiCandidate/candidate in paiController.pai_candidates)
|
||||
for(var/datum/paiCandidate/candidate in GLOB.paiController.pai_candidates)
|
||||
if(candidate.key == choice.key)
|
||||
paiController.pai_candidates.Remove(candidate)
|
||||
GLOB.paiController.pai_candidates.Remove(candidate)
|
||||
feedback_add_details("admin_verb","MPAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/cmd_admin_alienize(var/mob/M in GLOB.mob_list)
|
||||
@@ -806,7 +806,7 @@ GLOBAL_PROTECT(AdminProcCaller)
|
||||
genemutcheck(M,block,null,MUTCHK_FORCED)
|
||||
M.update_mutations()
|
||||
var/state="[M.dna.GetSEState(block)?"on":"off"]"
|
||||
var/blockname=assigned_blocks[block]
|
||||
var/blockname=GLOB.assigned_blocks[block]
|
||||
message_admins("[key_name_admin(src)] has toggled [M.key]'s [blockname] block [state]!")
|
||||
log_admin("[key_name(src)] has toggled [M.key]'s [blockname] block [state]!")
|
||||
else
|
||||
@@ -835,7 +835,7 @@ GLOBAL_PROTECT(AdminProcCaller)
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
|
||||
error_cache.showTo(usr)
|
||||
GLOB.error_cache.showTo(usr)
|
||||
|
||||
/client/proc/jump_to_ruin()
|
||||
set category = "Debug"
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
for(var/datum/gas/trace_gas in GM.trace_gases)
|
||||
to_chat(usr, "[trace_gas.type]: [trace_gas.moles]")
|
||||
|
||||
message_admins("[key_name_admin(usr)] has checked the air status of [T]")
|
||||
log_admin("[key_name(usr)] has checked the air status of [T]")
|
||||
message_admins("[key_name_admin(usr)] has checked the air status of [target]")
|
||||
log_admin("[key_name(usr)] has checked the air status of [target]")
|
||||
|
||||
feedback_add_details("admin_verb","DAST") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
return
|
||||
|
||||
to_chat(usr, "<b>Jobbans active in this round.</b>")
|
||||
for(var/t in jobban_keylist)
|
||||
for(var/t in GLOB.jobban_keylist)
|
||||
to_chat(usr, "[t]")
|
||||
|
||||
message_admins("[key_name_admin(usr)] has printed the jobban log")
|
||||
@@ -150,7 +150,7 @@
|
||||
return
|
||||
|
||||
to_chat(usr, "<b>Jobbans active in this round.</b>")
|
||||
for(var/t in jobban_keylist)
|
||||
for(var/t in GLOB.jobban_keylist)
|
||||
if(findtext(t, filter))
|
||||
to_chat(usr, "[t]")
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
//////Allows admin's to right click on any mob/mech and freeze them in place.///
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
var/global/list/frozen_mob_list = list()
|
||||
GLOBAL_LIST_EMPTY(frozen_mob_list)
|
||||
/client/proc/freeze(var/mob/living/M as mob in GLOB.mob_list)
|
||||
set name = "Freeze"
|
||||
set category = null
|
||||
@@ -16,7 +16,7 @@ var/global/list/frozen_mob_list = list()
|
||||
if(!istype(M))
|
||||
return
|
||||
|
||||
if(M in frozen_mob_list)
|
||||
if(M in GLOB.frozen_mob_list)
|
||||
M.admin_unFreeze(src)
|
||||
else
|
||||
M.admin_Freeze(src)
|
||||
@@ -41,8 +41,8 @@ var/global/list/frozen_mob_list = list()
|
||||
admin_prev_sleeping = sleeping
|
||||
AdjustSleeping(20000)
|
||||
frozen = AO
|
||||
if(!(src in frozen_mob_list))
|
||||
frozen_mob_list += src
|
||||
if(!(src in GLOB.frozen_mob_list))
|
||||
GLOB.frozen_mob_list += src
|
||||
|
||||
/mob/living/proc/admin_unFreeze(client/admin, skip_overlays = FALSE)
|
||||
if(istype(admin))
|
||||
@@ -58,8 +58,8 @@ var/global/list/frozen_mob_list = list()
|
||||
frozen = null
|
||||
SetSleeping(admin_prev_sleeping)
|
||||
admin_prev_sleeping = null
|
||||
if(src in frozen_mob_list)
|
||||
frozen_mob_list -= src
|
||||
if(src in GLOB.frozen_mob_list)
|
||||
GLOB.frozen_mob_list -= src
|
||||
|
||||
update_icons()
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//HONKsquad
|
||||
|
||||
#define HONKSQUAD_POSSIBLE 6 //if more Commandos are needed in the future
|
||||
var/global/sent_honksquad = 0
|
||||
GLOBAL_VAR_INIT(sent_honksquad, 0)
|
||||
|
||||
/client/proc/honksquad()
|
||||
if(!SSticker)
|
||||
@@ -10,7 +10,7 @@ var/global/sent_honksquad = 0
|
||||
if(world.time < 6000)
|
||||
to_chat(usr, "<font color='red'>There are [(6000-world.time)/10] seconds remaining before it may be called.</font>")
|
||||
return
|
||||
if(sent_honksquad == 1)
|
||||
if(GLOB.sent_honksquad == 1)
|
||||
to_chat(usr, "<font color='red'>Clown Planet has already dispatched a HONKsquad.</font>")
|
||||
return
|
||||
if(alert("Do you want to send in the HONKsquad? Once enabled, this is irreversible.",,"Yes","No")!="Yes")
|
||||
@@ -24,11 +24,11 @@ var/global/sent_honksquad = 0
|
||||
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
|
||||
return
|
||||
|
||||
if(sent_honksquad)
|
||||
if(GLOB.sent_honksquad)
|
||||
to_chat(usr, "Looks like someone beat you to it. HONK.")
|
||||
return
|
||||
|
||||
sent_honksquad = 1
|
||||
GLOB.sent_honksquad = 1
|
||||
|
||||
|
||||
var/honksquad_number = HONKSQUAD_POSSIBLE //for selecting a leader
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Syndicate Infiltration Team (SIT)
|
||||
// A little like Syndicate Strike Team (SST) but geared towards stealthy team missions rather than murderbone.
|
||||
|
||||
var/global/sent_syndicate_infiltration_team = 0
|
||||
GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0)
|
||||
|
||||
/client/proc/syndicate_infiltration_team()
|
||||
set category = "Event"
|
||||
@@ -35,7 +35,7 @@ var/global/sent_syndicate_infiltration_team = 0
|
||||
var/tctext = input(src, "How much TC do you want to give each team member? Suggested: 20-30. They cannot trade TC.") as num
|
||||
var/tcamount = text2num(tctext)
|
||||
tcamount = between(0, tcamount, 1000)
|
||||
if(sent_syndicate_infiltration_team == 1)
|
||||
if(GLOB.sent_syndicate_infiltration_team == 1)
|
||||
if(alert("A Syndicate Infiltration Team has already been sent. Sure you want to send another?",,"Yes","No")=="No")
|
||||
return
|
||||
|
||||
@@ -61,7 +61,7 @@ var/global/sent_syndicate_infiltration_team = 0
|
||||
to_chat(src, "Nobody volunteered.")
|
||||
return 0
|
||||
|
||||
sent_syndicate_infiltration_team = 1
|
||||
GLOB.sent_syndicate_infiltration_team = 1
|
||||
|
||||
var/list/sit_spawns = list()
|
||||
var/list/sit_spawns_leader = list()
|
||||
@@ -90,7 +90,7 @@ var/global/sent_syndicate_infiltration_team = 0
|
||||
to_chat(new_syndicate_infiltrator, "<span class='danger'>You are a [!syndicate_leader_selected?"Infiltrator":"<B>Lead Infiltrator</B>"] in the service of the Syndicate. \nYour current mission is: <B>[input]</B></span>")
|
||||
to_chat(new_syndicate_infiltrator, "<span class='notice'>You are equipped with an uplink implant to help you achieve your objectives. ((activate it via button in top left of screen))</span>")
|
||||
new_syndicate_infiltrator.faction += "syndicate"
|
||||
data_core.manifest_inject(new_syndicate_infiltrator)
|
||||
GLOB.data_core.manifest_inject(new_syndicate_infiltrator)
|
||||
if(syndicate_leader_selected)
|
||||
var/obj/effect/landmark/warpto = pick(sit_spawns_leader)
|
||||
new_syndicate_infiltrator.loc = warpto.loc
|
||||
@@ -104,7 +104,7 @@ var/global/sent_syndicate_infiltration_team = 0
|
||||
new_syndicate_infiltrator.mind.store_memory("<B>Mission:</B> [input] ")
|
||||
new_syndicate_infiltrator.mind.store_memory("<B>Team Leader:</B> [team_leader] ")
|
||||
new_syndicate_infiltrator.mind.store_memory("<B>Starting Equipment:</B> <BR>- Syndicate Headset ((.h for your radio))<BR>- Chameleon Jumpsuit ((right click to Change Color))<BR> - Agent ID card ((disguise as another job))<BR> - Uplink Implant ((top left of screen)) <BR> - Dust Implant ((destroys your body on death)) <BR> - Combat Gloves ((insulated, disguised as black gloves)) <BR> - Anything bought with your uplink implant")
|
||||
var/datum/atom_hud/antag/opshud = huds[ANTAG_HUD_OPS]
|
||||
var/datum/atom_hud/antag/opshud = GLOB.huds[ANTAG_HUD_OPS]
|
||||
opshud.join_hud(new_syndicate_infiltrator.mind.current)
|
||||
set_antag_hud(new_syndicate_infiltrator.mind.current, "hudoperative")
|
||||
new_syndicate_infiltrator.regenerate_icons()
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
return
|
||||
var/datum/map_template/template
|
||||
|
||||
var/map = input(usr, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template") as null|anything in map_templates
|
||||
var/map = input(usr, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template") as null|anything in GLOB.map_templates
|
||||
if(!map)
|
||||
return
|
||||
template = map_templates[map]
|
||||
template = GLOB.map_templates[map]
|
||||
|
||||
var/turf/T = get_turf(mob)
|
||||
if(!T)
|
||||
@@ -48,7 +48,7 @@
|
||||
var/datum/map_template/M = new(map=map, rename="[map]")
|
||||
if(M.preload_size(map))
|
||||
to_chat(usr, "Map template '[map]' ready to place ([M.width]x[M.height])")
|
||||
map_templates[M.name] = M
|
||||
GLOB.map_templates[M.name] = M
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has uploaded a map template ([map]). Took [stop_watch(timer)]s.</span>")
|
||||
else
|
||||
to_chat(usr, "Map template '[map]' failed to load properly")
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
//- Identify how hard it is to break into the area and where the weak points are
|
||||
//- Check if the area has too much empty space. If so, make it smaller and replace the rest with maintenance tunnels.
|
||||
|
||||
var/camera_range_display_status = 0
|
||||
var/intercom_range_display_status = 0
|
||||
GLOBAL_VAR_INIT(camera_range_display_status, 0)
|
||||
GLOBAL_VAR_INIT(intercom_range_display_status, 0)
|
||||
|
||||
/obj/effect/debugging/camera_range
|
||||
icon = 'icons/480x480.dmi'
|
||||
@@ -50,16 +50,16 @@ var/intercom_range_display_status = 0
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
|
||||
if(camera_range_display_status)
|
||||
camera_range_display_status = 0
|
||||
if(GLOB.camera_range_display_status)
|
||||
GLOB.camera_range_display_status = 0
|
||||
else
|
||||
camera_range_display_status = 1
|
||||
GLOB.camera_range_display_status = 1
|
||||
|
||||
for(var/obj/effect/debugging/camera_range/C in world)
|
||||
qdel(C)
|
||||
|
||||
if(camera_range_display_status)
|
||||
for(var/obj/machinery/camera/C in cameranet.cameras)
|
||||
if(GLOB.camera_range_display_status)
|
||||
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
||||
new/obj/effect/debugging/camera_range(C.loc)
|
||||
feedback_add_details("admin_verb","mCRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -72,7 +72,7 @@ var/intercom_range_display_status = 0
|
||||
|
||||
var/list/obj/machinery/camera/CL = list()
|
||||
|
||||
for(var/obj/machinery/camera/C in cameranet.cameras)
|
||||
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
||||
CL += C
|
||||
|
||||
var/output = {"<B>CAMERA ANOMALIES REPORT</B><HR>
|
||||
@@ -109,15 +109,15 @@ var/intercom_range_display_status = 0
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
|
||||
if(intercom_range_display_status)
|
||||
intercom_range_display_status = 0
|
||||
if(GLOB.intercom_range_display_status)
|
||||
GLOB.intercom_range_display_status = 0
|
||||
else
|
||||
intercom_range_display_status = 1
|
||||
GLOB.intercom_range_display_status = 1
|
||||
|
||||
for(var/obj/effect/debugging/marker/M in world)
|
||||
qdel(M)
|
||||
|
||||
if(intercom_range_display_status)
|
||||
if(GLOB.intercom_range_display_status)
|
||||
for(var/obj/item/radio/intercom/I in world)
|
||||
for(var/turf/T in orange(7,I))
|
||||
var/obj/effect/debugging/marker/F = new/obj/effect/debugging/marker(T)
|
||||
|
||||
@@ -45,16 +45,16 @@
|
||||
var/default
|
||||
var/var_value = O.vars[variable]
|
||||
|
||||
if(variable in VVckey_edit)
|
||||
if(variable in GLOB.VVckey_edit)
|
||||
to_chat(src, "It's forbidden to mass-modify ckeys. It'll crash everyone's client you dummy.")
|
||||
return
|
||||
if(variable in VVlocked)
|
||||
if(variable in GLOB.VVlocked)
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
if(variable in VVicon_edit_lock)
|
||||
if(variable in GLOB.VVicon_edit_lock)
|
||||
if(!check_rights(R_EVENT | R_DEBUG))
|
||||
return
|
||||
if(variable in VVpixelmovement)
|
||||
if(variable in GLOB.VVpixelmovement)
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
var/prompt = alert(src, "Editing this var may irreparably break tile gliding for the rest of the round. THIS CAN'T BE UNDONE", "DANGER", "ABORT ", "Continue", " ABORT")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
var/list/VVlocked = list("vars", "var_edited", "client", "firemut", "ishulk", "telekinesis", "xray", "ka", "virus", "viruses", "cuffed", "last_eaten", "unlock_content") // R_DEBUG
|
||||
var/list/VVicon_edit_lock = list("icon", "icon_state", "overlays", "underlays", "resize") // R_EVENT | R_DEBUG
|
||||
var/list/VVckey_edit = list("key", "ckey") // R_EVENT | R_DEBUG
|
||||
var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height", "bound_width", "bound_x", "bound_y") // R_DEBUG + warning
|
||||
GLOBAL_LIST_INIT(VVlocked, list("vars", "var_edited", "client", "firemut", "ishulk", "telekinesis", "xray", "ka", "virus", "viruses", "cuffed", "last_eaten", "unlock_content")) // R_DEBUG
|
||||
GLOBAL_LIST_INIT(VVicon_edit_lock, list("icon", "icon_state", "overlays", "underlays", "resize")) // R_EVENT | R_DEBUG
|
||||
GLOBAL_LIST_INIT(VVckey_edit, list("key", "ckey")) // R_EVENT | R_DEBUG
|
||||
GLOBAL_LIST_INIT(VVpixelmovement, list("step_x", "step_y", "step_size", "bound_height", "bound_width", "bound_x", "bound_y")) // R_DEBUG + warning
|
||||
/client/proc/vv_get_class(var/var_value)
|
||||
if(isnull(var_value))
|
||||
. = VV_NULL
|
||||
@@ -517,16 +517,16 @@ var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height",
|
||||
message_admins("[key_name_admin(src)] modified [original_name]'s varlist [objectvar]: [original_var]=[new_var]")
|
||||
|
||||
/proc/vv_varname_lockcheck(param_var_name)
|
||||
if(param_var_name in VVlocked)
|
||||
if(param_var_name in GLOB.VVlocked)
|
||||
if(!check_rights(R_DEBUG))
|
||||
return FALSE
|
||||
if(param_var_name in VVckey_edit)
|
||||
if(param_var_name in GLOB.VVckey_edit)
|
||||
if(!check_rights(R_EVENT | R_DEBUG))
|
||||
return FALSE
|
||||
if(param_var_name in VVicon_edit_lock)
|
||||
if(param_var_name in GLOB.VVicon_edit_lock)
|
||||
if(!check_rights(R_EVENT | R_DEBUG))
|
||||
return FALSE
|
||||
if(param_var_name in VVpixelmovement)
|
||||
if(param_var_name in GLOB.VVpixelmovement)
|
||||
if(!check_rights(R_DEBUG))
|
||||
return FALSE
|
||||
var/prompt = alert(usr, "Editing this var may irreparably break tile gliding for the rest of the round. THIS CAN'T BE UNDONE", "DANGER", "ABORT ", "Continue", " ABORT")
|
||||
|
||||
@@ -177,11 +177,11 @@ client/proc/one_click_antag()
|
||||
H = pick(candidates)
|
||||
SSticker.mode.add_cultist(H.mind)
|
||||
candidates.Remove(H)
|
||||
if(!summon_spots.len)
|
||||
while(summon_spots.len < SUMMON_POSSIBILITIES)
|
||||
var/area/summon = pick(return_sorted_areas() - summon_spots)
|
||||
if(!GLOB.summon_spots.len)
|
||||
while(GLOB.summon_spots.len < SUMMON_POSSIBILITIES)
|
||||
var/area/summon = pick(return_sorted_areas() - GLOB.summon_spots)
|
||||
if(summon && is_station_level(summon.z) && summon.valid_territory)
|
||||
summon_spots += summon
|
||||
GLOB.summon_spots += summon
|
||||
|
||||
return 1
|
||||
return 0
|
||||
@@ -379,7 +379,7 @@ client/proc/one_click_antag()
|
||||
if(!G_found || !G_found.key) return
|
||||
|
||||
//First we spawn a dude.
|
||||
var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned.
|
||||
var/mob/living/carbon/human/new_character = new(pick(GLOB.latejoin))//The mob being spawned.
|
||||
|
||||
var/datum/preferences/A = new(G_found.client)
|
||||
A.copy_to(new_character)
|
||||
@@ -513,7 +513,7 @@ client/proc/one_click_antag()
|
||||
//Now apply cortical stack.
|
||||
var/obj/item/implant/cortical/I = new(new_vox)
|
||||
I.implant(new_vox)
|
||||
cortical_stacks += I
|
||||
GLOB.cortical_stacks += I
|
||||
|
||||
new_vox.equip_vox_raider()
|
||||
new_vox.regenerate_icons()
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
message_admins("[key_name_admin(usr)] used THERE CAN BE ONLY ONE! -NO ATTACK LOGS WILL BE SENT TO ADMINS FROM THIS POINT FORTH-", 1)
|
||||
log_admin("[key_name(usr)] used there can be only one.")
|
||||
nologevent = 1
|
||||
GLOB.nologevent = 1
|
||||
world << sound('sound/music/thunderdome.ogg')
|
||||
|
||||
/client/proc/only_me()
|
||||
@@ -100,5 +100,5 @@
|
||||
|
||||
message_admins("[key_name_admin(usr)] used THERE CAN BE ONLY ME! -NO ATTACK LOGS WILL BE SENT TO ADMINS FROM THIS POINT FORTH-", 1)
|
||||
log_admin("[key_name(usr)] used there can be only me.")
|
||||
nologevent = 1
|
||||
GLOB.nologevent = 1
|
||||
world << sound('sound/music/thunderdome.ogg')
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes)
|
||||
|
||||
if(!team_toggle)
|
||||
team_alpha += H
|
||||
GLOB.team_alpha += H
|
||||
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/red/dodgeball(H), slot_w_uniform)
|
||||
var/obj/item/card/id/W = new(H)
|
||||
@@ -42,7 +42,7 @@
|
||||
H.equip_to_slot_or_del(W, slot_wear_id)
|
||||
|
||||
else
|
||||
team_bravo += H
|
||||
GLOB.team_bravo += H
|
||||
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/blue/dodgeball(H), slot_w_uniform)
|
||||
var/obj/item/card/id/W = new(H)
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
message_admins("[key_name_admin(usr)] used DODGEBAWWWWWWWL! -NO ATTACK LOGS WILL BE SENT TO ADMINS FROM THIS POINT FORTH-", 1)
|
||||
log_admin("[key_name(usr)] used dodgeball.")
|
||||
nologevent = 1
|
||||
GLOB.nologevent = 1
|
||||
|
||||
/obj/item/beach_ball/dodgeball
|
||||
name = "dodgeball"
|
||||
@@ -76,13 +76,13 @@
|
||||
if(H.r_hand == src) return
|
||||
if(H.l_hand == src) return
|
||||
var/mob/A = H.LAssailant
|
||||
if((H in team_alpha) && (A in team_alpha))
|
||||
if((H in GLOB.team_alpha) && (A in GLOB.team_alpha))
|
||||
to_chat(A, "<span class='warning'>He's on your team!</span>")
|
||||
return
|
||||
else if((H in team_bravo) && (A in team_bravo))
|
||||
else if((H in GLOB.team_bravo) && (A in GLOB.team_bravo))
|
||||
to_chat(A, "<span class='warning'>He's on your team!</span>")
|
||||
return
|
||||
else if(!A in team_alpha && !A in team_bravo)
|
||||
else if(!A in GLOB.team_alpha && !A in GLOB.team_bravo)
|
||||
to_chat(A, "<span class='warning'>You're not part of the dodgeball game, sorry!</span>")
|
||||
return
|
||||
else
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var/list/sounds_cache = list()
|
||||
GLOBAL_LIST_EMPTY(sounds_cache)
|
||||
|
||||
/client/proc/stop_global_admin_sounds()
|
||||
set category = "Event"
|
||||
@@ -21,7 +21,7 @@ var/list/sounds_cache = list()
|
||||
var/sound/uploaded_sound = sound(S, repeat = 0, wait = 1, channel = CHANNEL_ADMIN)
|
||||
uploaded_sound.priority = 250
|
||||
|
||||
sounds_cache += S
|
||||
GLOB.sounds_cache += S
|
||||
|
||||
if(alert("Are you sure?\nSong: [S]\nNow you can also play this sound using \"Play Server Sound\".", "Confirmation request" ,"Play", "Cancel") == "Cancel")
|
||||
return
|
||||
@@ -54,7 +54,7 @@ var/list/sounds_cache = list()
|
||||
if(!check_rights(R_SOUNDS)) return
|
||||
|
||||
var/list/sounds = file2list("sound/serversound_list.txt");
|
||||
sounds += sounds_cache
|
||||
sounds += GLOB.sounds_cache
|
||||
|
||||
var/melody = input("Select a sound from the server to play", "Server sound list") as null|anything in sounds
|
||||
if(!melody) return
|
||||
@@ -72,7 +72,7 @@ var/list/sounds_cache = list()
|
||||
if(A != "Yep") return
|
||||
|
||||
var/list/sounds = file2list("sound/serversound_list.txt");
|
||||
sounds += sounds_cache
|
||||
sounds += GLOB.sounds_cache
|
||||
|
||||
var/melody = input("Select a sound from the server to play", "Server sound list") as null|anything in sounds
|
||||
if(!melody) return
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
//teleport person to cell
|
||||
M.Paralyse(5)
|
||||
sleep(5) //so they black out before warping
|
||||
M.loc = pick(prisonwarp)
|
||||
M.loc = pick(GLOB.prisonwarp)
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/prisoner = M
|
||||
prisoner.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(prisoner), slot_w_uniform)
|
||||
@@ -361,8 +361,8 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if(G_found.mind.assigned_role=="Alien")
|
||||
if(alert("This character appears to have been an alien. Would you like to respawn them as such?",,"Yes","No")=="Yes")
|
||||
var/turf/T
|
||||
if(xeno_spawn.len) T = pick(xeno_spawn)
|
||||
else T = pick(latejoin)
|
||||
if(GLOB.xeno_spawn.len) T = pick(GLOB.xeno_spawn)
|
||||
else T = pick(GLOB.latejoin)
|
||||
|
||||
var/mob/living/carbon/alien/new_xeno
|
||||
switch(G_found.mind.special_role)//If they have a mind, we can determine which caste they were.
|
||||
@@ -381,14 +381,14 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] has respawned [new_xeno.key] as a filthy xeno.</span>", 1)
|
||||
return //all done. The ghost is auto-deleted
|
||||
|
||||
var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned.
|
||||
var/mob/living/carbon/human/new_character = new(pick(GLOB.latejoin))//The mob being spawned.
|
||||
|
||||
var/datum/data/record/record_found //Referenced to later to either randomize or not randomize the character.
|
||||
if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something
|
||||
/*Try and locate a record for the person being respawned through data_core.
|
||||
This isn't an exact science but it does the trick more often than not.*/
|
||||
var/id = md5("[G_found.real_name][G_found.mind.assigned_role]")
|
||||
for(var/datum/data/record/t in data_core.locked)
|
||||
for(var/datum/data/record/t in GLOB.data_core.locked)
|
||||
if(t.fields["id"]==id)
|
||||
record_found = t//We shall now reference the record.
|
||||
break
|
||||
@@ -446,7 +446,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
else
|
||||
new_character.mind.add_antag_datum(/datum/antagonist/traitor)
|
||||
if("Wizard")
|
||||
new_character.loc = pick(wizardstart)
|
||||
new_character.loc = pick(GLOB.wizardstart)
|
||||
//ticker.mode.learn_basic_spells(new_character)
|
||||
SSticker.mode.equip_wizard(new_character)
|
||||
if("Syndicate")
|
||||
@@ -481,7 +481,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if(!record_found && new_character.mind.assigned_role != new_character.mind.special_role)//If there are no records for them. If they have a record, this info is already in there. Offstation special characters announced anyway.
|
||||
//Power to the user!
|
||||
if(alert(new_character,"Warning: No data core entry detected. Would you like to announce the arrival of this character by adding them to various databases, such as medical records?",,"No","Yes")=="Yes")
|
||||
data_core.manifest_inject(new_character)
|
||||
GLOB.data_core.manifest_inject(new_character)
|
||||
|
||||
if(alert(new_character,"Would you like an active AI to announce this character?",,"No","Yes")=="Yes")
|
||||
call(/mob/new_player/proc/AnnounceArrival)(new_character, new_character.mind.assigned_role)
|
||||
@@ -511,7 +511,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if(!istext(ckey)) return 0
|
||||
|
||||
var/alien_caste = input(usr, "Please choose which caste to spawn.","Pick a caste",null) as null|anything in list("Queen","Hunter","Sentinel","Drone","Larva")
|
||||
var/obj/effect/landmark/spawn_here = xeno_spawn.len ? pick(xeno_spawn) : pick(latejoin)
|
||||
var/obj/effect/landmark/spawn_here = GLOB.xeno_spawn.len ? pick(GLOB.xeno_spawn) : pick(GLOB.latejoin)
|
||||
var/mob/living/carbon/alien/new_xeno
|
||||
switch(alien_caste)
|
||||
if("Queen") new_xeno = new /mob/living/carbon/alien/humanoid/queen/large(spawn_here)
|
||||
@@ -623,11 +623,11 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if("Yes")
|
||||
var/beepsound = input(usr, "What sound should the announcement make?", "Announcement Sound", "") as anything in MsgSound
|
||||
|
||||
command_announcement.Announce(input, customname, MsgSound[beepsound], , , type)
|
||||
GLOB.command_announcement.Announce(input, customname, MsgSound[beepsound], , , type)
|
||||
print_command_report(input, "[command_name()] Update")
|
||||
if("No")
|
||||
//same thing as the blob stuff - it's not public, so it's classified, dammit
|
||||
command_announcer.autosay("A classified message has been printed out at all communication consoles.");
|
||||
GLOB.command_announcer.autosay("A classified message has been printed out at all communication consoles.");
|
||||
print_command_report(input, "Classified [command_name()] Update")
|
||||
else
|
||||
return
|
||||
@@ -986,7 +986,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
else
|
||||
job_string = "-"
|
||||
key_string = H.key
|
||||
if(job_string in command_positions)
|
||||
if(job_string in GLOB.command_positions)
|
||||
job_string = "<U>" + job_string + "</U>"
|
||||
role_string = "-"
|
||||
obj_count = 0
|
||||
@@ -1025,7 +1025,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
else
|
||||
job_string = "-"
|
||||
key_string = H.key
|
||||
if(job_string in command_positions)
|
||||
if(job_string in GLOB.command_positions)
|
||||
job_string = "<U>" + job_string + "</U>"
|
||||
role_string = "-"
|
||||
obj_count = 0
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
|
||||
message_admins("[key_name_admin(usr)] re-assigned all space transitions")
|
||||
space_manager.do_transition_setup()
|
||||
GLOB.space_manager.do_transition_setup()
|
||||
log_admin("[key_name(usr)] re-assigned all space transitions")
|
||||
|
||||
feedback_add_details("admin_verb","SPCRST") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -37,5 +37,5 @@
|
||||
message_admins("[key_name_admin(usr)] made a space map")
|
||||
|
||||
|
||||
space_manager.map_as_turfs(get_turf(usr))
|
||||
GLOB.space_manager.map_as_turfs(get_turf(usr))
|
||||
log_admin("[key_name(usr)] made a space map")
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
//STRIKE TEAMS
|
||||
|
||||
#define COMMANDOS_POSSIBLE 6 //if more Commandos are needed in the future
|
||||
var/global/sent_strike_team = 0
|
||||
GLOBAL_VAR_INIT(sent_strike_team, 0)
|
||||
|
||||
/client/proc/strike_team()
|
||||
if(!SSticker)
|
||||
to_chat(usr, "<span class='userdanger'>The game hasn't started yet!</span>")
|
||||
return
|
||||
if(sent_strike_team == 1)
|
||||
if(GLOB.sent_strike_team == 1)
|
||||
to_chat(usr, "<span class='userdanger'>CentComm is already sending a team.</span>")
|
||||
return
|
||||
if(alert("Do you want to send in the CentComm death squad? Once enabled, this is irreversible.",,"Yes","No")!="Yes")
|
||||
@@ -23,7 +23,7 @@ var/global/sent_strike_team = 0
|
||||
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
|
||||
return
|
||||
|
||||
if(sent_strike_team)
|
||||
if(GLOB.sent_strike_team)
|
||||
to_chat(usr, "Looks like someone beat you to it.")
|
||||
return
|
||||
|
||||
@@ -37,12 +37,12 @@ var/global/sent_strike_team = 0
|
||||
break
|
||||
|
||||
// Find ghosts willing to be DS
|
||||
var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, COMMANDOS_POSSIBLE, "Join the DeathSquad?",, 21, 600, 1, role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE)
|
||||
var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, COMMANDOS_POSSIBLE, "Join the DeathSquad?",, 21, 600, 1, GLOB.role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE)
|
||||
if(!commando_ghosts.len)
|
||||
to_chat(usr, "<span class='userdanger'>Nobody volunteered to join the DeathSquad.</span>")
|
||||
return
|
||||
|
||||
sent_strike_team = 1
|
||||
GLOB.sent_strike_team = 1
|
||||
|
||||
// Spawns commandos and equips them.
|
||||
var/commando_number = COMMANDOS_POSSIBLE //for selecting a leader
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//STRIKE TEAMS
|
||||
|
||||
#define SYNDICATE_COMMANDOS_POSSIBLE 6 //if more Commandos are needed in the future
|
||||
var/global/sent_syndicate_strike_team = 0
|
||||
GLOBAL_VAR_INIT(sent_syndicate_strike_team, 0)
|
||||
/client/proc/syndicate_strike_team()
|
||||
set category = "Event"
|
||||
set name = "Spawn Syndicate Strike Team"
|
||||
@@ -12,7 +12,7 @@ var/global/sent_syndicate_strike_team = 0
|
||||
if(!SSticker)
|
||||
alert("The game hasn't started yet!")
|
||||
return
|
||||
if(sent_syndicate_strike_team == 1)
|
||||
if(GLOB.sent_syndicate_strike_team == 1)
|
||||
alert("The Syndicate are already sending a team, Mr. Dumbass.")
|
||||
return
|
||||
if(alert("Do you want to send in the Syndicate Strike Team? Once enabled, this is irreversible.",,"Yes","No")=="No")
|
||||
@@ -28,7 +28,7 @@ var/global/sent_syndicate_strike_team = 0
|
||||
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
|
||||
return
|
||||
|
||||
if(sent_syndicate_strike_team)
|
||||
if(GLOB.sent_syndicate_strike_team)
|
||||
to_chat(src, "Looks like someone beat you to it.")
|
||||
return
|
||||
|
||||
@@ -45,12 +45,12 @@ var/global/sent_syndicate_strike_team = 0
|
||||
break
|
||||
|
||||
// Find ghosts willing to be SST
|
||||
var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, SYNDICATE_COMMANDOS_POSSIBLE, "Join the Syndicate Strike Team?",, 21, 600, 1, role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE)
|
||||
var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, SYNDICATE_COMMANDOS_POSSIBLE, "Join the Syndicate Strike Team?",, 21, 600, 1, GLOB.role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE)
|
||||
if(!commando_ghosts.len)
|
||||
to_chat(usr, "<span class='userdanger'>Nobody volunteered to join the SST.</span>")
|
||||
return
|
||||
|
||||
sent_syndicate_strike_team = 1
|
||||
GLOB.sent_syndicate_strike_team = 1
|
||||
|
||||
//Spawns commandos and equips them.
|
||||
for(var/obj/effect/landmark/L in GLOB.landmarks_list)
|
||||
@@ -85,7 +85,7 @@ var/global/sent_syndicate_strike_team = 0
|
||||
|
||||
to_chat(new_syndicate_commando, "<span class='notice'>You are an Elite Syndicate [is_leader ? "<B>TEAM LEADER</B>" : "commando"] in the service of the Syndicate. \nYour current mission is: <span class='userdanger'>[input]</span></span>")
|
||||
new_syndicate_commando.faction += "syndicate"
|
||||
var/datum/atom_hud/antag/opshud = huds[ANTAG_HUD_OPS]
|
||||
var/datum/atom_hud/antag/opshud = GLOB.huds[ANTAG_HUD_OPS]
|
||||
opshud.join_hud(new_syndicate_commando.mind.current)
|
||||
set_antag_hud(new_syndicate_commando.mind.current, "hudoperative")
|
||||
new_syndicate_commando.regenerate_icons()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var/list/admin_verbs_show_debug_verbs = list(
|
||||
GLOBAL_LIST_INIT(admin_verbs_show_debug_verbs, list(
|
||||
/client/proc/camera_view,
|
||||
/client/proc/sec_camera_report,
|
||||
/client/proc/intercom_view,
|
||||
@@ -22,7 +22,7 @@ var/list/admin_verbs_show_debug_verbs = list(
|
||||
/client/proc/admin_redo_space_transitions,
|
||||
/client/proc/make_turf_space_map,
|
||||
/client/proc/vv_by_ref
|
||||
)
|
||||
))
|
||||
|
||||
// Would be nice to make this a permanent admin pref so we don't need to click it each time
|
||||
/client/proc/enable_debug_verbs()
|
||||
@@ -32,6 +32,6 @@ var/list/admin_verbs_show_debug_verbs = list(
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
|
||||
verbs += admin_verbs_show_debug_verbs
|
||||
verbs += GLOB.admin_verbs_show_debug_verbs
|
||||
|
||||
feedback_add_details("admin_verb","mDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var/global/vox_tick = 1
|
||||
GLOBAL_VAR_INIT(vox_tick, 1)
|
||||
|
||||
/mob/living/carbon/human/proc/equip_vox_raider()
|
||||
|
||||
@@ -10,7 +10,7 @@ var/global/vox_tick = 1
|
||||
equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/vox(src), slot_shoes) // REPLACE THESE WITH CODED VOX ALTERNATIVES.
|
||||
equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow/vox(src), slot_gloves) // AS ABOVE.
|
||||
|
||||
switch(vox_tick)
|
||||
switch(GLOB.vox_tick)
|
||||
if(1) // Vox raider!
|
||||
equip_to_slot_or_del(new /obj/item/clothing/suit/space/vox/carapace(src), slot_wear_suit)
|
||||
equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/vox/carapace(src), slot_head)
|
||||
@@ -59,7 +59,7 @@ var/global/vox_tick = 1
|
||||
W.registered_user = src
|
||||
equip_to_slot_or_del(W, slot_wear_id)
|
||||
|
||||
vox_tick++
|
||||
if(vox_tick > 4) vox_tick = 1
|
||||
GLOB.vox_tick++
|
||||
if(GLOB.vox_tick > 4) GLOB.vox_tick = 1
|
||||
|
||||
return 1
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
if(!new_ckey)
|
||||
return
|
||||
new_ckey = sanitizeSQL(new_ckey)
|
||||
var/DBQuery/query_watchfind = dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ckey = '[new_ckey]'")
|
||||
var/DBQuery/query_watchfind = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ckey = '[new_ckey]'")
|
||||
if(!query_watchfind.Execute())
|
||||
var/err = query_watchfind.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining ckey from player table. Error : \[[err]\]\n")
|
||||
@@ -29,7 +29,7 @@
|
||||
if(!adminckey)
|
||||
return
|
||||
var/admin_sql_ckey = sanitizeSQL(adminckey)
|
||||
var/DBQuery/query_watchadd = dbcon.NewQuery("INSERT INTO [format_table_name("watch")] (ckey, reason, adminckey, timestamp) VALUES ('[target_sql_ckey]', '[reason]', '[admin_sql_ckey]', '[timestamp]')")
|
||||
var/DBQuery/query_watchadd = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("watch")] (ckey, reason, adminckey, timestamp) VALUES ('[target_sql_ckey]', '[reason]', '[admin_sql_ckey]', '[timestamp]')")
|
||||
if(!query_watchadd.Execute())
|
||||
var/err = query_watchadd.ErrorMsg()
|
||||
log_game("SQL ERROR during adding new watch entry. Error : \[[err]\]\n")
|
||||
@@ -43,7 +43,7 @@
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
var/target_sql_ckey = sanitizeSQL(target_ckey)
|
||||
var/DBQuery/query_watchdel = dbcon.NewQuery("DELETE FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'")
|
||||
var/DBQuery/query_watchdel = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'")
|
||||
if(!query_watchdel.Execute())
|
||||
var/err = query_watchdel.ErrorMsg()
|
||||
log_game("SQL ERROR during removing watch entry. Error : \[[err]\]\n")
|
||||
@@ -57,7 +57,7 @@
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
var/target_sql_ckey = sanitizeSQL(target_ckey)
|
||||
var/DBQuery/query_watchreason = dbcon.NewQuery("SELECT reason FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'")
|
||||
var/DBQuery/query_watchreason = GLOB.dbcon.NewQuery("SELECT reason FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'")
|
||||
if(!query_watchreason.Execute())
|
||||
var/err = query_watchreason.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining reason from watch table. Error : \[[err]\]\n")
|
||||
@@ -71,7 +71,7 @@
|
||||
var/sql_ckey = sanitizeSQL(usr.ckey)
|
||||
var/edit_text = "Edited by [sql_ckey] on [SQLtime()] from \"[watch_reason]\" to \"[new_reason]\""
|
||||
edit_text = sanitizeSQL(edit_text)
|
||||
var/DBQuery/query_watchupdate = dbcon.NewQuery("UPDATE [format_table_name("watch")] SET reason = '[new_reason]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE ckey = '[target_sql_ckey]'")
|
||||
var/DBQuery/query_watchupdate = GLOB.dbcon.NewQuery("UPDATE [format_table_name("watch")] SET reason = '[new_reason]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE ckey = '[target_sql_ckey]'")
|
||||
if(!query_watchupdate.Execute())
|
||||
var/err = query_watchupdate.ErrorMsg()
|
||||
log_game("SQL ERROR editing watchlist reason. Error : \[[err]\]\n")
|
||||
@@ -96,7 +96,7 @@
|
||||
else
|
||||
search = "^."
|
||||
search = sanitizeSQL(search)
|
||||
var/DBQuery/query_watchlist = dbcon.NewQuery("SELECT ckey, reason, adminckey, timestamp, last_editor FROM [format_table_name("watch")] WHERE ckey REGEXP '[search]' ORDER BY ckey")
|
||||
var/DBQuery/query_watchlist = GLOB.dbcon.NewQuery("SELECT ckey, reason, adminckey, timestamp, last_editor FROM [format_table_name("watch")] WHERE ckey REGEXP '[search]' ORDER BY ckey")
|
||||
if(!query_watchlist.Execute())
|
||||
var/err = query_watchlist.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining ckey, reason, adminckey, timestamp, last_editor from watch table. Error : \[[err]\]\n")
|
||||
@@ -115,7 +115,7 @@
|
||||
|
||||
/proc/check_watchlist(target_ckey)
|
||||
var/target_sql_ckey = sanitizeSQL(target_ckey)
|
||||
var/DBQuery/query_watch = dbcon.NewQuery("SELECT reason FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'")
|
||||
var/DBQuery/query_watch = GLOB.dbcon.NewQuery("SELECT reason FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'")
|
||||
if(!query_watch.Execute())
|
||||
var/err = query_watch.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining reason from watch table. Error : \[[err]\]\n")
|
||||
|
||||
Reference in New Issue
Block a user