Paradise Station Changelog
+ +#[pr_number] by [author] (Merged on [merge_date])" + + while(db_entries.NextRow()) + pr_block += "
[Text2Icon(db_entries.item[1])] [db_entries.item[2]]
" + + pr_block += "| Name | Weight | MinWeight | MaxWeight | OneShot | Enabled | CurrWeight | Remove | ||||||||||||||||||||||||||||||||
| [severity_to_string[severity]] | " + html += "[GLOB.severity_to_string[severity]] | " html += "[station_time_timestamp("hh:mm:ss", max(EC.next_event_time, world.time))] | " html += "[round(next_event_at / 600, 0.1)] | " html += "" @@ -172,7 +173,7 @@ SUBSYSTEM_DEF(events) var/datum/event_container/EC = event_containers[severity] var/datum/event_meta/EM = EC.next_event html += " | |||||||||||||||||||||||||||||||||||
| [severity_to_string[severity]] | " + html += "[GLOB.severity_to_string[severity]] | " html += "[EM ? EM.name : "Random"] | " html += "View | " html += "Clear | " @@ -193,7 +194,7 @@ SUBSYSTEM_DEF(events) var/ends_in = max(0, round((ends_at - world.time) / 600, 0.1)) var/no_end = E.noAutoEnd html += "|||||||||||||||||||||||||||||||||||
| [severity_to_string[EM.severity]] | " + html += "[GLOB.severity_to_string[EM.severity]] | " html += "[EM.name] | " html += "[no_end ? "N/A" : station_time_timestamp("hh:mm:ss", ends_at)] | " html += "[no_end ? "N/A" : ends_in] | " @@ -216,33 +217,33 @@ SUBSYSTEM_DEF(events) var/datum/event_container/EC = locate(href_list["event"]) var/decrease = (60 * RaiseToPower(10, text2num(href_list["dec_timer"]))) EC.next_event_time -= decrease - admin_log_and_message_admins("decreased timer for [severity_to_string[EC.severity]] events by [decrease/600] minute(s).") + admin_log_and_message_admins("decreased timer for [GLOB.severity_to_string[EC.severity]] events by [decrease/600] minute(s).") else if(href_list["inc_timer"]) var/datum/event_container/EC = locate(href_list["event"]) var/increase = (60 * RaiseToPower(10, text2num(href_list["inc_timer"]))) EC.next_event_time += increase - admin_log_and_message_admins("increased timer for [severity_to_string[EC.severity]] events by [increase/600] minute(s).") + admin_log_and_message_admins("increased timer for [GLOB.severity_to_string[EC.severity]] events by [increase/600] minute(s).") else if(href_list["select_event"]) var/datum/event_container/EC = locate(href_list["select_event"]) var/datum/event_meta/EM = EC.SelectEvent() if(EM) - admin_log_and_message_admins("has queued the [severity_to_string[EC.severity]] event '[EM.name]'.") + admin_log_and_message_admins("has queued the [GLOB.severity_to_string[EC.severity]] event '[EM.name]'.") else if(href_list["pause"]) var/datum/event_container/EC = locate(href_list["pause"]) EC.delayed = !EC.delayed - admin_log_and_message_admins("has [EC.delayed ? "paused" : "resumed"] countdown for [severity_to_string[EC.severity]] events.") + admin_log_and_message_admins("has [EC.delayed ? "paused" : "resumed"] countdown for [GLOB.severity_to_string[EC.severity]] events.") else if(href_list["interval"]) var/delay = input("Enter delay modifier. A value less than one means events fire more often, higher than one less often.", "Set Interval Modifier") as num|null if(delay && delay > 0) var/datum/event_container/EC = locate(href_list["interval"]) EC.delay_modifier = delay - admin_log_and_message_admins("has set the interval modifier for [severity_to_string[EC.severity]] events to [EC.delay_modifier].") + admin_log_and_message_admins("has set the interval modifier for [GLOB.severity_to_string[EC.severity]] events to [EC.delay_modifier].") else if(href_list["stop"]) if(alert("Stopping an event may have unintended side-effects. Continue?","Stopping Event!","Yes","No") != "Yes") return var/datum/event/E = locate(href_list["stop"]) var/datum/event_meta/EM = E.event_meta - admin_log_and_message_admins("has stopped the [severity_to_string[EM.severity]] event '[EM.name]'.") + admin_log_and_message_admins("has stopped the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.") E.kill() else if(href_list["view_events"]) selected_event_container = locate(href_list["view_events"]) @@ -264,23 +265,23 @@ SUBSYSTEM_DEF(events) var/datum/event_meta/EM = locate(href_list["set_weight"]) EM.weight = weight if(EM != new_event) - admin_log_and_message_admins("has changed the weight of the [severity_to_string[EM.severity]] event '[EM.name]' to [EM.weight].") + admin_log_and_message_admins("has changed the weight of the [GLOB.severity_to_string[EM.severity]] event '[EM.name]' to [EM.weight].") else if(href_list["toggle_oneshot"]) var/datum/event_meta/EM = locate(href_list["toggle_oneshot"]) EM.one_shot = !EM.one_shot if(EM != new_event) - admin_log_and_message_admins("has [EM.one_shot ? "set" : "unset"] the oneshot flag for the [severity_to_string[EM.severity]] event '[EM.name]'.") + admin_log_and_message_admins("has [EM.one_shot ? "set" : "unset"] the oneshot flag for the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.") else if(href_list["toggle_enabled"]) var/datum/event_meta/EM = locate(href_list["toggle_enabled"]) EM.enabled = !EM.enabled - admin_log_and_message_admins("has [EM.enabled ? "enabled" : "disabled"] the [severity_to_string[EM.severity]] event '[EM.name]'.") + admin_log_and_message_admins("has [EM.enabled ? "enabled" : "disabled"] the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.") else if(href_list["remove"]) if(alert("This will remove the event from rotation. Continue?","Removing Event!","Yes","No") != "Yes") return var/datum/event_meta/EM = locate(href_list["remove"]) var/datum/event_container/EC = locate(href_list["EC"]) EC.available_events -= EM - admin_log_and_message_admins("has removed the [severity_to_string[EM.severity]] event '[EM.name]'.") + admin_log_and_message_admins("has removed the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.") else if(href_list["add"]) if(!new_event.name || !new_event.event_type) return @@ -288,12 +289,12 @@ SUBSYSTEM_DEF(events) return new_event.severity = selected_event_container.severity selected_event_container.available_events += new_event - admin_log_and_message_admins("has added \a [severity_to_string[new_event.severity]] event '[new_event.name]' of type [new_event.event_type] with weight [new_event.weight].") + admin_log_and_message_admins("has added \a [GLOB.severity_to_string[new_event.severity]] event '[new_event.name]' of type [new_event.event_type] with weight [new_event.weight].") new_event = new else if(href_list["clear"]) var/datum/event_container/EC = locate(href_list["clear"]) if(EC.next_event) - admin_log_and_message_admins("has dequeued the [severity_to_string[EC.severity]] event '[EC.next_event.name]'.") + admin_log_and_message_admins("has dequeued the [GLOB.severity_to_string[EC.severity]] event '[EC.next_event.name]'.") EC.next_event = null Interact(usr) diff --git a/code/controllers/subsystem/fires.dm b/code/controllers/subsystem/fires.dm index aafc5ed48d5..dc419fffeb5 100644 --- a/code/controllers/subsystem/fires.dm +++ b/code/controllers/subsystem/fires.dm @@ -3,6 +3,7 @@ SUBSYSTEM_DEF(fires) priority = FIRE_PRIOTITY_BURNING flags = SS_NO_INIT|SS_BACKGROUND runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME + offline_implications = "Objects will no longer react to fires. No immediate action is needed." var/list/currentrun = list() var/list/processing = list() diff --git a/code/controllers/subsystem/garbage.dm b/code/controllers/subsystem/garbage.dm index 4bc3965e6cf..cbf17d05fbf 100644 --- a/code/controllers/subsystem/garbage.dm +++ b/code/controllers/subsystem/garbage.dm @@ -5,6 +5,7 @@ SUBSYSTEM_DEF(garbage) flags = SS_POST_FIRE_TIMING|SS_BACKGROUND|SS_NO_INIT runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY init_order = INIT_ORDER_GARBAGE + offline_implications = "Garbage collection is no longer functional, and objects will not be qdel'd. Immediate server restart recommended." var/list/collection_timeout = list(0, 2 MINUTES, 10 SECONDS) // deciseconds to wait before moving something up in the queue to the next level diff --git a/code/controllers/subsystem/icon_smooth.dm b/code/controllers/subsystem/icon_smooth.dm index 531b6af2e78..289505a153c 100644 --- a/code/controllers/subsystem/icon_smooth.dm +++ b/code/controllers/subsystem/icon_smooth.dm @@ -4,6 +4,7 @@ SUBSYSTEM_DEF(icon_smooth) wait = 1 priority = FIRE_PRIOTITY_SMOOTHING flags = SS_TICKER + offline_implications = "Objects will no longer smooth together properly. No immediate action is needed." var/list/smooth_queue = list() diff --git a/code/controllers/subsystem/idlenpcpool.dm b/code/controllers/subsystem/idlenpcpool.dm index 42df941e10f..d61b90f1239 100644 --- a/code/controllers/subsystem/idlenpcpool.dm +++ b/code/controllers/subsystem/idlenpcpool.dm @@ -4,6 +4,7 @@ SUBSYSTEM_DEF(idlenpcpool) priority = FIRE_PRIORITY_IDLE_NPC wait = 60 runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME + offline_implications = "Idle simple animals will no longer process. Shuttle call recommended." var/list/currentrun = list() var/static/list/idle_mobs_by_zlevel[][] @@ -39,4 +40,4 @@ SUBSYSTEM_DEF(idlenpcpool) if(SA.stat != DEAD) SA.consider_wakeup() if(MC_TICK_CHECK) - return + return diff --git a/code/controllers/subsystem/input.dm b/code/controllers/subsystem/input.dm index f379deec72b..9dd6fce1554 100644 --- a/code/controllers/subsystem/input.dm +++ b/code/controllers/subsystem/input.dm @@ -5,6 +5,7 @@ SUBSYSTEM_DEF(input) flags = SS_TICKER priority = FIRE_PRIORITY_INPUT runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY + offline_implications = "Player input will no longer be recognised. Immediate server restart recommended." var/list/macro_sets var/list/movement_keys @@ -24,7 +25,7 @@ SUBSYSTEM_DEF(input) // This is for when macro sets are eventualy datumized /datum/controller/subsystem/input/proc/setup_default_macro_sets() var/list/static/default_macro_sets - + if(default_macro_sets) macro_sets = default_macro_sets return diff --git a/code/controllers/subsystem/jobs.dm b/code/controllers/subsystem/jobs.dm index 29efa85b8a0..ef89317d0f5 100644 --- a/code/controllers/subsystem/jobs.dm +++ b/code/controllers/subsystem/jobs.dm @@ -3,6 +3,7 @@ SUBSYSTEM_DEF(jobs) init_order = INIT_ORDER_JOBS // 12 wait = 3000 // 5 minutes (Deciseconds) runlevels = RUNLEVEL_GAME + offline_implications = "Job playtime hours will no longer be logged. No immediate action is needed." //List of all jobs var/list/occupations = list() @@ -10,7 +11,7 @@ SUBSYSTEM_DEF(jobs) var/list/type_occupations = list() //Dict of all jobs, keys are types var/list/prioritized_jobs = list() // List of jobs set to priority by HoP/Captain var/list/id_change_records = list() // List of all job transfer records - var/list/id_change_counter = 1 + var/id_change_counter = 1 //Players who need jobs var/list/unassigned = list() //Debug info @@ -39,8 +40,6 @@ SUBSYSTEM_DEF(jobs) var/datum/job/job = new J() if(!job) continue - if(!job.faction in faction) - continue occupations += job name_occupations[job.title] = job type_occupations[J] = job @@ -49,7 +48,7 @@ SUBSYSTEM_DEF(jobs) /datum/controller/subsystem/jobs/proc/Debug(var/text) - if(!Debug2) + if(!GLOB.debug2) return 0 job_debug.Add(text) return 1 @@ -138,7 +137,7 @@ SUBSYSTEM_DEF(jobs) if(flag && !(flag in player.client.prefs.be_special)) Debug("FOC flag failed, Player: [player], Flag: [flag], ") continue - if(player.mind && job.title in player.mind.restricted_roles) + if(player.mind && (job.title in player.mind.restricted_roles)) Debug("FOC incompatbile with antagonist role, Player: [player]") continue if(player.client.prefs.GetJobDepartment(job, level) & job.flag) @@ -155,10 +154,10 @@ SUBSYSTEM_DEF(jobs) if(istype(job, GetJob("Civilian"))) // We don't want to give him assistant, that's boring! continue - if(job.title in command_positions) //If you want a command position, select it! + if(job.title in GLOB.command_positions) //If you want a command position, select it! continue - if(job.title in whitelisted_positions) // No random whitelisted job, sorry! + if(job.title in GLOB.whitelisted_positions) // No random whitelisted job, sorry! continue if(job.admin_only) // No admin positions either. @@ -180,7 +179,7 @@ SUBSYSTEM_DEF(jobs) Debug("GRJ player has disability rendering them ineligible for job, Player: [player]") continue - if(player.mind && job.title in player.mind.restricted_roles) + if(player.mind && (job.title in player.mind.restricted_roles)) Debug("GRJ incompatible with antagonist role, Player: [player], Job: [job.title]") continue @@ -203,7 +202,7 @@ SUBSYSTEM_DEF(jobs) ///This proc is called before the level loop of DivideOccupations() and will try to select a head, ignoring ALL non-head preferences for every level until it locates a head or runs out of levels to check /datum/controller/subsystem/jobs/proc/FillHeadPosition() for(var/level = 1 to 3) - for(var/command_position in command_positions) + for(var/command_position in GLOB.command_positions) var/datum/job/job = GetJob(command_position) if(!job) continue @@ -231,7 +230,7 @@ SUBSYSTEM_DEF(jobs) ///This proc is called at the start of the level loop of DivideOccupations() and will cause head jobs to be checked before any other jobs of the same level /datum/controller/subsystem/jobs/proc/CheckHeadPositions(var/level) - for(var/command_position in command_positions) + for(var/command_position in GLOB.command_positions) var/datum/job/job = GetJob(command_position) if(!job) continue @@ -357,7 +356,7 @@ SUBSYSTEM_DEF(jobs) Debug("DO player has disability rendering them ineligible for job, Player: [player], Job:[job.title]") continue - if(player.mind && job.title in player.mind.restricted_roles) + if(player.mind && (job.title in player.mind.restricted_roles)) Debug("DO incompatible with antagonist role, Player: [player], Job:[job.title]") continue @@ -498,13 +497,14 @@ SUBSYSTEM_DEF(jobs) job.after_spawn(H) //Gives glasses to the vision impaired - if(H.disabilities & DISABILITY_FLAG_NEARSIGHTED) + if(NEARSIGHTED in H.mutations) var/equipped = H.equip_to_slot_or_del(new /obj/item/clothing/glasses/regular(H), slot_glasses) if(equipped != 1) var/obj/item/clothing/glasses/G = H.glasses if(istype(G) && !G.prescription) - G.prescription = 1 + G.prescription = TRUE G.name = "prescription [G.name]" + H.update_nearsighted_effects() return H @@ -600,7 +600,7 @@ SUBSYSTEM_DEF(jobs) // If they're head, give them the account info for their department if(job && job.head_position) remembered_info = "" - var/datum/money_account/department_account = department_accounts[job.department] + var/datum/money_account/department_account = GLOB.department_accounts[job.department] if(department_account) remembered_info += "Your department's account number is: #[department_account.account_number]
| When | Type | Who | What | Target | Where |
|---|---|---|---|---|---|
| [time] | [L.log_type] | \ +[L.who] | [L.what] | \ +[L.target] | [ADMIN_COORDJMP(L.where)] |
| [e.name] | [e.burn_dam] | [e.brute_dam] | [robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured] | " + dat += "[e.name] | [e.burn_dam] | [e.brute_dam] | [robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured][dead] | " dat += "" for(var/obj/item/organ/internal/i in occupant.internal_organs) var/mech = i.desc var/infection = "None" + var/dead = "" + if(i.status & ORGAN_DEAD) + dead = "DEAD:" switch(i.germ_level) if(1 to INFECTION_LEVEL_ONE + 200) infection = "Mild Infection:" @@ -483,18 +489,20 @@ infection = "Acute Infection:" if(INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300) infection = "Acute Infection+:" - if(INFECTION_LEVEL_TWO + 300 to INFINITY) + if(INFECTION_LEVEL_TWO + 300 to INFECTION_LEVEL_TWO + 399) infection = "Acute Infection++:" + if(INFECTION_LEVEL_TWO + 400 to INFINITY) + infection = "Septic:" dat += "||
| [i.name] | N/A | [i.damage] | [infection]:[mech] | " + dat += " | [i.name] | N/A | [i.damage] | [infection]:[mech][dead] | " dat += " |
MULTITOOL BUFFER: [P.buffer] [id ? "([id])" : ""]"
diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm
index 3d727142db5..663f210df3e 100644
--- a/code/game/objects/structures.dm
+++ b/code/game/objects/structures.dm
@@ -18,11 +18,11 @@
if(climbable)
verbs += /obj/structure/proc/climb_on
if(SSticker)
- cameranet.updateVisibility(src)
+ GLOB.cameranet.updateVisibility(src)
/obj/structure/Destroy()
if(SSticker)
- cameranet.updateVisibility(src)
+ GLOB.cameranet.updateVisibility(src)
if(smooth)
var/turf/T = get_turf(src)
spawn(0)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/depot.dm b/code/game/objects/structures/crates_lockers/closets/secure/depot.dm
index bba8dc2a866..5ffbdd0cda7 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/depot.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/depot.dm
@@ -36,7 +36,7 @@
depotarea.armory_locker_looted()
/obj/structure/closet/secure_closet/syndicate/depot/attack_animal(mob/M)
- if(isanimal(M) && "syndicate" in M.faction)
+ if(isanimal(M) && ("syndicate" in M.faction))
to_chat(M, "The [src] resists your attack!")
return
return ..()
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm b/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm
index 7616aa90877..f0a7336389b 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm
@@ -16,7 +16,7 @@
new /obj/item/storage/backpack/satchel_eng(src)
new /obj/item/storage/backpack/duffel/engineering(src)
new /obj/item/clothing/head/beret/ce(src)
- new /obj/item/areaeditor/blueprints(src)
+ new /obj/item/areaeditor/blueprints/ce(src)
new /obj/item/storage/box/permits(src)
new /obj/item/clothing/under/rank/chief_engineer(src)
new /obj/item/clothing/under/rank/chief_engineer/skirt(src)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
index 096133b6e0d..7eab5858772 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
@@ -54,36 +54,33 @@
new /obj/item/storage/backpack/satchel/withwallet( src )
new /obj/item/radio/headset( src )
-/obj/structure/closet/secure_closet/personal/attackby(obj/item/W as obj, mob/user as mob, params)
- if(src.opened)
- if(istype(W, /obj/item/grab))
- src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
- user.drop_item()
- if(W) W.forceMove(loc)
- else if(istype(W, /obj/item/card/id))
- if(src.broken)
- to_chat(user, "It appears to be broken.")
- return
- var/obj/item/card/id/I = W
- if(!I || !I.registered_name) return
- if(src == user.loc)
- to_chat(user, "You can't reach the lock from inside.")
- else if(src.allowed(user) || !src.registered_name || (istype(I) && (src.registered_name == I.registered_name)))
- //they can open all lockers, or nobody owns this, or they own this locker
- src.locked = !( src.locked )
- if(src.locked)
- src.icon_state = src.icon_locked
- else
- src.icon_state = src.icon_closed
- registered_name = null
- desc = initial(desc)
-
- if(!src.registered_name && src.locked)
- src.registered_name = I.registered_name
- src.desc = "Owned by [I.registered_name]."
- else
- to_chat(user, "Access Denied")
- else if((istype(W, /obj/item/card/emag) || istype(W, /obj/item/melee/energy/blade)) && !broken)
- emag_act(user)
- else
+/obj/structure/closet/secure_closet/personal/attackby(obj/item/W, mob/user, params)
+ if(opened || !istype(W, /obj/item/card/id))
return ..()
+
+ if(broken)
+ to_chat(user, "It appears to be broken.")
+ return
+
+ var/obj/item/card/id/I = W
+ if(!I || !I.registered_name)
+ return
+
+ if(src == user.loc)
+ to_chat(user, "You can't reach the lock from inside.")
+
+ else if(allowed(user) || !registered_name || (istype(I) && (registered_name == I.registered_name)))
+ //they can open all lockers, or nobody owns this, or they own this locker
+ locked = !locked
+ if(locked)
+ icon_state = icon_locked
+ else
+ icon_state = icon_closed
+ registered_name = null
+ desc = initial(desc)
+
+ if(!registered_name && locked)
+ registered_name = I.registered_name
+ desc = "Owned by [I.registered_name]."
+ else
+ to_chat(user, "Access Denied")
diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm
index 501abd4922d..e285c6a0ae9 100644
--- a/code/game/objects/structures/crates_lockers/closets/statue.dm
+++ b/code/game/objects/structures/crates_lockers/closets/statue.dm
@@ -19,7 +19,7 @@
L.buckled = 0
L.anchored = 0
L.forceMove(src)
- L.disabilities += MUTE
+ L.mutations |= MUTE
max_integrity = L.health + 100 //stoning damaged mobs will result in easier to shatter statues
intialTox = L.getToxLoss()
intialFire = L.getFireLoss()
@@ -69,7 +69,7 @@
for(var/mob/living/M in src)
M.forceMove(loc)
- M.disabilities -= MUTE
+ M.mutations -= MUTE
M.take_overall_damage((M.health - obj_integrity - 100),0) //any new damage the statue incurred is transfered to the mob
..()
diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm
index 45aaf76fb07..f9010c19415 100644
--- a/code/game/objects/structures/crates_lockers/crates.dm
+++ b/code/game/objects/structures/crates_lockers/crates.dm
@@ -212,7 +212,7 @@
/obj/structure/closet/crate/proc/notifyRecipient(var/destination)
var/msg = "[capitalize(name)] has arrived at [destination]."
if(destination in announce_beacons)
- for(var/obj/machinery/requests_console/D in allConsoles)
+ for(var/obj/machinery/requests_console/D in GLOB.allRequestConsoles)
if(D.department in src.announce_beacons[destination])
D.createMessage(name, "Your Crate has Arrived!", msg, 1)
diff --git a/code/game/objects/structures/decor/machinery/telecomms.dm b/code/game/objects/structures/decor/machinery/telecomms.dm
deleted file mode 100644
index 1068cfb0b4e..00000000000
--- a/code/game/objects/structures/decor/machinery/telecomms.dm
+++ /dev/null
@@ -1,23 +0,0 @@
-/obj/structure/decor/machinery/telecomms/processor
- name = "Processor Unit"
- icon = 'icons/obj/stationobjs.dmi'
- icon_state = "processor"
- desc = "This machine is used to process large quantities of information."
-
-/obj/structure/decor/machinery/telecomms/hub
- name = "Telecommunication Hub"
- icon = 'icons/obj/stationobjs.dmi'
- icon_state = "hub"
- desc = "A mighty piece of hardware used to send/receive massive amounts of data."
-
-/obj/structure/decor/machinery/telecomms/server
- name = "Telecommunication Server"
- icon = 'icons/obj/stationobjs.dmi'
- icon_state = "comm_server"
- desc = "A machine used to store data and network statistics."
-
-/obj/structure/decor/machinery/telecomms/relay
- name = "Telecommunication Relay"
- icon = 'icons/obj/stationobjs.dmi'
- icon_state = "relay"
- desc = "A mighty piece of hardware used to send massive amounts of data far away."
diff --git a/code/game/objects/structures/depot.dm b/code/game/objects/structures/depot.dm
index e970ac911dc..11eb03c94c5 100644
--- a/code/game/objects/structures/depot.dm
+++ b/code/game/objects/structures/depot.dm
@@ -79,7 +79,6 @@
var/beepsound = 'sound/items/timer.ogg'
var/deliberate = FALSE
var/max_cycles = 10
- var/max_fire_range = 9
var/area/syndicate_depot/core/depotarea
/obj/effect/overload/New()
@@ -101,10 +100,6 @@
if(!deliberate)
playsound(loc, beepsound, 50, 0)
cycles++
- var/fire_range = min(cycles, max_fire_range)
-
- for(var/turf/simulated/turf in range(fire_range, T))
- new /obj/effect/hotspot(turf)
return
if(!istype(depotarea))
diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm
index 7626abb9a7d..cdc5cdb58c4 100644
--- a/code/game/objects/structures/false_walls.dm
+++ b/code/game/objects/structures/false_walls.dm
@@ -245,6 +245,7 @@
/obj/structure/falsewall/plasma/attackby(obj/item/W, mob/user, params)
if(is_hot(W) > 300)
+ var/turf/T = locate(user)
message_admins("Plasma falsewall ignited by [key_name_admin(user)] in [ADMIN_VERBOSEJMP(T)]")
log_game("Plasma falsewall ignited by [key_name(user)] in [AREACOORD(T)]")
investigate_log("was ignited by [key_name(user)]","atmos")
diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm
index 592e67e466d..c657e0056e8 100644
--- a/code/game/objects/structures/mirror.dm
+++ b/code/game/objects/structures/mirror.dm
@@ -131,17 +131,19 @@
AC.ui_interact(user)
if("Voice")
- var/voice_choice = input(user, "Perhaps...", "Voice effects") as null|anything in list("Comic Sans", "Wingdings", "Swedish", "Chav")
+ var/voice_choice = input(user, "Perhaps...", "Voice effects") as null|anything in list("Comic Sans", "Wingdings", "Swedish", "Chav", "Mute")
var/voice_mutation
switch(voice_choice)
if("Comic Sans")
- voice_mutation = COMICBLOCK
+ voice_mutation = GLOB.comicblock
if("Wingdings")
- voice_mutation = WINGDINGSBLOCK
+ voice_mutation = GLOB.wingdingsblock
if("Swedish")
- voice_mutation = SWEDEBLOCK
+ voice_mutation = GLOB.swedeblock
if("Chav")
- voice_mutation = CHAVBLOCK
+ voice_mutation = GLOB.chavblock
+ if("Mute")
+ voice_mutation = GLOB.muteblock
if(voice_mutation)
if(H.dna.GetSEState(voice_mutation))
H.dna.SetSEState(voice_mutation, FALSE)
diff --git a/code/game/objects/structures/misc.dm b/code/game/objects/structures/misc.dm
index 1497344d5c8..44cbf6c52c9 100644
--- a/code/game/objects/structures/misc.dm
+++ b/code/game/objects/structures/misc.dm
@@ -33,7 +33,7 @@
if(user.z != src.z) return
user.loc.loc.Exited(user)
- user.loc = pick(carplist) // In the future, possibly make specific NinjaTele landmarks, and give him an option to teleport to North/South/East/West of SS13 instead of just hijacking a carpspawn.
+ user.loc = pick(GLOB.carplist) // In the future, possibly make specific NinjaTele landmarks, and give him an option to teleport to North/South/East/West of SS13 instead of just hijacking a carpspawn.
playsound(user.loc, 'sound/effects/phasein.ogg', 25, 1)
diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm
index 7458c0a4b3b..c3d63c47862 100644
--- a/code/game/objects/structures/musician.dm
+++ b/code/game/objects/structures/musician.dm
@@ -121,7 +121,7 @@
ui.open()
ui.set_auto_update(1)
-/datum/song/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state)
+/datum/song/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
var/data[0]
data["lines"] = lines
@@ -309,7 +309,7 @@
song.ui_interact(user, ui_key, ui, force_open)
-/obj/structure/piano/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state)
+/obj/structure/piano/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
return song.ui_data(user, ui_key, state)
/obj/structure/piano/Topic(href, href_list)
diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm
index f891aff5592..1102901c8bd 100644
--- a/code/game/objects/structures/safe.dm
+++ b/code/game/objects/structures/safe.dm
@@ -25,7 +25,7 @@ GLOBAL_LIST_EMPTY(safes)
var/number_of_tumblers = 3 // The amount of tumblers that will be generated.
var/list/tumblers = list() // The list of tumbler dial positions that need to be hit.
- var/list/current_tumbler_index = 1 // The index in the tumblers list of the tumbler dial position that needs to be hit.
+ var/current_tumbler_index = 1 // The index in the tumblers list of the tumbler dial position that needs to be hit.
var/space = 0 // The combined w_class of everything in the safe.
var/maxspace = 24 // The maximum combined w_class of stuff in the safe.
@@ -185,7 +185,7 @@ GLOBAL_LIST_EMPTY(safes)
ui.open()
ui.set_auto_update(1)
-/obj/structure/safe/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state)
+/obj/structure/safe/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
var/data[0]
var/list/contents_names = list()
if(open)
diff --git a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm
index 3f5d667a356..ba5258004a0 100644
--- a/code/game/objects/structures/signs.dm
+++ b/code/game/objects/structures/signs.dm
@@ -169,7 +169,7 @@
/obj/structure/sign/kiddieplaque
name = "AI developers plaque"
- desc = "Next to the extremely long list of names and job titles, there is a drawing of a little child. The child appears to be retarded. Beneath the image, someone has scratched the word \"PACKETS\"."
+ desc = "Next to the extremely long list of names and job titles, there is a drawing of a little child. The child's eyes are crossed, and is drooling. Beneath the image, someone has scratched the word \"PACKETS\"."
icon_state = "kiddieplaque"
/obj/structure/sign/atmosplaque
diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm
index c4c36d788e2..692d15d79ec 100644
--- a/code/game/objects/structures/tank_dispenser.dm
+++ b/code/game/objects/structures/tank_dispenser.dm
@@ -1,3 +1,5 @@
+#define MAX_TANK_STORAGE 10
+
/obj/structure/dispenser
name = "tank storage unit"
desc = "A simple yet bulky storage device for gas tanks. Has room for up to ten oxygen tanks, and ten plasma tanks."
@@ -5,29 +7,51 @@
icon_state = "dispenser"
density = 1
anchored = 1.0
- var/oxygentanks = 10
- var/plasmatanks = 10
- var/list/oxytanks = list() //sorry for the similar var names
- var/list/platanks = list()
+ var/starting_oxygen_tanks = MAX_TANK_STORAGE // The starting amount of oxygen tanks the dispenser gets when it's spawned
+ var/starting_plasma_tanks = MAX_TANK_STORAGE // Starting amount of plasma tanks
+ var/list/stored_oxygen_tanks = list() // List of currently stored oxygen tanks
+ var/list/stored_plasma_tanks = list() // And plasma tanks
/obj/structure/dispenser/oxygen
- plasmatanks = 0
+ starting_plasma_tanks = 0
/obj/structure/dispenser/plasma
- oxygentanks = 0
+ starting_oxygen_tanks = 0
/obj/structure/dispenser/New()
..()
+ initialize_tanks()
update_icon()
+/obj/structure/dispenser/Destroy()
+ QDEL_LIST(stored_plasma_tanks)
+ QDEL_LIST(stored_oxygen_tanks)
+ return ..()
+
+/obj/structure/dispenser/proc/initialize_tanks()
+ for(var/I in 1 to starting_plasma_tanks)
+ var/obj/item/tank/plasma/P = new(src)
+ stored_plasma_tanks.Add(P)
+
+ for(var/I in 1 to starting_oxygen_tanks)
+ var/obj/item/tank/oxygen/O = new(src)
+ stored_oxygen_tanks.Add(O)
+
/obj/structure/dispenser/update_icon()
- overlays.Cut()
- switch(oxygentanks)
- if(1 to 3) overlays += "oxygen-[oxygentanks]"
- if(4 to INFINITY) overlays += "oxygen-4"
- switch(plasmatanks)
- if(1 to 4) overlays += "plasma-[plasmatanks]"
- if(5 to INFINITY) overlays += "plasma-5"
+ cut_overlays()
+ var/oxy_tank_amount = LAZYLEN(stored_oxygen_tanks)
+ switch(oxy_tank_amount)
+ if(1 to 3)
+ overlays += "oxygen-[oxy_tank_amount]"
+ if(4 to INFINITY)
+ overlays += "oxygen-4"
+
+ var/pla_tank_amount = LAZYLEN(stored_plasma_tanks)
+ switch(pla_tank_amount)
+ if(1 to 4)
+ overlays += "plasma-[pla_tank_amount]"
+ if(5 to INFINITY)
+ overlays += "plasma-5"
/obj/structure/dispenser/attack_hand(mob/user)
if(..())
@@ -38,7 +62,7 @@
/obj/structure/dispenser/attack_ghost(mob/user)
ui_interact(user)
-/obj/structure/dispenser/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state)
+/obj/structure/dispenser/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, master_ui = null, datum/topic_state/state = GLOB.default_state)
user.set_machine(src)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
@@ -47,35 +71,19 @@
/obj/structure/dispenser/ui_data(user)
var/list/data = list()
- data["o_tanks"] = oxygentanks
- data["p_tanks"] = plasmatanks
+ data["o_tanks"] = LAZYLEN(stored_oxygen_tanks)
+ data["p_tanks"] = LAZYLEN(stored_plasma_tanks)
return data
/obj/structure/dispenser/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/tank/oxygen) || istype(I, /obj/item/tank/air) || istype(I, /obj/item/tank/anesthetic))
- if(oxygentanks < 10)
- user.drop_item()
- I.forceMove(src)
- oxytanks.Add(I)
- oxygentanks++
- update_icon()
- to_chat(user, "You put [I] in [src].")
- else
- to_chat(user, "[src] is full.")
- SSnanoui.update_uis(src)
+ try_insert_tank(user, stored_oxygen_tanks, I)
return
+
if(istype(I, /obj/item/tank/plasma))
- if(plasmatanks < 10)
- user.drop_item()
- I.forceMove(src)
- platanks.Add(I)
- plasmatanks++
- update_icon()
- to_chat(user, "You put [I] in [src].")
- else
- to_chat(user, "[src] is full.")
- SSnanoui.update_uis(src)
+ try_insert_tank(user, stored_plasma_tanks, I)
return
+
if(istype(I, /obj/item/wrench))
if(anchored)
to_chat(user, "You lean down and unwrench [src].")
@@ -88,40 +96,55 @@
/obj/structure/dispenser/Topic(href, href_list)
if(..())
- return 1
+ return TRUE
if(Adjacent(usr))
usr.set_machine(src)
+
+ // The oxygen tank button
if(href_list["oxygen"])
- if(oxygentanks > 0)
- var/obj/item/tank/oxygen/O
- if(oxytanks.len == oxygentanks)
- O = oxytanks[1]
- oxytanks.Remove(O)
- else
- O = new /obj/item/tank/oxygen(loc)
- O.loc = loc
- to_chat(usr, "You take [O] out of [src].")
- oxygentanks--
- update_icon()
+ try_remove_tank(usr, stored_oxygen_tanks)
+
+ // The plasma tank button
if(href_list["plasma"])
- if(plasmatanks > 0)
- var/obj/item/tank/plasma/P
- if(platanks.len == plasmatanks)
- P = platanks[1]
- platanks.Remove(P)
- else
- P = new /obj/item/tank/plasma(loc)
- P.loc = loc
- to_chat(usr, "You take [P] out of [src].")
- plasmatanks--
- update_icon()
+ try_remove_tank(usr, stored_plasma_tanks)
+
add_fingerprint(usr)
updateUsrDialog()
- SSnanoui.update_uis(src)
+ SSnanoui.try_update_ui(usr, src)
else
SSnanoui.close_user_uis(usr,src)
- return 1
+ return TRUE
+
+/// Called when the user clicks on the oxygen or plasma tank UI buttons, and tries to withdraw a tank.
+/obj/structure/dispenser/proc/try_remove_tank(mob/living/user, list/tank_list)
+ if(!LAZYLEN(tank_list))
+ return // There are no tanks left to withdraw.
+
+ var/obj/item/tank/T = tank_list[1]
+ tank_list.Remove(T)
+
+ if(!user.put_in_hands(T))
+ T.forceMove(loc) // If the user's hands are full, place it on the tile of the dispenser.
+
+ to_chat(user, "You take [T] out of [src].")
+ update_icon()
+
+/// Called when the user clicks on the dispenser with a tank. Tries to insert the tank into the dispenser, and updates the UI if successful.
+/obj/structure/dispenser/proc/try_insert_tank(mob/living/user, list/tank_list, obj/item/tank/T)
+ if(LAZYLEN(tank_list) >= MAX_TANK_STORAGE)
+ to_chat(user, "[src] is full.")
+ return
+
+ if(!user.drop_item()) // Antidrop check
+ to_chat(user, "[T] is stuck to your hand!")
+ return
+
+ T.forceMove(src)
+ tank_list.Add(T)
+ update_icon()
+ to_chat(user, "You put [T] in [src].")
+ SSnanoui.try_update_ui(user, src)
/obj/structure/tank_dispenser/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
@@ -130,3 +153,5 @@
I.forceMove(loc)
new /obj/item/stack/sheet/metal(loc, 2)
qdel(src)
+
+#undef MAX_TANK_STORAGE
diff --git a/code/game/objects/structures/transit_tubes/station.dm b/code/game/objects/structures/transit_tubes/station.dm
index f8f406d1381..9d06f870fc3 100644
--- a/code/game/objects/structures/transit_tubes/station.dm
+++ b/code/game/objects/structures/transit_tubes/station.dm
@@ -38,7 +38,7 @@
if(pod.contents.len)
to_chat(AM, "")
return
- else if(!pod.moving && pod.dir in directions())
+ else if(!pod.moving && (pod.dir in directions()))
AM.forceMove(pod)
return
@@ -47,7 +47,7 @@
/obj/structure/transit_tube/station/attack_hand(mob/user as mob)
if(!pod_moving)
for(var/obj/structure/transit_tube_pod/pod in loc)
- if(!pod.moving && pod.dir in directions())
+ if(!pod.moving && (pod.dir in directions()))
if(icon_state == "closed")
open_animation()
@@ -100,7 +100,7 @@
/obj/structure/transit_tube/station/proc/launch_pod()
for(var/obj/structure/transit_tube_pod/pod in loc)
- if(!pod.moving && pod.dir in directions())
+ if(!pod.moving && (pod.dir in directions()))
spawn(5)
pod_moving = 1
close_animation()
diff --git a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
index 7095fd4eeda..8984dc60a52 100644
--- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
+++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
@@ -144,9 +144,7 @@
if(istype(mob, /mob) && mob.client)
// If the pod is not in a tube at all, you can get out at any time.
if(!(locate(/obj/structure/transit_tube) in loc))
- mob.loc = loc
- mob.client.Move(get_step(loc, direction), direction)
- mob.reset_perspective(null)
+ mob.forceMove(loc)
//if(moving && istype(loc, /turf/space))
// Todo: If you get out of a moving pod in space, you should move as well.
@@ -158,9 +156,7 @@
if(!station.pod_moving)
if(direction == station.dir)
if(station.icon_state == "open")
- mob.loc = loc
- mob.client.Move(get_step(loc, direction), direction)
- mob.reset_perspective(null)
+ mob.forceMove(loc)
else
station.open_animation()
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 32c9daf3c76..87107f97abe 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -411,7 +411,7 @@
M.l_hand.clean_blood()
if(M.back)
if(M.back.clean_blood())
- M.update_inv_back(0)
+ M.update_inv_back()
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/washgloves = 1
@@ -437,38 +437,38 @@
if(H.head)
if(H.head.clean_blood())
- H.update_inv_head(0,0)
+ H.update_inv_head()
if(H.wear_suit)
if(H.wear_suit.clean_blood())
- H.update_inv_wear_suit(0,0)
+ H.update_inv_wear_suit()
else if(H.w_uniform)
if(H.w_uniform.clean_blood())
- H.update_inv_w_uniform(0,0)
+ H.update_inv_w_uniform()
if(H.gloves && washgloves)
if(H.gloves.clean_blood())
- H.update_inv_gloves(0,0)
+ H.update_inv_gloves()
if(H.shoes && washshoes)
if(H.shoes.clean_blood())
- H.update_inv_shoes(0,0)
+ H.update_inv_shoes()
if(H.wear_mask && washmask)
if(H.wear_mask.clean_blood())
- H.update_inv_wear_mask(0)
+ H.update_inv_wear_mask()
if(H.glasses && washglasses)
if(H.glasses.clean_blood())
- H.update_inv_glasses(0)
+ H.update_inv_glasses()
if(H.l_ear && washears)
if(H.l_ear.clean_blood())
- H.update_inv_ears(0)
+ H.update_inv_ears()
if(H.r_ear && washears)
if(H.r_ear.clean_blood())
- H.update_inv_ears(0)
+ H.update_inv_ears()
if(H.belt)
if(H.belt.clean_blood())
- H.update_inv_belt(0)
+ H.update_inv_belt()
else
if(M.wear_mask) //if the mob is not human, it cleans the mask without asking for bitflags
if(M.wear_mask.clean_blood())
- M.update_inv_wear_mask(0)
+ M.update_inv_wear_mask()
else
O.clean_blood()
@@ -704,7 +704,7 @@
return
if(proximity_flag != 1) //if we aren't next to the wall
return
- if(!(get_dir(on_wall, user) in cardinal))
+ if(!(get_dir(on_wall, user) in GLOB.cardinal))
to_chat(user, "You need to be standing next to a wall to place \the [src].")
return
return 1
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index 01136ea1046..9faab45cf97 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -1,6 +1,6 @@
-var/global/wcBar = pick(list("#0d8395", "#58b5c3", "#58c366", "#90d79a", "#ffffff"))
-var/global/wcBrig = pick(list("#aa0808", "#7f0606", "#ff0000"))
-var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8fcf44", "#ffffff"))
+GLOBAL_LIST_INIT(wcBar, pick(list("#0d8395", "#58b5c3", "#58c366", "#90d79a", "#ffffff")))
+GLOBAL_LIST_INIT(wcBrig, pick(list("#aa0808", "#7f0606", "#ff0000")))
+GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8fcf44", "#ffffff")))
/obj/proc/color_windows(obj/W)
var/list/wcBarAreas = list(/area/crew_quarters/bar)
@@ -13,11 +13,11 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
var/area/A = T.loc
if(is_type_in_list(A,wcBarAreas))
- newcolor = wcBar
+ newcolor = GLOB.wcBar
else if(is_type_in_list(A,wcBrigAreas))
- newcolor = wcBrig
+ newcolor = GLOB.wcBrig
else
- newcolor = wcCommon
+ newcolor = GLOB.wcCommon
return newcolor
diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm
index 6c10921e6bd..19717991593 100644
--- a/code/game/turfs/simulated.dm
+++ b/code/game/turfs/simulated.dm
@@ -35,7 +35,12 @@
assume_air(lowertemp)
qdel(hotspot)
-/turf/simulated/proc/MakeSlippery(wet_setting = TURF_WET_WATER, infinite = FALSE) // 1 = Water, 2 = Lube, 3 = Ice, 4 = Permafrost
+/*
+ * Makes a turf slippery using the given parameters
+ * @param wet_setting The type of slipperyness used
+ * @param time Time the turf is slippery. If null it will pick a random time between 790 and 820 ticks. If INFINITY then it won't dry up ever
+*/
+/turf/simulated/proc/MakeSlippery(wet_setting = TURF_WET_WATER, time = null) // 1 = Water, 2 = Lube, 3 = Ice, 4 = Permafrost
if(wet >= wet_setting)
return
wet = wet_setting
@@ -55,13 +60,13 @@
else
wet_overlay = image('icons/effects/water.dmi', src, "wet_static")
overlays += wet_overlay
- if(!infinite)
- spawn(rand(790, 820)) // Purely so for visual effect
- if(!istype(src, /turf/simulated)) //Because turfs don't get deleted, they change, adapt, transform, evolve and deform. they are one and they are all.
- return
- MakeDry(wet_setting)
+ if(time == INFINITY)
+ return
+ if(!time)
+ time = rand(790, 820)
+ addtimer(CALLBACK(src, .proc/MakeDry, wet_setting), time)
-/turf/simulated/proc/MakeDry(wet_setting = TURF_WET_WATER)
+/turf/simulated/MakeDry(wet_setting = TURF_WET_WATER)
if(wet > wet_setting)
return
wet = TURF_DRY
diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm
index 72513b2e8b3..2d886f44bfd 100644
--- a/code/game/turfs/simulated/floor.dm
+++ b/code/game/turfs/simulated/floor.dm
@@ -1,5 +1,5 @@
//This is so damaged or burnt tiles or platings don't get remembered as the default tile
-var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","damaged4",
+GLOBAL_LIST_INIT(icons_to_ignore_at_floor_init, list("damaged1","damaged2","damaged3","damaged4",
"damaged5","panelscorched","floorscorched1","floorscorched2","platingdmg1","platingdmg2",
"platingdmg3","plating","light_on","light_on_flicker1","light_on_flicker2",
"warnplate", "warnplatecorner","metalfoam", "ironfoam",
@@ -11,7 +11,7 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","
"oldburning","light-on-r","light-on-y","light-on-g","light-on-b", "wood", "wood-broken", "carpet",
"carpetcorner", "carpetside", "carpet", "ironsand1", "ironsand2", "ironsand3", "ironsand4", "ironsand5",
"ironsand6", "ironsand7", "ironsand8", "ironsand9", "ironsand10", "ironsand11",
- "ironsand12", "ironsand13", "ironsand14", "ironsand15")
+ "ironsand12", "ironsand13", "ironsand14", "ironsand15"))
/turf/simulated/floor
name = "floor"
@@ -34,7 +34,7 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","
/turf/simulated/floor/New()
..()
- if(icon_state in icons_to_ignore_at_floor_init) //so damaged/burned tiles or plating icons aren't saved as the default
+ if(icon_state in GLOB.icons_to_ignore_at_floor_init) //so damaged/burned tiles or plating icons aren't saved as the default
icon_regular_floor = "floor"
else
icon_regular_floor = icon_state
@@ -187,7 +187,7 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","
if(T.turf_type == type)
return
var/obj/item/thing = user.get_inactive_hand()
- if(!prying_tool_list.Find(thing.tool_behaviour))
+ if(!thing || !prying_tool_list.Find(thing.tool_behaviour))
return
var/turf/simulated/floor/plating/P = pry_tile(thing, user, TRUE)
if(!istype(P))
diff --git a/code/game/turfs/simulated/floor/asteroid.dm b/code/game/turfs/simulated/floor/asteroid.dm
index 983b5abaced..6d5d95dff0e 100644
--- a/code/game/turfs/simulated/floor/asteroid.dm
+++ b/code/game/turfs/simulated/floor/asteroid.dm
@@ -205,7 +205,7 @@ GLOBAL_LIST_INIT(megafauna_spawn_list, list(/mob/living/simple_animal/hostile/me
length = set_length
// Get our directiosn
- forward_cave_dir = pick(alldirs - exclude_dir)
+ forward_cave_dir = pick(GLOB.alldirs - exclude_dir)
// Get the opposite direction of our facing direction
backward_cave_dir = angle2dir(dir2angle(forward_cave_dir) + 180)
diff --git a/code/game/turfs/simulated/floor/chasm.dm b/code/game/turfs/simulated/floor/chasm.dm
index 1fb97430026..d8ed888bc27 100644
--- a/code/game/turfs/simulated/floor/chasm.dm
+++ b/code/game/turfs/simulated/floor/chasm.dm
@@ -186,7 +186,7 @@
AM.alpha = oldalpha
AM.color = oldcolor
AM.transform = oldtransform
- AM.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1, 10),rand(1, 10))
+ AM.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1, 10),rand(1, 10))
/turf/simulated/floor/chasm/straight_down/lava_land_surface/normal_air
oxygen = MOLES_O2STANDARD
diff --git a/code/game/turfs/simulated/floor/lava.dm b/code/game/turfs/simulated/floor/lava.dm
index 57e90840920..aa1be2200fa 100644
--- a/code/game/turfs/simulated/floor/lava.dm
+++ b/code/game/turfs/simulated/floor/lava.dm
@@ -113,6 +113,9 @@
/turf/simulated/floor/plating/lava/attackby(obj/item/C, mob/user, params) //Lava isn't a good foundation to build on
return
+/turf/simulated/floor/plating/lava/screwdriver_act()
+ return
+
/turf/simulated/floor/plating/lava/welder_act()
return
diff --git a/code/game/turfs/simulated/floor/mineral.dm b/code/game/turfs/simulated/floor/mineral.dm
index 5eb387abbae..ffb1cce0b5c 100644
--- a/code/game/turfs/simulated/floor/mineral.dm
+++ b/code/game/turfs/simulated/floor/mineral.dm
@@ -186,7 +186,7 @@
/turf/simulated/floor/mineral/bananium/lubed/Initialize(mapload)
. = ..()
- MakeSlippery(TURF_WET_LUBE, TRUE)
+ MakeSlippery(TURF_WET_LUBE, INFINITY)
/turf/simulated/floor/mineral/bananium/lubed/pry_tile(obj/item/C, mob/user, silent = FALSE) //I want to get off Mr Honk's Wild Ride
if(ishuman(user))
diff --git a/code/game/turfs/simulated/floor/misc_floor.dm b/code/game/turfs/simulated/floor/misc_floor.dm
index 33ae636090d..0ca6494497c 100644
--- a/code/game/turfs/simulated/floor/misc_floor.dm
+++ b/code/game/turfs/simulated/floor/misc_floor.dm
@@ -118,7 +118,7 @@
/turf/simulated/floor/lubed/Initialize(mapload)
. = ..()
- MakeSlippery(TURF_WET_LUBE, TRUE)
+ MakeSlippery(TURF_WET_LUBE, INFINITY)
/turf/simulated/floor/lubed/pry_tile(obj/item/C, mob/user, silent = FALSE) //I want to get off Mr Honk's Wild Ride
if(ishuman(user))
diff --git a/code/game/turfs/simulated/floor/plating.dm b/code/game/turfs/simulated/floor/plating.dm
index 85b03d3378d..588a8387474 100644
--- a/code/game/turfs/simulated/floor/plating.dm
+++ b/code/game/turfs/simulated/floor/plating.dm
@@ -104,7 +104,7 @@
broken = FALSE
update_icon()
-/turf/simulated/floor/plating/proc/remove_plating(mob/user)
+/turf/simulated/floor/plating/remove_plating(mob/user)
if(baseturf == /turf/space)
ReplaceWithLattice()
else
@@ -353,7 +353,7 @@
/turf/simulated/floor/plating/ice/Initialize(mapload)
. = ..()
- MakeSlippery(TURF_WET_PERMAFROST, TRUE)
+ MakeSlippery(TURF_WET_PERMAFROST, INFINITY)
/turf/simulated/floor/plating/ice/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
diff --git a/code/game/turfs/simulated/minerals.dm b/code/game/turfs/simulated/minerals.dm
index d1f7a287c70..ebad3554f18 100644
--- a/code/game/turfs/simulated/minerals.dm
+++ b/code/game/turfs/simulated/minerals.dm
@@ -32,7 +32,7 @@
icon = smooth_icon
. = ..()
if(mineralType && mineralAmt && spread && spreadChance)
- for(var/dir in cardinal)
+ for(var/dir in GLOB.cardinal)
if(prob(spreadChance))
var/turf/T = get_step(src, dir)
if(istype(T, /turf/simulated/mineral/random))
diff --git a/code/game/turfs/simulated/river.dm b/code/game/turfs/simulated/river.dm
index c7a3e742b6c..f463f3fb564 100644
--- a/code/game/turfs/simulated/river.dm
+++ b/code/game/turfs/simulated/river.dm
@@ -82,7 +82,7 @@
var/turf/simulated/mineral/M = T
logged_turf_type = M.turf_type
- if(get_dir(src, F) in cardinal)
+ if(get_dir(src, F) in GLOB.cardinal)
cardinal_turfs += F
else
diagonal_turfs += F
diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm
index 078a1b8e513..c18acf19d0a 100644
--- a/code/game/turfs/simulated/walls.dm
+++ b/code/game/turfs/simulated/walls.dm
@@ -139,7 +139,7 @@
P.setAngle(new_angle_s)
return TRUE
-/turf/simulated/wall/proc/dismantle_wall(devastated = 0, explode = 0)
+/turf/simulated/wall/dismantle_wall(devastated = FALSE, explode = FALSE)
if(devastated)
devastate_wall()
else
@@ -156,6 +156,7 @@
O.forceMove(src)
ChangeTurf(/turf/simulated/floor/plating)
+ return TRUE
/turf/simulated/wall/proc/break_wall()
new sheet_type(src, sheet_amount)
diff --git a/code/game/turfs/simulated/walls_mineral.dm b/code/game/turfs/simulated/walls_mineral.dm
index bc04a695da7..8b60be916c3 100644
--- a/code/game/turfs/simulated/walls_mineral.dm
+++ b/code/game/turfs/simulated/walls_mineral.dm
@@ -277,6 +277,9 @@
/turf/simulated/wall/mineral/titanium/nodecon/burn_down()
return
+/turf/simulated/wall/mineral/titanium/nodecon/welder_act()
+ return
+
/////////////////////Plastitanium walls/////////////////////
/turf/simulated/wall/mineral/plastitanium
diff --git a/code/game/turfs/simulated/walls_misc.dm b/code/game/turfs/simulated/walls_misc.dm
index e43ea15f53f..d2d7f8386ee 100644
--- a/code/game/turfs/simulated/walls_misc.dm
+++ b/code/game/turfs/simulated/walls_misc.dm
@@ -109,6 +109,7 @@
P.roll_and_drop(src)
else
O.forceMove(src)
+ return TRUE
/turf/simulated/wall/clockwork/devastate_wall()
for(var/i in 1 to 2)
diff --git a/code/game/turfs/simulated/walls_reinforced.dm b/code/game/turfs/simulated/walls_reinforced.dm
index 502803bc7d3..a3e9c9ae0f2 100644
--- a/code/game/turfs/simulated/walls_reinforced.dm
+++ b/code/game/turfs/simulated/walls_reinforced.dm
@@ -43,7 +43,7 @@
update_icon()
to_chat(user, "You press firmly on the cover, dislodging it.")
return
- else if(RWALL_SUPPORT_RODS && istype(I, /obj/item/gun/energy/plasmacutter))
+ else if(d_state == RWALL_SUPPORT_RODS && istype(I, /obj/item/gun/energy/plasmacutter))
to_chat(user, "You begin slicing through the support rods...")
if(I.use_tool(src, user, 70, volume = I.tool_volume) && d_state == RWALL_SUPPORT_RODS)
d_state = RWALL_SHEATH
@@ -132,11 +132,11 @@
to_chat(user, "You pry off the cover.")
if(RWALL_SHEATH)
to_chat(user, "You struggle to pry off the outer sheath...")
- if(!I.use_tool(src, user, 100, volume = I.tool_volume) || d_state != RWALL_SHEATH)
+ if(!I.use_tool(src, user, 100, volume = I.tool_volume))
return
- to_chat(user, "You pry off the outer sheath.")
- dismantle_wall()
- return
+ if(dismantle_wall())
+ to_chat(user, "You pry off the outer sheath.")
+
if(RWALL_BOLTS)
to_chat(user, "You start to pry the cover back into place...")
playsound(src, I.usesound, 100, 1)
@@ -199,6 +199,9 @@
to_chat(user, "You tighten the bolts anchoring the support rods.")
update_icon()
+/turf/simulated/wall/r_wall/try_decon(obj/item/I, mob/user, params) //Plasma cutter only works in the deconstruction steps!
+ return FALSE
+
/turf/simulated/wall/r_wall/try_destroy(obj/item/I, mob/user, params)
if(istype(I, /obj/item/pickaxe/drill/diamonddrill))
to_chat(user, "You begin to drill though the wall...")
diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm
index c797601d8e1..f78f520cfd3 100644
--- a/code/game/turfs/space/space.dm
+++ b/code/game/turfs/space/space.dm
@@ -42,14 +42,14 @@
/turf/space/BeforeChange()
..()
- var/datum/space_level/S = space_manager.get_zlev(z)
+ var/datum/space_level/S = GLOB.space_manager.get_zlev(z)
S.remove_from_transit(src)
if(light_sources) // Turn off starlight, if present
set_light(0)
/turf/space/AfterChange(ignore_air, keep_cabling = FALSE)
..()
- var/datum/space_level/S = space_manager.get_zlev(z)
+ var/datum/space_level/S = GLOB.space_manager.get_zlev(z)
S.add_to_transit(src)
S.apply_transition(src)
@@ -137,8 +137,8 @@
if(!cur_pos) return
cur_x = cur_pos["x"]
cur_y = cur_pos["y"]
- next_x = (--cur_x||global_map.len)
- y_arr = global_map[next_x]
+ next_x = (--cur_x||GLOB.global_map.len)
+ y_arr = GLOB.global_map[next_x]
target_z = y_arr[cur_y]
/*
//debug
@@ -162,8 +162,8 @@
if(!cur_pos) return
cur_x = cur_pos["x"]
cur_y = cur_pos["y"]
- next_x = (++cur_x > global_map.len ? 1 : cur_x)
- y_arr = global_map[next_x]
+ next_x = (++cur_x > GLOB.global_map.len ? 1 : cur_x)
+ y_arr = GLOB.global_map[next_x]
target_z = y_arr[cur_y]
/*
//debug
@@ -186,7 +186,7 @@
if(!cur_pos) return
cur_x = cur_pos["x"]
cur_y = cur_pos["y"]
- y_arr = global_map[cur_x]
+ y_arr = GLOB.global_map[cur_x]
next_y = (--cur_y||y_arr.len)
target_z = y_arr[next_y]
/*
@@ -211,7 +211,7 @@
if(!cur_pos) return
cur_x = cur_pos["x"]
cur_y = cur_pos["y"]
- y_arr = global_map[cur_x]
+ y_arr = GLOB.global_map[cur_x]
next_y = (++cur_y > y_arr.len ? 1 : cur_y)
target_z = y_arr[next_y]
/*
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index d589c3dcb64..aa3f7b898a1 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -70,7 +70,7 @@
/turf/Destroy()
// Adds the adjacent turfs to the current atmos processing
if(SSair)
- for(var/direction in cardinal)
+ for(var/direction in GLOB.cardinal)
if(atmos_adjacent_turfs & direction)
var/turf/simulated/T = get_step(src, direction)
if(istype(T))
@@ -180,6 +180,9 @@
if(L)
qdel(L)
+/turf/proc/dismantle_wall(devastated = FALSE, explode = FALSE)
+ return
+
/turf/proc/TerraformTurf(path, defer_change = FALSE, keep_icon = TRUE, ignore_air = FALSE)
return ChangeTurf(path, defer_change, keep_icon, ignore_air)
@@ -187,7 +190,7 @@
/turf/proc/ChangeTurf(path, defer_change = FALSE, keep_icon = TRUE, ignore_air = FALSE)
if(!path)
return
- if(!use_preloader && path == type) // Don't no-op if the map loader requires it to be reconstructed
+ if(!GLOB.use_preloader && path == type) // Don't no-op if the map loader requires it to be reconstructed
return src
set_light(0)
@@ -266,7 +269,7 @@
var/atemp = 0
var/turf_count = 0
- for(var/direction in cardinal)//Only use cardinals to cut down on lag
+ for(var/direction in GLOB.cardinal)//Only use cardinals to cut down on lag
var/turf/T = get_step(src,direction)
if(istype(T,/turf/space))//Counted as no air
turf_count++//Considered a valid turf for air calcs
@@ -292,6 +295,9 @@
ChangeTurf(baseturf)
new /obj/structure/lattice(locate(x, y, z))
+/turf/proc/remove_plating(mob/user)
+ return
+
/turf/proc/kill_creatures(mob/U = null)//Will kill people/creatures and damage mechs./N
//Useful to batch-add creatures to the list.
for(var/mob/living/M in src)
@@ -309,6 +315,10 @@
for(var/atom/movable/AM in contents)
AM.get_spooked()
+// Defined here to avoid runtimes
+/turf/proc/MakeDry(wet_setting = TURF_WET_WATER)
+ return
+
/turf/proc/burn_down()
return
@@ -327,7 +337,7 @@
var/list/L = new()
var/turf/simulated/T
- for(var/dir in cardinal)
+ for(var/dir in GLOB.cardinal)
T = get_step(src, dir)
if(istype(T) && !T.density)
if(!LinkBlockedWithAccess(src, T, ID))
@@ -340,7 +350,7 @@
var/list/L = new()
var/turf/simulated/T
- for(var/dir in cardinal)
+ for(var/dir in GLOB.cardinal)
T = get_step(src, dir)
if(istype(T) && !T.density)
if(!CanAtmosPass(T))
@@ -452,7 +462,7 @@
/turf/proc/visibilityChanged()
if(SSticker)
- cameranet.updateVisibility(src)
+ GLOB.cameranet.updateVisibility(src)
/turf/attackby(obj/item/I, mob/user, params)
if(can_lay_cable())
diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm
index e94d04f5dfb..824159487eb 100644
--- a/code/game/verbs/ooc.dm
+++ b/code/game/verbs/ooc.dm
@@ -1,8 +1,8 @@
-var/global/normal_ooc_colour = "#002eb8"
-var/global/member_ooc_colour = "#035417"
-var/global/mentor_ooc_colour = "#0099cc"
-var/global/moderator_ooc_colour = "#184880"
-var/global/admin_ooc_colour = "#b82e00"
+GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
+GLOBAL_VAR_INIT(member_ooc_colour, "#035417")
+GLOBAL_VAR_INIT(mentor_ooc_colour, "#0099cc")
+GLOBAL_VAR_INIT(moderator_ooc_colour, "#184880")
+GLOBAL_VAR_INIT(admin_ooc_colour, "#b82e00")
//Checks if the client already has a text input open
/client/proc/checkTyping()
@@ -54,21 +54,21 @@ var/global/admin_ooc_colour = "#b82e00"
log_ooc(msg, src)
- var/display_colour = normal_ooc_colour
+ var/display_colour = GLOB.normal_ooc_colour
if(holder && !holder.fakekey)
- display_colour = mentor_ooc_colour
+ display_colour = GLOB.mentor_ooc_colour
if(check_rights(R_MOD,0) && !check_rights(R_ADMIN,0))
- display_colour = moderator_ooc_colour
+ display_colour = GLOB.moderator_ooc_colour
else if(check_rights(R_ADMIN,0))
if(config.allow_admin_ooccolor)
display_colour = src.prefs.ooccolor
else
- display_colour = admin_ooc_colour
+ display_colour = GLOB.admin_ooc_colour
if(prefs.unlock_content)
- if(display_colour == normal_ooc_colour)
+ if(display_colour == GLOB.normal_ooc_colour)
if((prefs.toggles & MEMBER_PUBLIC))
- display_colour = member_ooc_colour
+ display_colour = GLOB.member_ooc_colour
for(var/client/C in GLOB.clients)
if(C.prefs.toggles & CHAT_OOC)
@@ -114,7 +114,7 @@ var/global/admin_ooc_colour = "#b82e00"
if(!check_rights(R_SERVER)) return
- normal_ooc_colour = newColor
+ GLOB.normal_ooc_colour = newColor
message_admins("[key_name_admin(usr)] has set the default player OOC color to [newColor]")
log_admin("[key_name(usr)] has set the default player OOC color to [newColor]")
@@ -128,7 +128,7 @@ var/global/admin_ooc_colour = "#b82e00"
if(!check_rights(R_SERVER)) return
- normal_ooc_colour = initial(normal_ooc_colour)
+ GLOB.normal_ooc_colour = initial(GLOB.normal_ooc_colour)
message_admins("[key_name_admin(usr)] has reset the default player OOC color")
log_admin("[key_name(usr)] has reset the default player OOC color")
diff --git a/code/game/world.dm b/code/game/world.dm
index 83407a6ae46..c1f6a076677 100644
--- a/code/game/world.dm
+++ b/code/game/world.dm
@@ -1,8 +1,12 @@
#define RECOMMENDED_VERSION 510
-var/global/list/map_transition_config = MAP_TRANSITION_CONFIG
+GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG)
/world/New()
+ //temporary file used to record errors with loading config, moved to log directory once logging is set up
+ GLOB.config_error_log = GLOB.world_game_log = GLOB.world_runtime_log = "data/logs/config_error.log"
+ load_configuration()
+ // Setup all log paths and stamp them with startups
SetupLogs()
enable_debugger() // Enable the extools debugger
log_world("World loaded at [time_stamp()]")
@@ -22,7 +26,7 @@ var/global/list/map_transition_config = MAP_TRANSITION_CONFIG
src.update_status()
- space_manager.initialize() //Before the MC starts up
+ GLOB.space_manager.initialize() //Before the MC starts up
. = ..()
@@ -47,8 +51,8 @@ var/global/list/map_transition_config = MAP_TRANSITION_CONFIG
// to_chat(world, "End of Topic() call.")
// ..()
-var/world_topic_spam_protect_ip = "0.0.0.0"
-var/world_topic_spam_protect_time = world.timeofday
+GLOBAL_VAR_INIT(world_topic_spam_protect_ip, "0.0.0.0")
+GLOBAL_VAR_INIT(world_topic_spam_protect_time, world.timeofday)
/world/Topic(T, addr, master, key)
log_misc("WORLD/TOPIC: \"[T]\", from:[addr], master:[master], key:[key]")
@@ -72,10 +76,10 @@ var/world_topic_spam_protect_time = world.timeofday
else if("status" in input)
var/list/s = list()
var/list/admins = list()
- s["version"] = game_version
- s["mode"] = master_mode
- s["respawn"] = config ? abandon_allowed : 0
- s["enter"] = enter_allowed
+ s["version"] = GLOB.game_version
+ s["mode"] = GLOB.master_mode
+ s["respawn"] = config ? GLOB.abandon_allowed : 0
+ s["enter"] = GLOB.enter_allowed
s["vote"] = config.allow_vote_mode
s["ai"] = config.allow_ai
s["host"] = host ? host : null
@@ -123,18 +127,18 @@ var/world_topic_spam_protect_time = world.timeofday
else if("manifest" in input)
var/list/positions = list()
var/list/set_names = list(
- "heads" = command_positions,
- "sec" = security_positions,
- "eng" = engineering_positions,
- "med" = medical_positions,
- "sci" = science_positions,
- "car" = supply_positions,
- "srv" = service_positions,
- "civ" = civilian_positions,
- "bot" = nonhuman_positions
+ "heads" = GLOB.command_positions,
+ "sec" = GLOB.security_positions,
+ "eng" = GLOB.engineering_positions,
+ "med" = GLOB.medical_positions,
+ "sci" = GLOB.science_positions,
+ "car" = GLOB.supply_positions,
+ "srv" = GLOB.service_positions,
+ "civ" = GLOB.civilian_positions,
+ "bot" = GLOB.nonhuman_positions
)
- for(var/datum/data/record/t in data_core.general)
+ for(var/datum/data/record/t in GLOB.data_core.general)
var/name = t.fields["name"]
var/rank = t.fields["rank"]
var/real_rank = t.fields["real_rank"]
@@ -251,18 +255,22 @@ var/world_topic_spam_protect_time = world.timeofday
return "Set listed status to invisible."
/proc/keySpamProtect(var/addr)
- if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50)
+ if(GLOB.world_topic_spam_protect_ip == addr && abs(GLOB.world_topic_spam_protect_time - world.time) < 50)
spawn(50)
- world_topic_spam_protect_time = world.time
+ GLOB.world_topic_spam_protect_time = world.time
return "Bad Key (Throttled)"
- world_topic_spam_protect_time = world.time
- world_topic_spam_protect_ip = addr
+ GLOB.world_topic_spam_protect_time = world.time
+ GLOB.world_topic_spam_protect_ip = addr
return "Bad Key"
/world/Reboot(var/reason, var/feedback_c, var/feedback_r, var/time)
if(reason == 1) //special reboot, do none of the normal stuff
if(usr)
+ if(!check_rights(R_SERVER))
+ message_admins("[key_name_admin(usr)] attempted to restart the server via the Profiler, without access.")
+ log_admin("[key_name(usr)] attempted to restart the server via the Profiler, without access.")
+ return
message_admins("[key_name_admin(usr)] has requested an immediate world restart via client side debugging tools")
log_admin("[key_name(usr)] has requested an immediate world restart via client side debugging tools")
spawn(0)
@@ -270,8 +278,8 @@ var/world_topic_spam_protect_time = world.timeofday
shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss.
if(config && config.shutdown_on_reboot)
sleep(0)
- if(shutdown_shell_command)
- shell(shutdown_shell_command)
+ if(GLOB.shutdown_shell_command)
+ shell(GLOB.shutdown_shell_command)
del(world)
return
else
@@ -294,8 +302,8 @@ var/world_topic_spam_protect_time = world.timeofday
if(!SSticker.delay_end)
world << round_end_sound
sleep(delay)
- if(blackbox)
- blackbox.save_all_data_to_sql()
+ if(GLOB.blackbox)
+ GLOB.blackbox.save_all_data_to_sql()
if(SSticker.delay_end)
to_chat(world, "Reboot was cancelled by an admin.")
return
@@ -304,7 +312,7 @@ var/world_topic_spam_protect_time = world.timeofday
//kick_clients_in_lobby("The round came to an end with you in the lobby.", 1)
Master.Shutdown() //run SS shutdowns
- dbcon.Disconnect() // DCs cleanly from the database
+ GLOB.dbcon.Disconnect() // DCs cleanly from the database
shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss.
for(var/client/C in GLOB.clients)
@@ -313,8 +321,8 @@ var/world_topic_spam_protect_time = world.timeofday
if(config && config.shutdown_on_reboot)
sleep(0)
- if(shutdown_shell_command)
- shell(shutdown_shell_command)
+ if(GLOB.shutdown_shell_command)
+ shell(GLOB.shutdown_shell_command)
del(world)
return
else
@@ -329,8 +337,8 @@ var/world_topic_spam_protect_time = world.timeofday
var/list/Lines = file2list("data/mode.txt")
if(Lines.len)
if(Lines[1])
- master_mode = Lines[1]
- log_game("Saved mode is '[master_mode]'")
+ GLOB.master_mode = Lines[1]
+ log_game("Saved mode is '[GLOB.master_mode]'")
/world/proc/save_mode(var/the_mode)
var/F = file("data/mode.txt")
@@ -342,7 +350,7 @@ var/world_topic_spam_protect_time = world.timeofday
return 1
/world/proc/load_motd()
- join_motd = file2text("config/motd.txt")
+ GLOB.join_motd = file2text("config/motd.txt")
GLOB.join_tos = file2text("config/tos.txt")
/proc/load_configuration()
@@ -366,7 +374,7 @@ var/world_topic_spam_protect_time = world.timeofday
s += "[config.server_name] — "
s += "[station_name()] "
if(config && config.githuburl)
- s+= "([game_version])"
+ s+= "([GLOB.game_version])"
if(config && config.server_tag_line)
s += "
[config.server_tag_line]"
@@ -379,7 +387,7 @@ var/world_topic_spam_protect_time = world.timeofday
s += "
"
var/list/features = list()
- if(!enter_allowed)
+ if(!GLOB.enter_allowed)
features += "closed"
if(config && config.server_extra_features)
@@ -391,7 +399,7 @@ var/world_topic_spam_protect_time = world.timeofday
if(config && config.wikiurl)
features += "Wiki"
- if(abandon_allowed)
+ if(GLOB.abandon_allowed)
features += "respawn"
if(features)
@@ -400,8 +408,8 @@ var/world_topic_spam_protect_time = world.timeofday
return s
#define FAILED_DB_CONNECTION_CUTOFF 5
-var/failed_db_connections = 0
-var/failed_old_db_connections = 0
+GLOBAL_VAR_INIT(failed_db_connections, 0)
+GLOBAL_VAR_INIT(failed_old_db_connections, 0)
/world/proc/SetupLogs()
GLOB.log_directory = "data/logs/[time2text(world.realtime, "YYYY/MM-Month/DD-Day")]"
@@ -436,11 +444,11 @@ var/failed_old_db_connections = 0
/proc/setup_database_connection()
- if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to conenct anymore.
+ if(GLOB.failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to conenct anymore.
return 0
- if(!dbcon)
- dbcon = new()
+ if(!GLOB.dbcon)
+ GLOB.dbcon = new()
var/user = sqlfdbklogin
var/pass = sqlfdbkpass
@@ -448,22 +456,22 @@ var/failed_old_db_connections = 0
var/address = sqladdress
var/port = sqlport
- dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
- . = dbcon.IsConnected()
+ GLOB.dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
+ . = GLOB.dbcon.IsConnected()
if( . )
- failed_db_connections = 0 //If this connection succeeded, reset the failed connections counter.
+ GLOB.failed_db_connections = 0 //If this connection succeeded, reset the failed connections counter.
else
- failed_db_connections++ //If it failed, increase the failed connections counter.
- log_world(dbcon.ErrorMsg())
+ GLOB.failed_db_connections++ //If it failed, increase the failed connections counter.
+ log_world(GLOB.dbcon.ErrorMsg())
return .
//This proc ensures that the connection to the feedback database (global variable dbcon) is established
proc/establish_db_connection()
- if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF)
+ if(GLOB.failed_db_connections > FAILED_DB_CONNECTION_CUTOFF)
return 0
- if(!dbcon || !dbcon.IsConnected())
+ if(!GLOB.dbcon || !GLOB.dbcon.IsConnected())
return setup_database_connection()
else
return 1
diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm
index 8168583e6fa..21b59586bfd 100644
--- a/code/modules/admin/DB ban/functions.dm
+++ b/code/modules/admin/DB ban/functions.dm
@@ -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("[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, "Ban saved to database.")
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 \\\"[reason]\\\" to \\\"[value]\\\"
') 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 \\\"[reason]\\\" to \\\"[value]\\\"
') 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]
'), 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]
'), 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, "Failed to establish database connection")
return
@@ -392,13 +392,13 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
output += ""
for(var/j in get_all_jobs())
output += ""
- for(var/j in nonhuman_positions)
+ for(var/j in GLOB.nonhuman_positions)
output += ""
- for(var/j in other_roles)
+ for(var/j in GLOB.other_roles)
output += ""
for(var/j in list("commanddept","securitydept","engineeringdept","medicaldept","sciencedept","supportdept","nonhumandept"))
output += ""
- for(var/j in list("Syndicate") + antag_roles)
+ for(var/j in list("Syndicate") + GLOB.antag_roles)
output += ""
output += ""
output += "Reason:
"
@@ -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()
diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm
index d776b4a2095..c7f2baac4ef 100644
--- a/code/modules/admin/IsBanned.dm
+++ b/code/modules/admin/IsBanned.dm
@@ -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("Failed Login: [key] - Guests not allowed")
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()
diff --git a/code/modules/admin/NewBan.dm b/code/modules/admin/NewBan.dm
index 222fc036db2..7b9a9330704 100644
--- a/code/modules/admin/NewBan.dm
+++ b/code/modules/admin/NewBan.dm
@@ -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 [config.banappeals]"
- 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: PERMENANT\nBy: [Banlist["bannedby"]][appeal]"
+ GLOB.banlist_savefile.cd = "/base/[ckey][id]"
+ .["desc"] = "\nReason: [GLOB.banlist_savefile["reason"]]\nExpires: PERMENANT\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: PERMENANT\nBy: [Banlist["bannedby"]][appeal]"
+ .["desc"] = "\nReason: [GLOB.banlist_savefile["reason"]]\nExpires: PERMENANT\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, "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_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)
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index 31aa6d5bc4c..df156c5b0df 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -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 = "ATTACK: "
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 += "[block-1] "
- bname = assigned_blocks[block]
+ bname = GLOB.assigned_blocks[block]
body += ""
if(bname)
var/bstate=M.dna.GetSEState(block)
@@ -306,7 +306,7 @@ var/global/nologevent = 0
Feed channels and stories entered through here will be uneditable and handled as official news by the rest of the units.
Note that this panel allows full freedom over the news network, there are no constrictions except the few basic ones. Don't break things!
"}
- if(news_network.wanted_issue)
+ if(GLOB.news_network.wanted_issue)
dat+= "
Read Wanted Issue"
dat+= {"
Create Feed Channel
@@ -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+={"
Feed Security functions:
@@ -327,10 +327,10 @@ var/global/nologevent = 0
"}
if(1)
dat+= "Station Feed Channels
"
- if( isemptylist(news_network.network_channels) )
+ if( isemptylist(GLOB.news_network.network_channels) )
dat+="No active channels found..."
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+="[CHANNEL.channel_name]
"
else
@@ -377,7 +377,7 @@ var/global/nologevent = 0
if(src.admincaster_feed_channel.channel_name =="" || src.admincaster_feed_channel.channel_name == "\[REDACTED\]")
dat+="•Invalid channel name.
"
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.
Select Feed channel to get Stories from:
"}
- if(isemptylist(news_network.network_channels))
+ if(isemptylist(GLOB.news_network.network_channels))
dat+="No feed channels found active...
"
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+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ""]
"
dat+="
Cancel"
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.
"}
- if(isemptylist(news_network.network_channels))
+ if(isemptylist(GLOB.news_network.network_channels))
dat+="No feed channels found active...
"
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+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ""]
"
dat+="
Back"
@@ -470,7 +470,7 @@ var/global/nologevent = 0
dat+="Wanted Issue Handler:"
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
Description: [src.admincaster_feed_message.body]
"}
if(wanted_already)
- dat+="Wanted Issue created by: [news_network.wanted_issue.backup_author]
"
+ dat+="Wanted Issue created by: [GLOB.news_network.wanted_issue.backup_author]
"
else
dat+="Wanted Issue will be created under prosecutor: [src.admincaster_signature]
"
dat+="
[(wanted_already) ? ("Edit Issue") : ("Submit")]"
@@ -507,13 +507,13 @@ var/global/nologevent = 0
"}
if(18)
dat+={"
- -- STATIONWIDE WANTED ISSUE --
\[Submitted by: [news_network.wanted_issue.backup_author]\]
- Criminal: [news_network.wanted_issue.author]
- Description: [news_network.wanted_issue.body]
+ -- STATIONWIDE WANTED ISSUE --
\[Submitted by: [GLOB.news_network.wanted_issue.backup_author]\]
+ Criminal: [GLOB.news_network.wanted_issue.author]
+ Description: [GLOB.news_network.wanted_issue.body]
Photo::
"}
- 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+="
"
else
dat+="None"
@@ -536,7 +536,7 @@ var/global/nologevent = 0
return
var/dat = "Job Bans!"
- 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
\n
Change Game Mode
"}
- if(master_mode == "secret")
+ if(GLOB.master_mode == "secret")
dat += "(Force Secret Mode)
"
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, "New players may no longer enter the game.")
else
to_chat(world, "New players may now enter the game.")
@@ -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, "You may now respawn.")
else
to_chat(world, "You may no longer respawn :(")
- 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, "The game start has been delayed.")
log_admin("[key_name(usr)] delayed the game.")
else
- going = TRUE
+ SSticker.ticker_going = TRUE
to_chat(world, "The game will start soon.")
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, "Guests may no longer enter the game.")
else
to_chat(world, "Guests may now enter the game.")
- log_admin("[key_name(usr)] toggled guests game entering [guests_allowed ? "" : "dis"]allowed.")
- message_admins("[key_name_admin(usr)] toggled guests game entering [guests_allowed ? "" : "dis"]allowed.", 1)
+ log_admin("[key_name(usr)] toggled guests game entering [GLOB.guests_allowed ? "" : "dis"]allowed.")
+ message_admins("[key_name_admin(usr)] toggled guests game entering [GLOB.guests_allowed ? "" : "dis"]allowed.", 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="")
diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm
index 49b2f06d003..13b786c5174 100644
--- a/code/modules/admin/admin_investigate.dm
+++ b/code/modules/admin/admin_investigate.dm
@@ -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 << "[time_stamp()] \ref[src] ([x],[y],[z]) || [src] [message]
"
/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 << "[time_stamp()] || [message]
"
//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
diff --git a/code/modules/admin/admin_memo.dm b/code/modules/admin/admin_memo.dm
index 530b9e7958e..455b38e1e0f 100644
--- a/code/modules/admin/admin_memo.dm
+++ b/code/modules/admin/admin_memo.dm
@@ -3,7 +3,7 @@
set category = "Server"
if(!check_rights(R_SERVER))
return
- if(!dbcon.IsConnected())
+ if(!GLOB.dbcon.IsConnected())
to_chat(src, "Failed to establish database connection.")
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, "Failed to establish database connection.")
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:
[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
[old_memo]
to
[new_memo]
"
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")
diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm
index 82f82d3dabe..5956819d3d4 100644
--- a/code/modules/admin/admin_ranks.dm
+++ b/code/modules/admin/admin_ranks.dm
@@ -1,8 +1,9 @@
-var/list/admin_ranks = list() //list of all ranks with associated rights
+GLOBAL_LIST_EMPTY(admin_ranks) //list of all ranks with associated rights
+GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
//load our rank - > rights associations
/proc/load_admin_ranks()
- admin_ranks.Cut()
+ GLOB.admin_ranks.Cut()
var/previous_rights = 0
@@ -43,14 +44,15 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
if("mod") rights |= R_MOD
if("mentor") rights |= R_MENTOR
if("proccall") rights |= R_PROCCALL
+ if("viewruntimes") rights |= R_VIEWRUNTIMES
- admin_ranks[rank] = rights
+ GLOB.admin_ranks[rank] = rights
previous_rights = rights
#ifdef TESTING
var/msg = "Permission Sets Built:\n"
- for(var/rank in admin_ranks)
- msg += "\t[rank] - [admin_ranks[rank]]\n"
+ for(var/rank in GLOB.admin_ranks)
+ msg += "\t[rank] - [GLOB.admin_ranks[rank]]\n"
testing(msg)
#endif
@@ -60,12 +62,16 @@ 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
GLOB.admins.Cut()
+ // Remove all profiler access
+ for(var/A in world.GetConfig("admin"))
+ world.SetConfig("APP/admin", A, null)
+
if(config.admin_legacy_system)
load_admin_ranks()
@@ -91,11 +97,14 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
rank = ckeyEx(List[2])
//load permissions associated with this rank
- var/rights = admin_ranks[rank]
+ var/rights = GLOB.admin_ranks[rank]
//create the admin datum and store it for later use
var/datum/admins/D = new /datum/admins(rank, rights, ckey)
+ if(D.rights & R_DEBUG || D.rights & R_VIEWRUNTIMES) // Grants profiler access to anyone with R_DEBUG or R_VIEWRUNTIMES
+ world.SetConfig("APP/admin", ckey, "role=admin")
+
//find the client for a ckey if they are connected and associate them with the new admin datum
D.associate(GLOB.directory[ckey])
@@ -103,13 +112,13 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
//The current admin system uses SQL
establish_db_connection()
- if(!dbcon.IsConnected())
+ if(!GLOB.dbcon.IsConnected())
log_world("Failed to connect to database in load_admins(). Reverting to legacy system.")
config.admin_legacy_system = 1
load_admins()
return
- var/DBQuery/query = dbcon.NewQuery("SELECT ckey, rank, level, flags FROM [format_table_name("admin")]")
+ var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, rank, level, flags FROM [format_table_name("admin")]")
query.Execute()
while(query.NextRow())
var/ckey = query.item[1]
@@ -120,9 +129,12 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
if(istext(rights)) rights = text2num(rights)
var/datum/admins/D = new /datum/admins(rank, rights, ckey)
+ if(D.rights & R_DEBUG || D.rights & R_VIEWRUNTIMES) // Grants profiler access to anyone with R_DEBUG or R_VIEWRUNTIMES
+ world.SetConfig("APP/admin", ckey, "role=admin")
+
//find the client for a ckey if they are connected and associate them with the new admin datum
D.associate(GLOB.directory[ckey])
- if(!admin_datums)
+ if(!GLOB.admin_datums)
log_world("The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system.")
config.admin_legacy_system = 1
load_admins()
@@ -130,9 +142,9 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
#ifdef TESTING
var/msg = "Admins Built:\n"
- for(var/ckey in admin_datums)
+ for(var/ckey in GLOB.admin_datums)
var/rank
- var/datum/admins/D = admin_datums[ckey]
+ var/datum/admins/D = GLOB.admin_datums[ckey]
if(D) rank = D.rank
msg += "\t[ckey] - [rank]\n"
testing(msg)
@@ -140,12 +152,12 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
#ifdef TESTING
-/client/verb/changerank(newrank in admin_ranks)
+/client/verb/changerank(newrank in GLOB.admin_ranks)
if(holder)
holder.rank = newrank
- holder.rights = admin_ranks[newrank]
+ holder.rights = GLOB.admin_ranks[newrank]
else
- holder = new /datum/admins(newrank,admin_ranks[newrank],ckey)
+ holder = new /datum/admins(newrank,GLOB.admin_ranks[newrank],ckey)
remove_admin_verbs()
holder.associate(src)
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index 9a60d41aa66..4e3d2d65f30 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -1,13 +1,13 @@
//admin verb groups - They can overlap if you so wish. Only one of each verb will exist in the verbs list regardless
-var/list/admin_verbs_default = list(
+GLOBAL_LIST_INIT(admin_verbs_default, list(
/client/proc/deadmin_self, /*destroys our own admin datum so we can play as a regular player*/
/client/proc/hide_verbs, /*hides all our adminverbs*/
/client/proc/toggleadminhelpsound,
/client/proc/togglementorhelpsound,
/client/proc/cmd_mentor_check_new_players,
/client/proc/cmd_mentor_check_player_exp /* shows players by playtime */
- )
-var/list/admin_verbs_admin = list(
+ ))
+GLOBAL_LIST_INIT(admin_verbs_admin, list(
/client/proc/check_antagonists, /*shows all antags*/
/datum/admins/proc/show_player_panel,
/client/proc/player_panel, /*shows an interface for all players, with links to various panels (old style)*/
@@ -26,6 +26,7 @@ var/list/admin_verbs_admin = list(
/client/proc/cmd_admin_subtle_message, /*send an message to somebody as a 'voice in their head'*/
/client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/
/client/proc/cmd_admin_check_contents, /*displays the contents of an instance*/
+ /client/proc/cmd_admin_open_logging_view,
/client/proc/getserverlogs, /*allows us to fetch server logs (diary) for other days*/
/client/proc/jumptocoord, /*we ghost and jump to a coordinate*/
/client/proc/Getmob, /*teleports a mob to our location*/
@@ -67,7 +68,6 @@ var/list/admin_verbs_admin = list(
/client/proc/empty_ai_core_toggle_latejoin,
/client/proc/aooc,
/client/proc/freeze,
- /client/proc/freezemecha,
/client/proc/alt_check,
/client/proc/secrets,
/client/proc/change_human_appearance_admin, /* Allows an admin to change the basic appearance of human-based mobs */
@@ -79,20 +79,20 @@ var/list/admin_verbs_admin = list(
/client/proc/list_ssds_afks,
/client/proc/cmd_admin_headset_message,
/client/proc/spawn_floor_cluwne
-)
-var/list/admin_verbs_ban = list(
+))
+GLOBAL_LIST_INIT(admin_verbs_ban, list(
/client/proc/unban_panel,
/client/proc/jobbans,
/client/proc/stickybanpanel
- )
-var/list/admin_verbs_sounds = list(
+ ))
+GLOBAL_LIST_INIT(admin_verbs_sounds, list(
/client/proc/play_local_sound,
/client/proc/play_sound,
/client/proc/play_server_sound,
/client/proc/play_intercomm_sound,
/client/proc/stop_global_admin_sounds
- )
-var/list/admin_verbs_event = list(
+ ))
+GLOBAL_LIST_INIT(admin_verbs_event, list(
/client/proc/object_talk,
/client/proc/cmd_admin_dress,
/client/proc/cmd_admin_gib_self,
@@ -117,14 +117,14 @@ var/list/admin_verbs_event = list(
/client/proc/event_manager_panel,
/client/proc/modify_goals,
/client/proc/outfit_manager
- )
+ ))
-var/list/admin_verbs_spawn = list(
+GLOBAL_LIST_INIT(admin_verbs_spawn, list(
/datum/admins/proc/spawn_atom, /*allows us to spawn instances*/
/client/proc/respawn_character,
/client/proc/admin_deserialize
- )
-var/list/admin_verbs_server = list(
+ ))
+GLOBAL_LIST_INIT(admin_verbs_server, list(
/client/proc/ToRban,
/client/proc/Set_Holiday,
/datum/admins/proc/startnow,
@@ -144,8 +144,8 @@ var/list/admin_verbs_server = list(
/client/proc/toggle_antagHUD_restrictions,
/client/proc/set_ooc,
/client/proc/reset_ooc
- )
-var/list/admin_verbs_debug = list(
+ ))
+GLOBAL_LIST_INIT(admin_verbs_debug, list(
/client/proc/cmd_admin_list_open_jobs,
/client/proc/Debug2,
/client/proc/cmd_debug_make_powernets,
@@ -172,21 +172,21 @@ var/list/admin_verbs_debug = list(
/client/proc/admin_serialize,
/client/proc/jump_to_ruin,
/client/proc/toggle_medal_disable,
- )
-var/list/admin_verbs_possess = list(
+ ))
+GLOBAL_LIST_INIT(admin_verbs_possess, list(
/proc/possess,
/proc/release
- )
-var/list/admin_verbs_permissions = list(
+ ))
+GLOBAL_LIST_INIT(admin_verbs_permissions, list(
/client/proc/edit_admin_permissions,
/client/proc/create_poll,
/client/proc/big_brother
- )
-var/list/admin_verbs_rejuv = list(
+ ))
+GLOBAL_LIST_INIT(admin_verbs_rejuv, list(
/client/proc/respawn_character,
/client/proc/cmd_admin_rejuvenate
- )
-var/list/admin_verbs_mod = list(
+ ))
+GLOBAL_LIST_INIT(admin_verbs_mod, list(
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
/client/proc/cmd_admin_pm_panel, /*admin-pm list*/
/client/proc/cmd_admin_pm_by_key_panel, /*admin-pm list by key*/
@@ -199,8 +199,8 @@ var/list/admin_verbs_mod = list(
/datum/admins/proc/show_player_panel,
/client/proc/jobbans,
/client/proc/debug_variables /*allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify*/
-)
-var/list/admin_verbs_mentor = list(
+))
+GLOBAL_LIST_INIT(admin_verbs_mentor, list(
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
/client/proc/cmd_admin_pm_panel, /*admin-pm list*/
/client/proc/cmd_admin_pm_by_key_panel, /*admin-pm list by key*/
@@ -208,20 +208,20 @@ var/list/admin_verbs_mentor = list(
/client/proc/toggleMentorTicketLogs,
/client/proc/cmd_mentor_say /* mentor say*/
// cmd_mentor_say is added/removed by the toggle_mentor_chat verb
-)
-var/list/admin_verbs_proccall = list(
+))
+GLOBAL_LIST_INIT(admin_verbs_proccall, list(
/client/proc/callproc,
/client/proc/callproc_datum,
/client/proc/SDQL2_query
-)
-var/list/admin_verbs_ticket = list(
+))
+GLOBAL_LIST_INIT(admin_verbs_ticket, list(
/client/proc/openAdminTicketUI,
/client/proc/toggleticketlogs,
/client/proc/openMentorTicketUI,
/client/proc/toggleMentorTicketLogs,
/client/proc/resolveAllAdminTickets,
/client/proc/resolveAllMentorTickets
-)
+))
/client/proc/on_holder_add()
if(chatOutput && chatOutput.loaded)
@@ -229,62 +229,71 @@ var/list/admin_verbs_ticket = list(
/client/proc/add_admin_verbs()
if(holder)
- verbs += admin_verbs_default
+ // If they have ANYTHING OTHER THAN ONLY VIEW RUNTIMES (65536), then give them the default admin verbs
+ if(holder.rights != R_VIEWRUNTIMES)
+ verbs += GLOB.admin_verbs_default
if(holder.rights & R_BUILDMODE)
verbs += /client/proc/togglebuildmodeself
if(holder.rights & R_ADMIN)
- verbs += admin_verbs_admin
- verbs += admin_verbs_ticket
+ verbs += GLOB.admin_verbs_admin
+ verbs += GLOB.admin_verbs_ticket
spawn(1)
control_freak = 0
if(holder.rights & R_BAN)
- verbs += admin_verbs_ban
+ verbs += GLOB.admin_verbs_ban
if(holder.rights & R_EVENT)
- verbs += admin_verbs_event
+ verbs += GLOB.admin_verbs_event
if(holder.rights & R_SERVER)
- verbs += admin_verbs_server
+ verbs += GLOB.admin_verbs_server
if(holder.rights & R_DEBUG)
- verbs += admin_verbs_debug
+ verbs += GLOB.admin_verbs_debug
+ spawn(1)
+ control_freak = 0 // Setting control_freak to 0 allows you to use the Profiler and other client-side tools
if(holder.rights & R_POSSESS)
- verbs += admin_verbs_possess
+ verbs += GLOB.admin_verbs_possess
if(holder.rights & R_PERMISSIONS)
- verbs += admin_verbs_permissions
+ verbs += GLOB.admin_verbs_permissions
if(holder.rights & R_STEALTH)
verbs += /client/proc/stealth
if(holder.rights & R_REJUVINATE)
- verbs += admin_verbs_rejuv
+ verbs += GLOB.admin_verbs_rejuv
if(holder.rights & R_SOUNDS)
- verbs += admin_verbs_sounds
+ verbs += GLOB.admin_verbs_sounds
if(holder.rights & R_SPAWN)
- verbs += admin_verbs_spawn
+ verbs += GLOB.admin_verbs_spawn
if(holder.rights & R_MOD)
- verbs += admin_verbs_mod
+ verbs += GLOB.admin_verbs_mod
if(holder.rights & R_MENTOR)
- verbs += admin_verbs_mentor
+ verbs += GLOB.admin_verbs_mentor
if(holder.rights & R_PROCCALL)
- verbs += admin_verbs_proccall
+ verbs += GLOB.admin_verbs_proccall
+ if(holder.rights & R_VIEWRUNTIMES)
+ verbs += /client/proc/view_runtimes
+ spawn(1) // This setting exposes the profiler for people with R_VIEWRUNTIMES. They must still have it set in cfg/admin.txt
+ control_freak = 0
+
/client/proc/remove_admin_verbs()
verbs.Remove(
- admin_verbs_default,
+ GLOB.admin_verbs_default,
/client/proc/togglebuildmodeself,
- admin_verbs_admin,
- admin_verbs_ban,
- admin_verbs_event,
- admin_verbs_server,
- admin_verbs_debug,
- admin_verbs_possess,
- admin_verbs_permissions,
+ GLOB.admin_verbs_admin,
+ GLOB.admin_verbs_ban,
+ GLOB.admin_verbs_event,
+ GLOB.admin_verbs_server,
+ GLOB.admin_verbs_debug,
+ GLOB.admin_verbs_possess,
+ GLOB.admin_verbs_permissions,
/client/proc/stealth,
- admin_verbs_rejuv,
- admin_verbs_sounds,
- admin_verbs_spawn,
- admin_verbs_mod,
- admin_verbs_mentor,
- admin_verbs_proccall,
- admin_verbs_show_debug_verbs,
+ GLOB.admin_verbs_rejuv,
+ GLOB.admin_verbs_sounds,
+ GLOB.admin_verbs_spawn,
+ GLOB.admin_verbs_mod,
+ GLOB.admin_verbs_mentor,
+ GLOB.admin_verbs_proccall,
+ GLOB.admin_verbs_show_debug_verbs,
/client/proc/readmin,
- admin_verbs_ticket
+ GLOB.admin_verbs_ticket
)
/client/proc/hide_verbs()
@@ -514,14 +523,14 @@ var/list/admin_verbs_ticket = list(
return
if(!warned_ckey || !istext(warned_ckey)) return
- if(warned_ckey in admin_datums)
+ if(warned_ckey in GLOB.admin_datums)
to_chat(usr, "Error: warn(): You can't warn admins.")
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, "Error: warn(): No such ckey found.")
@@ -601,7 +610,7 @@ var/list/admin_verbs_ticket = list(
var/list/spell_list = list()
var/type_length = length("/obj/effect/proc_holder/spell") + 2
- for(var/A in spells)
+ for(var/A in GLOB.spells)
spell_list[copytext("[A]", type_length)] = A
var/obj/effect/proc_holder/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in spell_list
if(!S)
@@ -620,7 +629,7 @@ var/list/admin_verbs_ticket = list(
set category = "Event"
set name = "Give Disease"
set desc = "Gives a Disease to a mob."
- var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in diseases
+ var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in GLOB.diseases
if(!D) return
T.ForceContractDisease(new D)
feedback_add_details("admin_verb","GD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -694,7 +703,7 @@ var/list/admin_verbs_ticket = list(
set category = "Admin"
set desc = "Regain your admin powers."
- var/datum/admins/D = admin_datums[ckey]
+ var/datum/admins/D = GLOB.admin_datums[ckey]
var/rank = null
if(config.admin_legacy_system)
//load text from file
@@ -707,26 +716,26 @@ var/list/admin_verbs_ticket = list(
break
continue
else
- if(!dbcon.IsConnected())
+ if(!GLOB.dbcon.IsConnected())
message_admins("Warning, MySQL database is not connected.")
to_chat(src, "Warning, MYSQL database is not connected.")
return
var/sql_ckey = sanitizeSQL(ckey)
- var/DBQuery/query = dbcon.NewQuery("SELECT rank FROM [format_table_name("admin")] WHERE ckey = '[sql_ckey]'")
+ var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT rank FROM [format_table_name("admin")] WHERE ckey = '[sql_ckey]'")
query.Execute()
while(query.NextRow())
rank = ckeyEx(query.item[1])
if(!D)
if(config.admin_legacy_system)
- if(admin_ranks[rank] == null)
+ if(GLOB.admin_ranks[rank] == null)
error("Error while re-adminning [src], admin rank ([rank]) does not exist.")
to_chat(src, "Error while re-adminning, admin rank ([rank]) does not exist.")
return
- D = new(rank, admin_ranks[rank], ckey)
+ D = new(rank, GLOB.admin_ranks[rank], ckey)
else
var/sql_ckey = sanitizeSQL(ckey)
- var/DBQuery/query = dbcon.NewQuery("SELECT ckey, rank, flags FROM [format_table_name("admin")] WHERE ckey = '[sql_ckey]'")
+ var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, rank, flags FROM [format_table_name("admin")] WHERE ckey = '[sql_ckey]'")
query.Execute()
while(query.NextRow())
var/admin_ckey = query.item[1]
@@ -791,7 +800,7 @@ var/list/admin_verbs_ticket = list(
if(!S) return
var/datum/nano_module/law_manager/L = new(S)
- L.ui_interact(usr, state = admin_state)
+ L.ui_interact(usr, state = GLOB.admin_state)
log_and_message_admins("has opened [S]'s law manager.")
feedback_add_details("admin_verb","MSL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
diff --git a/code/modules/admin/banappearance.dm b/code/modules/admin/banappearance.dm
index ff461c0f333..b561e0169ff 100644
--- a/code/modules/admin/banappearance.dm
+++ b/code/modules/admin/banappearance.dm
@@ -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
diff --git a/code/modules/admin/banjob.dm b/code/modules/admin/banjob.dm
index 81060503f06..9efc4c9ce88 100644
--- a/code/modules/admin/banjob.dm
+++ b/code/modules/admin/banjob.dm
@@ -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())
diff --git a/code/modules/admin/create_mob.dm b/code/modules/admin/create_mob.dm
index e6148c7f554..616d5aa9ee8 100644
--- a/code/modules/admin/create_mob.dm
+++ b/code/modules/admin/create_mob.dm
@@ -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")
diff --git a/code/modules/admin/create_object.dm b/code/modules/admin/create_object.dm
index e3a930058bd..c311be0d017 100644
--- a/code/modules/admin/create_object.dm
+++ b/code/modules/admin/create_object.dm
@@ -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")
diff --git a/code/modules/admin/create_poll.dm b/code/modules/admin/create_poll.dm
index a1c6de98d93..63592663469 100644
--- a/code/modules/admin/create_poll.dm
+++ b/code/modules/admin/create_poll.dm
@@ -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, "Failed to establish database connection.")
return
create_poll_window()
/client/proc/create_poll_window(var/errormessage = "")
- if(!check_rights(R_SERVER))
+ if(!check_rights(R_SERVER))
return
var/output={"
@@ -75,7 +75,7 @@ function onload() {