mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Makes all global variables handled by the GLOB controller (#13152)
* Handlers converted, now to fix 3532 compile errors * 3532 compile fixes later, got runtimes on startup * Well the server loads now atleast * Take 2 * Oops
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
var/global/list/obj/machinery/message_server/message_servers = list()
|
||||
GLOBAL_LIST_EMPTY(message_servers)
|
||||
|
||||
/datum/data_pda_msg
|
||||
var/recipient = "Unspecified" //name of the person
|
||||
@@ -60,14 +60,14 @@ var/global/list/obj/machinery/message_server/message_servers = list()
|
||||
var/decryptkey = "password"
|
||||
|
||||
/obj/machinery/message_server/New()
|
||||
message_servers += src
|
||||
GLOB.message_servers += src
|
||||
decryptkey = GenerateKey()
|
||||
send_pda_message("System Administrator", "system", "This is an automated message. The messaging system is functioning correctly.")
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/message_server/Destroy()
|
||||
message_servers -= src
|
||||
GLOB.message_servers -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/message_server/process()
|
||||
@@ -91,7 +91,7 @@ var/global/list/obj/machinery/message_server/message_servers = list()
|
||||
authmsg += "[id_auth]<br>"
|
||||
if(stamp)
|
||||
authmsg += "[stamp]<br>"
|
||||
for(var/obj/machinery/requests_console/Console in allConsoles)
|
||||
for(var/obj/machinery/requests_console/Console in GLOB.allRequestConsoles)
|
||||
if(ckey(Console.department) == ckey(recipient))
|
||||
if(Console.inoperable())
|
||||
Console.message_log += "<B>Message lost due to console failure.</B><BR>Please contact [station_name()] system adminsitrator or AI for technical assistance.<BR>"
|
||||
@@ -190,7 +190,7 @@ var/global/list/obj/machinery/message_server/message_servers = list()
|
||||
/datum/feedback_variable/proc/get_parsed()
|
||||
return list(variable,value,details)
|
||||
|
||||
var/obj/machinery/blackbox_recorder/blackbox
|
||||
GLOBAL_DATUM(blackbox, /obj/machinery/blackbox_recorder)
|
||||
|
||||
//TODO: kill whoever designed this cancer
|
||||
/obj/machinery/blackbox_recorder
|
||||
@@ -222,15 +222,15 @@ var/obj/machinery/blackbox_recorder/blackbox
|
||||
|
||||
//Only one can exsist in the world!
|
||||
/obj/machinery/blackbox_recorder/New()
|
||||
if(blackbox)
|
||||
if(istype(blackbox,/obj/machinery/blackbox_recorder))
|
||||
if(GLOB.blackbox)
|
||||
if(istype(GLOB.blackbox,/obj/machinery/blackbox_recorder))
|
||||
qdel(src)
|
||||
blackbox = src
|
||||
GLOB.blackbox = src
|
||||
|
||||
/obj/machinery/blackbox_recorder/Destroy()
|
||||
var/turf/T = locate(1,1,2)
|
||||
if(T)
|
||||
blackbox = null
|
||||
GLOB.blackbox = null
|
||||
var/obj/machinery/blackbox_recorder/BR = new/obj/machinery/blackbox_recorder(T)
|
||||
BR.msg_common = msg_common
|
||||
BR.msg_science = msg_science
|
||||
@@ -247,8 +247,8 @@ var/obj/machinery/blackbox_recorder/blackbox
|
||||
BR.feedback = feedback
|
||||
BR.messages = messages
|
||||
BR.messages_admin = messages_admin
|
||||
if(blackbox != BR)
|
||||
blackbox = BR
|
||||
if(GLOB.blackbox != BR)
|
||||
GLOB.blackbox = BR
|
||||
return ..()
|
||||
|
||||
/obj/machinery/blackbox_recorder/proc/find_feedback_datum(var/variable)
|
||||
@@ -301,10 +301,10 @@ var/obj/machinery/blackbox_recorder/blackbox
|
||||
|
||||
round_end_data_gathering() //round_end time logging and some other data processing
|
||||
establish_db_connection()
|
||||
if(!dbcon.IsConnected()) return
|
||||
if(!GLOB.dbcon.IsConnected()) return
|
||||
var/round_id
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT MAX(round_id) AS round_id FROM [format_table_name("feedback")]")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT MAX(round_id) AS round_id FROM [format_table_name("feedback")]")
|
||||
query.Execute()
|
||||
while(query.NextRow())
|
||||
round_id = query.item[1]
|
||||
@@ -315,7 +315,7 @@ var/obj/machinery/blackbox_recorder/blackbox
|
||||
|
||||
for(var/datum/feedback_variable/FV in feedback)
|
||||
var/sql = "INSERT INTO [format_table_name("feedback")] VALUES (null, Now(), [round_id], \"[FV.get_variable()]\", [FV.get_value()], \"[FV.get_details()]\")"
|
||||
var/DBQuery/query_insert = dbcon.NewQuery(sql)
|
||||
var/DBQuery/query_insert = GLOB.dbcon.NewQuery(sql)
|
||||
query_insert.Execute()
|
||||
|
||||
/obj/machinery/blackbox_recorder/vv_edit_var(var_name, var_value)
|
||||
@@ -323,57 +323,57 @@ var/obj/machinery/blackbox_recorder/blackbox
|
||||
|
||||
|
||||
proc/feedback_set(var/variable,var/value)
|
||||
if(!blackbox) return
|
||||
if(!GLOB.blackbox) return
|
||||
|
||||
variable = sanitizeSQL(variable)
|
||||
|
||||
var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable)
|
||||
var/datum/feedback_variable/FV = GLOB.blackbox.find_feedback_datum(variable)
|
||||
|
||||
if(!FV) return
|
||||
|
||||
FV.set_value(value)
|
||||
|
||||
proc/feedback_inc(var/variable,var/value)
|
||||
if(!blackbox) return
|
||||
if(!GLOB.blackbox) return
|
||||
|
||||
variable = sanitizeSQL(variable)
|
||||
|
||||
var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable)
|
||||
var/datum/feedback_variable/FV = GLOB.blackbox.find_feedback_datum(variable)
|
||||
|
||||
if(!FV) return
|
||||
|
||||
FV.inc(value)
|
||||
|
||||
proc/feedback_dec(var/variable,var/value)
|
||||
if(!blackbox) return
|
||||
if(!GLOB.blackbox) return
|
||||
|
||||
variable = sanitizeSQL(variable)
|
||||
|
||||
var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable)
|
||||
var/datum/feedback_variable/FV = GLOB.blackbox.find_feedback_datum(variable)
|
||||
|
||||
if(!FV) return
|
||||
|
||||
FV.dec(value)
|
||||
|
||||
proc/feedback_set_details(var/variable,var/details)
|
||||
if(!blackbox) return
|
||||
if(!GLOB.blackbox) return
|
||||
|
||||
variable = sanitizeSQL(variable)
|
||||
details = sanitizeSQL(details)
|
||||
|
||||
var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable)
|
||||
var/datum/feedback_variable/FV = GLOB.blackbox.find_feedback_datum(variable)
|
||||
|
||||
if(!FV) return
|
||||
|
||||
FV.set_details(details)
|
||||
|
||||
proc/feedback_add_details(var/variable,var/details)
|
||||
if(!blackbox) return
|
||||
if(!GLOB.blackbox) return
|
||||
|
||||
variable = sanitizeSQL(variable)
|
||||
details = sanitizeSQL(details)
|
||||
|
||||
var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable)
|
||||
var/datum/feedback_variable/FV = GLOB.blackbox.find_feedback_datum(variable)
|
||||
|
||||
if(!FV) return
|
||||
|
||||
|
||||
@@ -645,7 +645,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
ui = new(user, src, ui_key, "r_n_d.tmpl", src.name, 800, 550)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/rdconsole/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state)
|
||||
/obj/machinery/computer/rdconsole/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
|
||||
var/data[0]
|
||||
|
||||
files.RefreshResearch()
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
|
||||
var/obj/machinery/computer/camera_advanced/xenobio/X = target
|
||||
|
||||
if(cameranet.checkTurfVis(remote_eye.loc))
|
||||
if(GLOB.cameranet.checkTurfVis(remote_eye.loc))
|
||||
for(var/mob/living/simple_animal/slime/S in X.stored_slimes)
|
||||
S.forceMove(remote_eye.loc)
|
||||
S.visible_message("[S] warps in!")
|
||||
@@ -207,7 +207,7 @@
|
||||
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
|
||||
var/obj/machinery/computer/camera_advanced/xenobio/X = target
|
||||
|
||||
if(cameranet.checkTurfVis(remote_eye.loc))
|
||||
if(GLOB.cameranet.checkTurfVis(remote_eye.loc))
|
||||
for(var/mob/living/simple_animal/slime/S in remote_eye.loc)
|
||||
if(X.stored_slimes.len >= X.max_slimes)
|
||||
break
|
||||
@@ -231,7 +231,7 @@
|
||||
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
|
||||
var/obj/machinery/computer/camera_advanced/xenobio/X = target
|
||||
|
||||
if(cameranet.checkTurfVis(remote_eye.loc))
|
||||
if(GLOB.cameranet.checkTurfVis(remote_eye.loc))
|
||||
if(LAZYLEN(SSmobs.cubemonkeys) >= config.cubemonkeycap)
|
||||
to_chat(owner, "<span class='warning'>Bluespace harmonics prevent the spawning of more than [config.cubemonkeycap] monkeys on the station at one time!</span>")
|
||||
return
|
||||
@@ -259,7 +259,7 @@
|
||||
if(!recycler)
|
||||
to_chat(owner, "<span class='notice'>There is no connected monkey recycler. Use a multitool to link one.</span>")
|
||||
return
|
||||
if(cameranet.checkTurfVis(remote_eye.loc))
|
||||
if(GLOB.cameranet.checkTurfVis(remote_eye.loc))
|
||||
for(var/mob/living/carbon/human/M in remote_eye.loc)
|
||||
if(issmall(M) && M.stat)
|
||||
M.visible_message("[M] vanishes as [M.p_theyre()] reclaimed for recycling!")
|
||||
@@ -279,7 +279,7 @@
|
||||
var/mob/living/C = owner
|
||||
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
|
||||
|
||||
if(cameranet.checkTurfVis(remote_eye.loc))
|
||||
if(GLOB.cameranet.checkTurfVis(remote_eye.loc))
|
||||
for(var/mob/living/simple_animal/slime/S in remote_eye.loc)
|
||||
slime_scan(S, C)
|
||||
else
|
||||
@@ -301,7 +301,7 @@
|
||||
to_chat(owner, "<span class='warning'>No potion loaded.</span>")
|
||||
return
|
||||
|
||||
if(cameranet.checkTurfVis(remote_eye.loc))
|
||||
if(GLOB.cameranet.checkTurfVis(remote_eye.loc))
|
||||
for(var/mob/living/simple_animal/slime/S in remote_eye.loc)
|
||||
X.current_potion.attack(S, C)
|
||||
break
|
||||
@@ -357,7 +357,7 @@
|
||||
|
||||
// Scans slime
|
||||
/obj/machinery/computer/camera_advanced/xenobio/proc/XenoSlimeClickCtrl(mob/living/user, mob/living/simple_animal/slime/S)
|
||||
if(!cameranet.checkTurfVis(S.loc))
|
||||
if(!GLOB.cameranet.checkTurfVis(S.loc))
|
||||
to_chat(user, "<span class='warning'>Target is not near a camera. Cannot proceed.</span>")
|
||||
return
|
||||
var/mob/living/C = user
|
||||
@@ -368,7 +368,7 @@
|
||||
|
||||
//Feeds a potion to slime
|
||||
/obj/machinery/computer/camera_advanced/xenobio/proc/XenoSlimeClickAlt(mob/living/user, mob/living/simple_animal/slime/S)
|
||||
if(!cameranet.checkTurfVis(S.loc))
|
||||
if(!GLOB.cameranet.checkTurfVis(S.loc))
|
||||
to_chat(user, "<span class='warning'>Target is not near a camera. Cannot proceed.</span>")
|
||||
return
|
||||
var/mob/living/C = user
|
||||
@@ -383,7 +383,7 @@
|
||||
|
||||
//Picks up slime
|
||||
/obj/machinery/computer/camera_advanced/xenobio/proc/XenoSlimeClickShift(mob/living/user, mob/living/simple_animal/slime/S)
|
||||
if(!cameranet.checkTurfVis(S.loc))
|
||||
if(!GLOB.cameranet.checkTurfVis(S.loc))
|
||||
to_chat(user, "<span class='warning'>Target is not near a camera. Cannot proceed.</span>")
|
||||
return
|
||||
var/mob/living/C = user
|
||||
@@ -405,7 +405,7 @@
|
||||
|
||||
//Place slimes
|
||||
/obj/machinery/computer/camera_advanced/xenobio/proc/XenoTurfClickShift(mob/living/user, turf/T)
|
||||
if(!cameranet.checkTurfVis(T))
|
||||
if(!GLOB.cameranet.checkTurfVis(T))
|
||||
to_chat(user, "<span class='warning'>Target is not near a camera. Cannot proceed.</span>")
|
||||
return
|
||||
var/mob/living/C = user
|
||||
@@ -420,7 +420,7 @@
|
||||
|
||||
//Place monkey
|
||||
/obj/machinery/computer/camera_advanced/xenobio/proc/XenoTurfClickCtrl(mob/living/user, turf/T)
|
||||
if(!cameranet.checkTurfVis(T))
|
||||
if(!GLOB.cameranet.checkTurfVis(T))
|
||||
to_chat(user, "<span class='warning'>Target is not near a camera. Cannot proceed.</span>")
|
||||
return
|
||||
var/mob/living/C = user
|
||||
@@ -438,7 +438,7 @@
|
||||
|
||||
//Pick up monkey
|
||||
/obj/machinery/computer/camera_advanced/xenobio/proc/XenoMonkeyClickCtrl(mob/living/user, mob/living/carbon/human/M)
|
||||
if(!cameranet.checkTurfVis(M.loc))
|
||||
if(!GLOB.cameranet.checkTurfVis(M.loc))
|
||||
to_chat(user, "<span class='warning'>Target is not near a camera. Cannot proceed.</span>")
|
||||
return
|
||||
var/mob/living/C = user
|
||||
|
||||
Reference in New Issue
Block a user