mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-30 03:52:52 +00:00
Remove a whole bunch of in world loops and rework machinery global lists (#3053)
Removes a whole bunch of in world loops. Reworks SSmachinery to hold two lists: all_machines and processing_machines. all_machines contains all machines 5ever. All of them. Literally. Forever. And ever. processing_machines only contains machines that process with the SSmachinery controller. I checked most types at runtime on the live server to see whether they're in processing_machines or in all_machines, and did debug to ensure that most machinery ends up and stays in all_machines. Includes a basic UT to make sure all mapped in machinery types remain within the all_machines list post-init.
This commit is contained in:
@@ -98,7 +98,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
return
|
||||
|
||||
/obj/machinery/computer/rdconsole/proc/griefProtection() //Have it automatically push research to the centcomm server so wild griffins can't fuck up R&D's work
|
||||
for(var/obj/machinery/r_n_d/server/centcom/C in machines)
|
||||
for(var/obj/machinery/r_n_d/server/centcom/C in SSmachinery.all_machines)
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
C.files.AddTech2Known(T)
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
@@ -109,7 +109,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
. = ..()
|
||||
files = new /datum/research(src) //Setup the research data holder.
|
||||
if(!id)
|
||||
for(var/obj/machinery/r_n_d/server/centcom/S in machines)
|
||||
for(var/obj/machinery/r_n_d/server/centcom/S in SSmachinery.all_machines)
|
||||
S.setup()
|
||||
break
|
||||
SyncRDevices()
|
||||
@@ -278,7 +278,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
griefProtection() //Putting this here because I dont trust the sync process
|
||||
spawn(30)
|
||||
if(src)
|
||||
for(var/obj/machinery/r_n_d/server/S in machines)
|
||||
for(var/obj/machinery/r_n_d/server/S in SSmachinery.all_machines)
|
||||
var/server_processed = 0
|
||||
if((id in S.id_with_upload) || istype(S, /obj/machinery/r_n_d/server/centcom))
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
@@ -411,7 +411,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
info += GetResearchListInfo()
|
||||
else
|
||||
info += GetResearchLevelsInfo()
|
||||
|
||||
|
||||
PR.set_content_unsafe(pname, info)
|
||||
print(PR)
|
||||
spawn(10)
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
|
||||
//Backup files to centcomm to help admins recover data after greifer attacks
|
||||
/obj/machinery/r_n_d/server/proc/griefProtection()
|
||||
for(var/obj/machinery/r_n_d/server/centcom/C in machines)
|
||||
for(var/obj/machinery/r_n_d/server/centcom/C in SSmachinery.all_machines)
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
C.files.AddTech2Known(T)
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
@@ -128,7 +128,7 @@
|
||||
..()
|
||||
var/list/no_id_servers = list()
|
||||
var/list/server_ids = list()
|
||||
for(var/obj/machinery/r_n_d/server/S in machines)
|
||||
for(var/obj/machinery/r_n_d/server/S in SSmachinery.all_machines)
|
||||
switch(S.server_id)
|
||||
if(-1)
|
||||
continue
|
||||
@@ -179,20 +179,20 @@
|
||||
temp_server = null
|
||||
consoles = list()
|
||||
servers = list()
|
||||
for(var/obj/machinery/r_n_d/server/S in machines)
|
||||
for(var/obj/machinery/r_n_d/server/S in SSmachinery.all_machines)
|
||||
if(S.server_id == text2num(href_list["access"]) || S.server_id == text2num(href_list["data"]) || S.server_id == text2num(href_list["transfer"]))
|
||||
temp_server = S
|
||||
break
|
||||
if(href_list["access"])
|
||||
screen = 1
|
||||
for(var/obj/machinery/computer/rdconsole/C in machines)
|
||||
for(var/obj/machinery/computer/rdconsole/C in SSmachinery.all_machines)
|
||||
if(C.sync)
|
||||
consoles += C
|
||||
else if(href_list["data"])
|
||||
screen = 2
|
||||
else if(href_list["transfer"])
|
||||
screen = 3
|
||||
for(var/obj/machinery/r_n_d/server/S in machines)
|
||||
for(var/obj/machinery/r_n_d/server/S in SSmachinery.all_machines)
|
||||
if(S == src)
|
||||
continue
|
||||
servers += S
|
||||
@@ -242,7 +242,7 @@
|
||||
if(0) //Main Menu
|
||||
dat += "Connected Servers:<BR><BR>"
|
||||
|
||||
for(var/obj/machinery/r_n_d/server/S in machines)
|
||||
for(var/obj/machinery/r_n_d/server/S in SSmachinery.all_machines)
|
||||
if(istype(S, /obj/machinery/r_n_d/server/centcom) && !badmin)
|
||||
continue
|
||||
dat += "[S.name] || "
|
||||
|
||||
Reference in New Issue
Block a user