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:
skull132
2017-07-16 20:32:33 +03:00
committed by GitHub
parent 4645af8dcb
commit 0fc67f2cb9
70 changed files with 237 additions and 176 deletions
+6 -6
View File
@@ -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] || "