More globals (#19247)

* More globals

* planets

* .

* .

* Update jukebox.dm

* Fix timer callback syntax in jukebox.dm

* .
This commit is contained in:
Kashargul
2026-03-15 02:54:17 -04:00
committed by GitHub
parent 24d023dfa8
commit 72628d226c
210 changed files with 941 additions and 990 deletions
+86 -84
View File
@@ -1,61 +1,61 @@
var/CMinutes = null
var/savefile/Banlist
GLOBAL_VAR_INIT(c_minutes, 0)
GLOBAL_DATUM(banlist, /savefile)
/proc/CheckBan(var/ckey, var/id, var/address)
if(!Banlist) // if Banlist cannot be located for some reason
if(!GLOB.banlist) // if Banlist cannot be located for some reason
LoadBans() // try to load the bans
if(!Banlist) // uh oh, can't find bans!
if(!GLOB.banlist) // uh oh, can't find bans!
return 0 // ABORT ABORT ABORT
. = list()
var/appeal
if(config && CONFIG_GET(string/banappeals))
appeal = "\nFor more information on your ban, or to appeal, head to <a href='[CONFIG_GET(string/banappeals)]'>[CONFIG_GET(string/banappeals)]</a>"
Banlist.cd = "/base"
if( "[ckey][id]" in Banlist.dir )
Banlist.cd = "[ckey][id]"
if (Banlist["temp"])
if (!GetExp(Banlist["minutes"]))
GLOB.banlist.cd = "/base"
if( "[ckey][id]" in GLOB.banlist.dir )
GLOB.banlist.cd = "[ckey][id]"
if (GLOB.banlist["temp"])
if (!GetExp(GLOB.banlist["minutes"]))
ClearTempbans()
return 0
else
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]"
.["desc"] = "\nReason: [GLOB.banlist["reason"]]\nExpires: [GetExp(GLOB.banlist["minutes"])]\nBy: [GLOB.banlist["bannedby"]][appeal]"
else
Banlist.cd = "/base/[ckey][id]"
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: <B>PERMANENT</B>\nBy: [Banlist["bannedby"]][appeal]"
GLOB.banlist.cd = "/base/[ckey][id]"
.["desc"] = "\nReason: [GLOB.banlist["reason"]]\nExpires: <B>PERMANENT</B>\nBy: [GLOB.banlist["bannedby"]][appeal]"
.["reason"] = "ckey/id"
return .
else
for (var/A in Banlist.dir)
Banlist.cd = "/base/[A]"
for (var/A in GLOB.banlist.dir)
GLOB.banlist.cd = "/base/[A]"
var/matches
if( ckey == Banlist["key"] )
if( ckey == GLOB.banlist["key"] )
matches += "ckey"
if( id == Banlist["id"] )
if( id == GLOB.banlist["id"] )
if(matches)
matches += "/"
matches += "id"
if( address == Banlist["ip"] )
if( address == GLOB.banlist["ip"] )
if(matches)
matches += "/"
matches += "ip"
if(matches)
if(Banlist["temp"])
if (!GetExp(Banlist["minutes"]))
if(GLOB.banlist["temp"])
if (!GetExp(GLOB.banlist["minutes"]))
ClearTempbans()
return 0
else
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]"
.["desc"] = "\nReason: [GLOB.banlist["reason"]]\nExpires: [GetExp(GLOB.banlist["minutes"])]\nBy: [GLOB.banlist["bannedby"]][appeal]"
else
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: <B>PERMANENT</B>\nBy: [Banlist["bannedby"]][appeal]"
.["desc"] = "\nReason: [GLOB.banlist["reason"]]\nExpires: <B>PERMANENT</B>\nBy: [GLOB.banlist["bannedby"]][appeal]"
.["reason"] = matches
return .
return 0
/proc/UpdateTime() //No idea why i made this a proc.
CMinutes = (world.realtime / 10) / 60
GLOB.c_minutes = (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 = new("data/banlist.bdb")
log_admin("Loading Banlist")
if (!length(Banlist.dir)) log_admin("Banlist is empty.")
if (!length(GLOB.banlist.dir)) log_admin("Banlist is empty.")
if (!Banlist.dir.Find("base"))
if (!GLOB.banlist.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.dir.Add("base")
GLOB.banlist.cd = "/base"
else if (GLOB.banlist.dir.Find("base"))
GLOB.banlist.cd = "/base"
ClearTempbans()
return 1
@@ -81,17 +81,19 @@ 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.cd = "/base"
for (var/A in GLOB.banlist.dir)
GLOB.banlist.cd = "/base/[A]"
if (!GLOB.banlist["key"] || !GLOB.banlist["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["temp"])
continue
if (GLOB.c_minutes >= GLOB.banlist["minutes"])
RemoveBan(A)
return 1
@@ -102,23 +104,23 @@ var/savefile/Banlist
if (temp)
UpdateTime()
bantimestamp = CMinutes + minutes
bantimestamp = GLOB.c_minutes + minutes
Banlist.cd = "/base"
if ( Banlist.dir.Find("[ckey][computerid]") )
GLOB.banlist.cd = "/base"
if ( GLOB.banlist.dir.Find("[ckey][computerid]") )
to_chat(usr, span_filter_adminlog(span_warning("Ban already exists.")))
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.dir.Add("[ckey][computerid]")
GLOB.banlist.cd = "/base/[ckey][computerid]"
GLOB.banlist["key"] << ckey
GLOB.banlist["id"] << computerid
GLOB.banlist["ip"] << address
GLOB.banlist["reason"] << reason
GLOB.banlist["bannedby"] << bannedby
GLOB.banlist["temp"] << temp
if (temp)
Banlist["minutes"] << bantimestamp
GLOB.banlist["minutes"] << bantimestamp
admin_action_message(bannedby, ckey, "banned", reason, temp ? minutes : -1) //VOREStation Add
return 1
@@ -126,12 +128,12 @@ var/savefile/Banlist
var/key
var/id
Banlist.cd = "/base/[foldername]"
Banlist["key"] >> key
Banlist["id"] >> id
Banlist.cd = "/base"
GLOB.banlist.cd = "/base/[foldername]"
GLOB.banlist["key"] >> key
GLOB.banlist["id"] >> id
GLOB.banlist.cd = "/base"
if (!Banlist.dir.Remove(foldername)) return 0
if (!GLOB.banlist.dir.Remove(foldername)) return 0
if(!usr)
log_admin("Ban Expired: [key]")
@@ -142,18 +144,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.dir)
GLOB.banlist.cd = "/base/[A]"
if (key == GLOB.banlist["key"] /*|| id == GLOB.banlist["id"]*/)
GLOB.banlist.cd = "/base"
GLOB.banlist.dir.Remove(A)
continue
admin_action_message(usr.key, key, "unbanned", "\[Unban\]", 0) //VOREStation Add
return 1
/proc/GetExp(minutes as num)
UpdateTime()
var/exp = minutes - CMinutes
var/exp = minutes - GLOB.c_minutes
if (exp <= 0)
return 0
else
@@ -170,19 +172,19 @@ var/savefile/Banlist
var/count = 0
var/dat
//var/dat = "<HR>" + span_bold("Unban Player:") + " " + span_blue("(U) = Unban") + " , (E) = Edit Ban " + span_green("(Total<HR><table border=1 rules=all frame=void cellspacing=0 cellpadding=3 >")
Banlist.cd = "/base"
for (var/A in Banlist.dir)
GLOB.banlist.cd = "/base"
for (var/A in GLOB.banlist.dir)
count++
Banlist.cd = "/base/[A]"
GLOB.banlist.cd = "/base/[A]"
var/ref = "\ref[src]"
var/key = Banlist["key"]
var/id = Banlist["id"]
var/ip = Banlist["ip"]
var/reason = Banlist["reason"]
var/by = Banlist["bannedby"]
var/key = GLOB.banlist["key"]
var/id = GLOB.banlist["id"]
var/ip = GLOB.banlist["ip"]
var/reason = GLOB.banlist["reason"]
var/by = GLOB.banlist["bannedby"]
var/expiry
if(Banlist["temp"])
expiry = GetExp(Banlist["minutes"])
if(GLOB.banlist["temp"])
expiry = GetExp(GLOB.banlist["minutes"])
if(!expiry) expiry = "Removal Pending"
else expiry = "Permaban"
@@ -208,25 +210,25 @@ 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]"
to_chat(Banlist["key"], "trash[i]")
GLOB.banlist.cd = "/base"
GLOB.banlist.dir.Add("trash[i]trashid[i]")
GLOB.banlist.cd = "/base/trash[i]trashid[i]"
to_chat(GLOB.banlist["key"], "trash[i]")
else
Banlist.cd = "/base"
Banlist.dir.Add("[last]trashid[i]")
Banlist.cd = "/base/[last]trashid[i]"
Banlist["key"] << last
to_chat(Banlist["id"], "trashid[i]")
to_chat(Banlist["reason"], "Trashban[i].")
Banlist["temp"] << a
Banlist["minutes"] << CMinutes + rand(1,2000)
to_chat(Banlist["bannedby"], "trashmin")
GLOB.banlist.cd = "/base"
GLOB.banlist.dir.Add("[last]trashid[i]")
GLOB.banlist.cd = "/base/[last]trashid[i]"
GLOB.banlist["key"] << last
to_chat(GLOB.banlist["id"], "trashid[i]")
to_chat(GLOB.banlist["reason"], "Trashban[i].")
GLOB.banlist["temp"] << a
GLOB.banlist["minutes"] << GLOB.c_minutes + rand(1,2000)
to_chat(GLOB.banlist["bannedby"], "trashmin")
last = "trash[i]"
Banlist.cd = "/base"
GLOB.banlist.cd = "/base"
/proc/ClearAllBans()
Banlist.cd = "/base"
for (var/A in Banlist.dir)
GLOB.banlist.cd = "/base"
for (var/A in GLOB.banlist.dir)
RemoveBan(A)
+10 -10
View File
@@ -554,7 +554,7 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_HOLDER, "Show Player Panel", m
if(!check_rights(R_BAN)) return
var/dat = span_bold("Job Bans!") + "<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
@@ -647,8 +647,8 @@ ADMIN_VERB(restart, R_SERVER, "Reboot World", "Restarts the world immediately.",
return
feedback_add_details("admin_verb","R")
if(blackbox)
blackbox.save_all_data_to_sql()
if(GLOB.blackbox)
GLOB.blackbox.save_all_data_to_sql()
var/init_by = "Initiated by [user.holder.fakekey ? "Admin" : user.key]."
switch(result)
@@ -1109,11 +1109,11 @@ ADMIN_VERB(toggle_space_ninja, R_FUN|R_SERVER, "Toggle Space Ninjas", "Toggle sp
if(!check_rights(R_SPAWN)) return
var/owner = tgui_input_list(usr, "Select a ckey.", "Spawn Custom Item", custom_items)
if(!owner|| !custom_items[owner])
var/owner = tgui_input_list(usr, "Select a ckey.", "Spawn Custom Item", GLOB.custom_items)
if(!owner|| !GLOB.custom_items[owner])
return
var/list/possible_items = custom_items[owner]
var/list/possible_items = GLOB.custom_items[owner]
var/datum/custom_item/item_to_spawn = tgui_input_list(usr, "Select an item to spawn.", "Spawn Custom Item", possible_items)
if(!item_to_spawn)
return
@@ -1127,17 +1127,17 @@ ADMIN_VERB(toggle_space_ninja, R_FUN|R_SERVER, "Toggle Space Ninjas", "Toggle sp
if(!check_rights(R_SPAWN)) return
if(!custom_items)
if(!GLOB.custom_items)
to_chat(usr, "Custom item list is null.")
return
if(!custom_items.len)
if(!length(GLOB.custom_items))
to_chat(usr, "Custom item list not populated.")
return
for(var/assoc_key in custom_items)
for(var/assoc_key in GLOB.custom_items)
to_chat(usr, "[assoc_key] has:")
var/list/current_items = custom_items[assoc_key]
var/list/current_items = GLOB.custom_items[assoc_key]
for(var/datum/custom_item/item in current_items)
to_chat(usr, "- name: [item.name] icon: [item.item_icon] path: [item.item_path] desc: [item.item_desc]")
+16 -16
View File
@@ -1,16 +1,16 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
var/jobban_runonce // Updates legacy bans with new info
var/jobban_keylist[0] //to store the keys & ranks
GLOBAL_VAR(jobban_runonce) // Updates legacy bans with new info
GLOBAL_LIST_EMPTY(jobban_keylist) //to store the keys & ranks
/proc/jobban_fullban(mob/M, rank, reason)
if (!M || !M.key) return
jobban_keylist.Add(text("[M.ckey] - [rank] ## [reason]"))
GLOB.jobban_keylist += "[M.ckey] - [rank] ## [reason]"
jobban_savebanfile()
/proc/jobban_client_fullban(ckey, rank)
if (!ckey || !rank) return
jobban_keylist.Add(text("[ckey] - [rank]"))
GLOB.jobban_keylist += "[ckey] - [rank]"
jobban_savebanfile()
//returns a reason if M is banned from rank, returns 0 otherwise
@@ -30,7 +30,7 @@ var/jobban_keylist[0] //to store the keys & ranks
return 0
/proc/ckey_is_jobbanned(var/check_key, var/rank)
for(var/s in jobban_keylist)
for(var/s in GLOB.jobban_keylist)
if(findtext(s,"[check_key] - [rank]") == 1 )
var/startpos = findtext(s, "## ")+3
if(startpos && startpos<length(s))
@@ -45,7 +45,7 @@ DEBUG
/mob/verb/list_all_jobbans()
set name = "list all jobbans"
for(var/s in jobban_keylist)
for(var/s in GLOB.jobban_keylist)
to_world(s)
/mob/verb/reload_jobbans()
@@ -61,12 +61,12 @@ DEBUG
/proc/jobban_loadbanfile()
if(CONFIG_GET(flag/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")
else
if(!establish_db_connection())
@@ -83,7 +83,7 @@ DEBUG
var/ckey = query.item[1]
var/job = query.item[2]
jobban_keylist.Add("[ckey] - [job]")
GLOB.jobban_keylist += "[ckey] - [job]"
qdel(query)
//Job tempbans
@@ -94,12 +94,12 @@ DEBUG
var/ckey = query1.item[1]
var/job = query1.item[2]
jobban_keylist.Add("[ckey] - [job]")
GLOB.jobban_keylist += "[ckey] - [job]"
qdel(query1)
/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]")
@@ -111,9 +111,9 @@ DEBUG
/proc/jobban_remove(X)
for (var/i = 1; i <= length(jobban_keylist); i++)
if( findtext(jobban_keylist[i], "[X]") )
jobban_keylist.Remove(jobban_keylist[i])
for (var/i = 1; i <= length(GLOB.jobban_keylist); i++)
if( findtext(GLOB.jobban_keylist[i], "[X]") )
GLOB.jobban_keylist.Remove(GLOB.jobban_keylist[i])
jobban_savebanfile()
return 1
return 0
+64 -62
View File
@@ -15,7 +15,7 @@
#define RANK_DETECTIVE_HOS "Detective_HoS"
#define RANK_VIROLOGIST_RD_CMO "Virologist_RD_CMO"
var/savefile/Banlistjob
GLOBAL_DATUM(banlistjob, /savefile)
/proc/_jobban_isbanned(var/client/clientvar, var/rank)
@@ -26,30 +26,31 @@ var/savefile/Banlistjob
if (guest_jobbans(rank))
if(config.guest_jobban && IsGuestKey(key))
return 1
Banlistjob.cd = "/base"
if (Banlistjob.dir.Find("[key][id][rank]"))
GLOB.banlistjob.cd = "/base"
if (GLOB.banlistjob.dir.Find("[key][id][rank]"))
return 1
Banlistjob.cd = "/base"
for (var/A in Banlistjob.dir)
Banlistjob.cd = "/base/[A]"
if ((id == Banlistjob["id"] || key == Banlistjob["key"]) && rank == Banlistjob["rank"])
GLOB.banlistjob.cd = "/base"
for (var/A in GLOB.banlistjob.dir)
GLOB.banlistjob.cd = "/base/[A]"
if ((id == GLOB.banlistjob["id"] || key == GLOB.banlistjob["key"]) && rank == GLOB.banlistjob["rank"])
return 1
return 0
/proc/LoadBansjob()
Banlistjob = new("data/job_fullnew.bdb")
GLOB.banlistjob = new("data/job_fullnew.bdb")
log_admin("Loading Banlistjob")
if (!length(Banlistjob.dir)) log_admin("Banlistjob is empty.")
if (!length(GLOB.banlistjob.dir))
log_admin("Banlistjob is empty.")
if (!Banlistjob.dir.Find("base"))
if (!GLOB.banlistjob.dir.Find("base"))
log_admin("Banlistjob missing base dir.")
Banlistjob.dir.Add("base")
Banlistjob.cd = "/base"
else if (Banlistjob.dir.Find("base"))
Banlistjob.cd = "/base"
GLOB.banlistjob.dir.Add("base")
GLOB.banlistjob.cd = "/base"
else if (GLOB.banlistjob.dir.Find("base"))
GLOB.banlistjob.cd = "/base"
ClearTempbansjob()
return 1
@@ -57,17 +58,17 @@ var/savefile/Banlistjob
/proc/ClearTempbansjob()
UpdateTime()
Banlistjob.cd = "/base"
for (var/A in Banlistjob.dir)
Banlistjob.cd = "/base/[A]"
//if (!Banlistjob["key"] || !Banlistjob["id"])
GLOB.banlistjob.cd = "/base"
for (var/A in GLOB.banlistjob.dir)
GLOB.banlistjob.cd = "/base/[A]"
//if (!GLOB.banlistjob["key"] || !GLOB.banlistjob["id"])
// RemoveBanjob(A, "full")
// log_admin("Invalid Ban.")
// message_admins("Invalid Ban.")
// continue
if (!Banlistjob["temp"]) continue
if (CMinutes >= Banlistjob["minutes"]) RemoveBanjob(A)
if (!GLOB.banlistjob["temp"]) continue
if (CMinutes >= GLOB.banlistjob["minutes"]) RemoveBanjob(A)
return 1
@@ -156,21 +157,21 @@ var/savefile/Banlistjob
AddBanjob(ckey, computerid, reason, bannedby, temp, minutes, JOB_ALT_VIROLOGIST)
return 1
Banlistjob.cd = "/base"
if ( Banlistjob.dir.Find("[ckey][computerid][rank]") )
GLOB.banlistjob.cd = "/base"
if ( GLOB.banlistjob.dir.Find("[ckey][computerid][rank]") )
to_chat(usr, span_red("Banjob already exists."))
return 0
else
Banlistjob.dir.Add("[ckey][computerid][rank]")
Banlistjob.cd = "/base/[ckey][computerid][rank]"
Banlistjob["key"] << ckey
Banlistjob["id"] << computerid
Banlistjob["rank"] << rank
Banlistjob["reason"] << reason
Banlistjob["bannedby"] << bannedby
Banlistjob["temp"] << temp
GLOB.banlistjob.dir.Add("[ckey][computerid][rank]")
GLOB.banlistjob.cd = "/base/[ckey][computerid][rank]"
GLOB.banlistjob["key"] << ckey
GLOB.banlistjob["id"] << computerid
GLOB.banlistjob["rank"] << rank
GLOB.banlistjob["reason"] << reason
GLOB.banlistjob["bannedby"] << bannedby
GLOB.banlistjob["temp"] << temp
if (temp)
Banlistjob["minutes"] << bantimestamp
GLOB.banlistjob["minutes"] << bantimestamp
admin_action_message(bannedby, ckey, "jobbanned-"+rank, reason, temp ? minutes : -1) //VOREStation Add
return 1
@@ -178,13 +179,14 @@ var/savefile/Banlistjob
var/key
var/id
var/rank
Banlistjob.cd = "/base/[foldername]"
Banlistjob["key"] >> key
Banlistjob["id"] >> id
Banlistjob["rank"] >> rank
Banlistjob.cd = "/base"
GLOB.banlistjob.cd = "/base/[foldername]"
GLOB.banlistjob["key"] >> key
GLOB.banlistjob["id"] >> id
GLOB.banlistjob["rank"] >> rank
GLOB.banlistjob.cd = "/base"
if (!Banlistjob.dir.Remove(foldername)) return 0
if (!GLOB.banlistjob.dir.Remove(foldername))
return 0
if(!usr)
log_admin("Banjob Expired: [key]")
@@ -196,11 +198,11 @@ var/savefile/Banlistjob
feedback_inc("ban_job_unban",1)
feedback_add_details("ban_job_unban","- [rank]")
for (var/A in Banlistjob.dir)
Banlistjob.cd = "/base/[A]"
if ((key == Banlistjob["key"] || id == Banlistjob["id"]) && (rank == Banlistjob["rank"]))
Banlistjob.cd = "/base"
Banlistjob.dir.Remove(A)
for (var/A in GLOB.banlistjob.dir)
GLOB.banlistjob.cd = "/base/[A]"
if ((key == GLOB.banlistjob["key"] || id == GLOB.banlistjob["id"]) && (rank == GLOB.banlistjob["rank"]))
GLOB.banlistjob.cd = "/base"
GLOB.banlistjob.dir.Remove(A)
continue
admin_action_message(usr.key, key, "unjobbanned-"+rank, "\[Unban\]", 0) //VOREStation Add
return 1
@@ -224,11 +226,11 @@ var/savefile/Banlistjob
var/count = 0
var/dat
//var/dat = "<HR>" + span_bold("Unban Player: ") + span_blue("(U) = Unban , (E) = Edit Ban") + span_green("(Total<HR><table border=1 rules=all frame=void cellspacing=0 cellpadding=3 >")
Banlistjob.cd = "/base"
for (var/A in Banlistjob.dir)
GLOB.banlistjob.cd = "/base"
for (var/A in GLOB.banlistjob.dir)
count++
Banlistjob.cd = "/base/[A]"
dat += text("<tr><td><A href='byond://?src=\ref[src];[HrefToken()];unjobbanf=[Banlistjob["key"]][Banlistjob["id"]][Banlistjob["rank"]]'>(U)</A> Key: <B>[Banlistjob["key"]] </B>Rank: <B>[Banlistjob["rank"]]</B></td><td> ([Banlistjob["temp"] ? "[GetBanExpjob(Banlistjob["minutes"]) ? GetBanExpjob(Banlistjob["minutes"]) : "Removal pending" ]" : "Permaban"])</td><td>(By: [Banlistjob["bannedby"]])</td><td>(Reason: [Banlistjob["reason"]])</td></tr>")
GLOB.banlistjob.cd = "/base/[A]"
dat += text("<tr><td><A href='byond://?src=\ref[src];[HrefToken()];unjobbanf=[GLOB.banlistjob["key"]][GLOB.banlistjob["id"]][GLOB.banlistjob["rank"]]'>(U)</A> Key: <B>[GLOB.banlistjob["key"]] </B>Rank: <B>[GLOB.banlistjob["rank"]]</B></td><td> ([GLOB.banlistjob["temp"] ? "[GetBanExpjob(GLOB.banlistjob["minutes"]) ? GetBanExpjob(GLOB.banlistjob["minutes"]) : "Removal pending" ]" : "Permaban"])</td><td>(By: [GLOB.banlistjob["bannedby"]])</td><td>(Reason: [GLOB.banlistjob["reason"]])</td></tr>")
dat += "</table>"
dat = "<HR>" + span_bold("Bans:") + " " span_blue("(U) = Unban , ") + " - " + span_green("([count] Bans)") + "<HR><table border=1 rules=all frame=void cellspacing=0 cellpadding=3 >[dat]"
@@ -270,27 +272,27 @@ var/savefile/Banlistjob
var/a = pick(1,0)
var/b = pick(1,0)
if(b)
Banlistjob.cd = "/base"
Banlistjob.dir.Add("trash[i]trashid[i]")
Banlistjob.cd = "/base/trash[i]trashid[i]"
to_chat(Banlistjob["key"], "trash[i]")
GLOB.banlistjob.cd = "/base"
GLOB.banlistjob.dir.Add("trash[i]trashid[i]")
GLOB.banlistjob.cd = "/base/trash[i]trashid[i]"
to_chat(GLOB.banlistjob["key"], "trash[i]")
else
Banlistjob.cd = "/base"
Banlistjob.dir.Add("[last]trashid[i]")
Banlistjob.cd = "/base/[last]trashid[i]"
Banlistjob["key"] << last
to_chat(Banlistjob["id"], "trashid[i]")
to_chat(Banlistjob["reason"], "Trashban[i].")
Banlistjob["temp"] << a
Banlistjob["minutes"] << CMinutes + rand(1,2000)
to_chat(Banlistjob["bannedby"], "trashmin")
GLOB.banlistjob.cd = "/base"
GLOB.banlistjob.dir.Add("[last]trashid[i]")
GLOB.banlistjob.cd = "/base/[last]trashid[i]"
GLOB.banlistjob["key"] << last
to_chat(GLOB.banlistjob["id"], "trashid[i]")
to_chat(GLOB.banlistjob["reason"], "Trashban[i].")
GLOB.banlistjob["temp"] << a
GLOB.banlistjob["minutes"] << CMinutes + rand(1,2000)
to_chat(GLOB.banlistjob["bannedby"], "trashmin")
last = "trash[i]"
Banlistjob.cd = "/base"
GLOB.banlistjob.cd = "/base"
/proc/ClearAllBansjob()
Banlistjob.cd = "/base"
for (var/A in Banlistjob.dir)
GLOB.banlistjob.cd = "/base"
for (var/A in GLOB.banlistjob.dir)
RemoveBanjob(A, "full")
#undef RANK_HEADS
+21 -19
View File
@@ -176,11 +176,12 @@
/////////////////////////////////////new ban stuff
else if(href_list["unbanf"])
if(!check_rights(R_BAN)) return
if(!check_rights(R_BAN))
return
var/banfolder = href_list["unbanf"]
Banlist.cd = "/base/[banfolder]"
var/key = Banlist["key"]
GLOB.banlist.cd = "/base/[banfolder]"
var/key = GLOB.banlist["key"]
if(tgui_alert(usr, "Are you sure you want to unban [key]?", "Confirmation", list("Yes", "No")) == "Yes")
if(RemoveBan(banfolder))
unbanpanel()
@@ -192,20 +193,21 @@
usr.client.warn(href_list["warn"])
else if(href_list["unbane"])
if(!check_rights(R_BAN)) return
if(!check_rights(R_BAN))
return
UpdateTime()
var/reason
var/banfolder = href_list["unbane"]
Banlist.cd = "/base/[banfolder]"
var/reason2 = Banlist["reason"]
var/temp = Banlist["temp"]
GLOB.banlist.cd = "/base/[banfolder]"
var/reason2 = GLOB.banlist["reason"]
var/temp = GLOB.banlist["temp"]
var/minutes = Banlist["minutes"]
var/minutes = GLOB.banlist["minutes"]
var/banned_key = Banlist["key"]
Banlist.cd = "/base"
var/banned_key = GLOB.banlist["key"]
GLOB.banlist.cd = "/base"
var/duration
@@ -215,12 +217,12 @@
if("Yes")
temp = 1
var/mins = 0
if(minutes > CMinutes)
mins = minutes - CMinutes
if(minutes > GLOB.c_minutes)
mins = minutes - GLOB.c_minutes
mins = tgui_input_number(usr,"How long (in minutes)? (Default: 1440)","Ban time",mins ? mins : 1440)
if(!mins) return
mins = min(525599,mins)
minutes = CMinutes + mins
minutes = GLOB.c_minutes + mins
duration = GetExp(minutes)
reason = tgui_input_text(usr,"Reason?","reason",reason2, MAX_MESSAGE_LEN)
if(!reason) return
@@ -233,12 +235,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_blue("[key_name_admin(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]"), 1)
Banlist.cd = "/base/[banfolder]"
Banlist["reason"] << reason
Banlist["temp"] << temp
Banlist["minutes"] << minutes
Banlist["bannedby"] << usr.ckey
Banlist.cd = "/base"
GLOB.banlist.cd = "/base/[banfolder]"
GLOB.banlist["reason"] << reason
GLOB.banlist["temp"] << temp
GLOB.banlist["minutes"] << minutes
GLOB.banlist["bannedby"] << usr.ckey
GLOB.banlist.cd = "/base"
feedback_inc("ban_edit",1)
unbanpanel()
@@ -1,5 +1,5 @@
var/checked_for_inactives = 0
var/inactive_keys = "None<br>"
GLOBAL_VAR_INIT(checked_for_inactives, FALSE)
GLOBAL_VAR_INIT(inactive_keys, "None<br>")
/client/proc/check_customitem_activity()
set category = "Admin.Investigate"
@@ -14,8 +14,8 @@ var/inactive_keys = "None<br>"
dat += "Populating this list is done automatically, but must be manually triggered on a per\
round basis. Populating the list may cause a lag spike, so use it sparingly.<br>"
dat += "<hr>"
if(checked_for_inactives)
dat += inactive_keys
if(GLOB.checked_for_inactives)
dat += GLOB.inactive_keys
dat += "<hr>"
dat += "This system was implemented on March 1 2013, and the database a few days before that. Root server access is required to add or disable access to specific custom items.<br>"
else
@@ -28,7 +28,7 @@ var/inactive_keys = "None<br>"
/proc/populate_inactive_customitems_list(var/client/C)
set background = 1
if(checked_for_inactives)
if(GLOB.checked_for_inactives)
return
establish_db_connection()
@@ -77,13 +77,13 @@ var/inactive_keys = "None<br>"
qdel(query_inactive)
if(inactive_ckeys.len)
inactive_keys = ""
GLOB.inactive_keys = ""
for(var/cur_key in inactive_ckeys)
if(inactive_ckeys[cur_key])
inactive_keys += span_bold("[cur_key]") + " - [inactive_ckeys[cur_key]]<br>"
GLOB.inactive_keys += span_bold("[cur_key]") + " - [inactive_ckeys[cur_key]]<br>"
else
inactive_keys += "[cur_key] - no database entry<br>"
GLOB.inactive_keys += "[cur_key] - no database entry<br>"
checked_for_inactives = 1
GLOB.checked_for_inactives = TRUE
if(C)
C.check_customitem_activity()
+2 -2
View File
@@ -173,7 +173,7 @@
set category = "Debug.Investigate"
to_chat(usr, span_bold("Jobbans active in this round."))
for(var/t in jobban_keylist)
for(var/t in GLOB.jobban_keylist)
to_chat(usr, "[t]")
/client/proc/print_jobban_old_filter()
@@ -186,6 +186,6 @@
return
to_chat(usr, span_bold("Jobbans active in this round."))
for(var/t in jobban_keylist)
for(var/t in GLOB.jobban_keylist)
if(findtext(t, job_filter))
to_chat(usr, "[t]")
+3 -3
View File
@@ -241,7 +241,7 @@ ADMIN_VERB(cmd_admin_add_random_ai_law, R_ADMIN|R_FUN, "Add Random AI Law", "Add
if(!show_log)
return
if(show_log == "Yes")
command_announcement.Announce("Ion storm detected near \the [station_name()]. Please check all AI-controlled equipment for errors.", "Anomaly Alert", new_sound = 'sound/AI/ionstorm.ogg')
GLOB.command_announcement.Announce("Ion storm detected near \the [station_name()]. Please check all AI-controlled equipment for errors.", "Anomaly Alert", new_sound = 'sound/AI/ionstorm.ogg')
IonStorm(0)
feedback_add_details("admin_verb","ION") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -623,7 +623,7 @@ ADMIN_VERB(cmd_admin_add_freeform_ai_law, R_FUN, "Add Custom AI law", "Adds a cu
var/show_log = tgui_alert(user, "Show ion message?", "Message", list("Yes", "No"))
if(show_log == "Yes")
command_announcement.Announce("Ion storm detected near the [station_name()]. Please check all AI-controlled equipment for errors.", "Anomaly Alert", new_sound = 'sound/AI/ionstorm.ogg')
GLOB.command_announcement.Announce("Ion storm detected near the [station_name()]. Please check all AI-controlled equipment for errors.", "Anomaly Alert", new_sound = 'sound/AI/ionstorm.ogg')
feedback_add_details("admin_verb","IONC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_rejuvenate, R_ADMIN|R_FUN|R_MOD, "Rejuvenate", "Fully restores the target mob.", ADMIN_CATEGORY_GAME, mob/living/target_mob as mob in GLOB.mob_list)
@@ -658,7 +658,7 @@ ADMIN_VERB(cmd_admin_create_centcom_report, R_ADMIN|R_SERVER|R_FUN, "Create Comm
if(!confirm)
return
if(confirm == "Yes")
command_announcement.Announce(input, customname, new_sound = 'sound/AI/commandreport.ogg', msg_sanitized = 1);
GLOB.command_announcement.Announce(input, customname, new_sound = 'sound/AI/commandreport.ogg', msg_sanitized = 1);
else
to_chat(world, span_boldannounce("New [using_map.company_name] Update available at all communication consoles."))
SEND_SOUND(world, sound('sound/AI/commandreport.ogg'))
+2 -2
View File
@@ -319,11 +319,11 @@ ADMIN_VERB(secrets, R_HOLDER, "Secrets", "Abuse harder than you ever have before
if(GLOB.gravity_is_on)
log_admin("[key_name(holder)] toggled gravity on.", 1)
message_admins(span_notice("[key_name_admin(holder)] toggled gravity on."), 1)
command_announcement.Announce("Gravity generators are again functioning within normal parameters. Sorry for any inconvenience.")
GLOB.command_announcement.Announce("Gravity generators are again functioning within normal parameters. Sorry for any inconvenience.")
else
log_admin("[key_name(holder)] toggled gravity off.", 1)
message_admins(span_notice("[key_name_admin(holder)] toggled gravity off."), 1)
command_announcement.Announce("Feedback surge detected in mass-distributions systems. Artificial 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.command_announcement.Announce("Feedback surge detected in mass-distributions systems. Artificial 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("tripleAI")
if(!is_funmin)
return
+11 -11
View File
@@ -202,7 +202,7 @@
target.Weaken(20)
target.stuttering = 20
var/redspace_abduction_z
GLOBAL_VAR(redspace_abduction_z)
/area/redspace_abduction
name = "Another Time And Place"
@@ -210,11 +210,11 @@ var/redspace_abduction_z
dynamic_lighting = FALSE
/proc/redspace_abduction(mob/living/target, user)
if(redspace_abduction_z < 0)
if(GLOB.redspace_abduction_z < 0)
to_chat(user,span_warning("The abduction z-level is already being created. Please wait."))
return
if(!redspace_abduction_z)
redspace_abduction_z = -1
if(!GLOB.redspace_abduction_z)
GLOB.redspace_abduction_z = -1
to_chat(user,span_warning("This is the first use of the verb this shift, it will take a minute to configure the abduction z-level. It will be z[world.maxz+1]."))
var/z = ++world.maxz
world.max_z_changed()
@@ -225,7 +225,7 @@ var/redspace_abduction_z
T.ChangeTurf(/turf/unsimulated/fake_space)
T.plane = -100
CHECK_TICK
redspace_abduction_z = z
GLOB.redspace_abduction_z = z
if(!target || !user)
return
@@ -244,7 +244,7 @@ var/redspace_abduction_z
for(var/x = llc_x to llc_x+size_of_square)
for(var/y = llc_y to llc_y+size_of_square)
var/turf/T_src = locate(x,y,target.z)
var/turf/T_dest = locate(x,y,redspace_abduction_z)
var/turf/T_dest = locate(x,y,GLOB.redspace_abduction_z)
T_dest.vis_contents.Cut()
T_dest.vis_contents += T_src
T_dest.density = T_src.density
@@ -255,7 +255,7 @@ var/redspace_abduction_z
for(var/x = llc_x to llc_x+1) //Left
for(var/y = llc_y to llc_y+size_of_square)
if(prob(50))
var/turf/T = locate(x,y,redspace_abduction_z)
var/turf/T = locate(x,y,GLOB.redspace_abduction_z)
T.density = FALSE
T.opacity = FALSE
T.vis_contents.Cut()
@@ -263,7 +263,7 @@ var/redspace_abduction_z
for(var/x = llc_x+size_of_square-1 to llc_x+size_of_square) //Right
for(var/y = llc_y to llc_y+size_of_square)
if(prob(50))
var/turf/T = locate(x,y,redspace_abduction_z)
var/turf/T = locate(x,y,GLOB.redspace_abduction_z)
T.density = FALSE
T.opacity = FALSE
T.vis_contents.Cut()
@@ -271,7 +271,7 @@ var/redspace_abduction_z
for(var/x = llc_x to llc_x+size_of_square) //Top
for(var/y = llc_y+size_of_square-1 to llc_y+size_of_square)
if(prob(50))
var/turf/T = locate(x,y,redspace_abduction_z)
var/turf/T = locate(x,y,GLOB.redspace_abduction_z)
T.density = FALSE
T.opacity = FALSE
T.vis_contents.Cut()
@@ -279,12 +279,12 @@ var/redspace_abduction_z
for(var/x = llc_x to llc_x+size_of_square) //Bottom
for(var/y = llc_y to llc_y+1)
if(prob(50))
var/turf/T = locate(x,y,redspace_abduction_z)
var/turf/T = locate(x,y,GLOB.redspace_abduction_z)
T.density = FALSE
T.opacity = FALSE
T.vis_contents.Cut()
target.forceMove(locate(target.x,target.y,redspace_abduction_z))
target.forceMove(locate(target.x,target.y,GLOB.redspace_abduction_z))
to_chat(target,span_danger("The tug relaxes, but everything around you looks... slightly off."))
to_chat(user, span_notice("The mob has been moved. ([admin_jump_link(target, check_rights_for(usr.client, R_HOLDER))])"))
+2 -2
View File
@@ -178,11 +178,11 @@ GLOBAL_VAR_INIT(silent_ert, 0)
// there's only a certain chance a team will be sent
if(!prob(send_team_chance))
command_announcement.Announce("It would appear that an emergency response team was requested for [station_name()]. Unfortunately, we were unable to send one at this time.", "[using_map.boss_name]")
GLOB.command_announcement.Announce("It would appear that an emergency response team was requested for [station_name()]. Unfortunately, we were unable to send one at this time.", "[using_map.boss_name]")
GLOB.can_call_ert = 0 // Only one call per round, ladies.
return
if(GLOB.silent_ert == 0)
command_announcement.Announce("It would appear that an emergency response team was requested for [station_name()]. We will prepare and send one as soon as possible.", "[using_map.boss_name]")
GLOB.command_announcement.Announce("It would appear that an emergency response team was requested for [station_name()]. We will prepare and send one as soon as possible.", "[using_map.boss_name]")
GLOB.can_call_ert = 0 // Only one call per round, gentleman.
GLOB.send_emergency_team = 1
+1 -1
View File
@@ -59,7 +59,7 @@ GLOBAL_VAR_INIT(can_call_traders, 1)
if(GLOB.send_beruang)
return
command_announcement.Announce("Incoming cargo hauler: Beruang (Reg: VRS 22EB1F11C2).", "[station_name()] Traffic Control")
GLOB.command_announcement.Announce("Incoming cargo hauler: Beruang (Reg: VRS 22EB1F11C2).", "[station_name()] Traffic Control")
GLOB.can_call_traders = 0 // Only one call per round.
GLOB.send_beruang = 1