Preparations for reducing the number of processing machines at round-start. There are currently 8000 or so at round start, this was already pruned to 2800ish by doohl's stuff.

machine.process() now uses a return value to remove itself from the processing machines list. This is more efficient and will help reduce costs especially at round start where some 5000+ machines were removed from the list using first-find. Now there is no searching involved. Instead of machines.Remove(src) just do .=PROCESS_KILL that will return the flag to the proc which called it (the MC) and trigger its removal from the list. If you're deleting something don't even bother removing it from the machines list, there is no need to.

Simplified the last_processed stuff for the MC. It's now a single variable rather than 3. It is simply a typepath rather than a reference to an object (this is so it works even if said object is deleted)

MC stats in admin status_panels now show the length of the processing lists (indicated by #). I've just realised I forgot to mention what the abbreviations are:
The less obvious ones are: Dis=diseases; Net=pipes; Pnet=powernets; Mch=Machines; Tick=the game-mode ticker.

Beach-water now uses an overlay image rather than a separate object.

Fixed a typo in the shuttle console.

Hydroponics trays no longer use first-find within their process() for checking the plant is in the tray (why is that even there anyway? talk about lazy)

Removed some junk/placeholder procs like organ/proc/process() return

Removed newscasters from the processing machines lists.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4603 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-09-02 20:32:01 +00:00
parent abb7be68ea
commit 73e5c38a56
24 changed files with 106 additions and 316 deletions

View File

@@ -674,8 +674,10 @@ note dizziness decrements automatically in the mob's Life() proc.
if(master_controller)
stat(null,"MasterController-[last_tick_duration] ([master_controller.processing?"On":"Off"]-[controller_iteration])")
stat(null,"Air-[master_controller.air_cost]\t Sun-[master_controller.sun_cost]")
stat(null,"Mob-[master_controller.mobs_cost]\t Dis-[master_controller.diseases_cost]")
stat(null,"Mch-[master_controller.machines_cost]\t Obj-[master_controller.objects_cost]")
stat(null,"Mob-[master_controller.mobs_cost]\t #[mob_list.len]")
stat(null,"Dis-[master_controller.diseases_cost]\t #[active_diseases.len]")
stat(null,"Mch-[master_controller.machines_cost]\t #[machines.len]")
stat(null,"Obj-[master_controller.objects_cost]\t #[processing_objects.len]")
stat(null,"Net-[master_controller.networks_cost]\t Pnet-[master_controller.powernets_cost]")
stat(null,"Tick-[master_controller.ticker_cost]\t ALL-[master_controller.total_cost]")
else

View File

@@ -4,11 +4,11 @@
var/name = "organ"
var/mob/owner = null
/datum/organ/proc/process()
return 0
///datum/organ/proc/process()
// return 0
/datum/organ/proc/receive_chem(chemical as obj)
return 0
///datum/organ/proc/receive_chem(chemical as obj)
// return 0

View File

@@ -80,7 +80,7 @@ proc/cardinalrange(var/center)
/obj/machinery/am_shielding/process()
if(!processing) ..()
if(!processing) . = PROCESS_KILL
//TODO: core functions and stability
//TODO: think about checking the airmix for plasma and increasing power output
return
@@ -174,7 +174,6 @@ proc/cardinalrange(var/center)
/obj/machinery/am_shielding/proc/shutdown_core()
processing = 0
machines.Remove(src)
if(!control_unit) return
control_unit.linked_cores.Remove(src)
control_unit.reported_core_efficiency -= efficiency

View File

@@ -573,7 +573,7 @@
#define LIGHTING_POWER_FACTOR 20 //20W per unit luminosity
/obj/machinery/light/process()
/obj/machinery/light/process()//TODO: remove/add this from machines to save on processing as needed ~Carn PRIORITY
if(on)
use_power(luminosity * LIGHTING_POWER_FACTOR, LIGHT)

View File

@@ -105,22 +105,20 @@
s.set_up(5, 1, src)
s.start()
A.dir = src.dir
if(src.dir == 1)//Up
A.yo = 20
A.xo = 0
else if(src.dir == 2)//Down
A.yo = -20
A.xo = 0
else if(src.dir == 4)//Right
A.yo = 0
A.xo = 20
else if(src.dir == 8)//Left
A.yo = 0
A.xo = -20
else // Any other
A.yo = -20
A.xo = 0
A.process()
switch(dir)
if(NORTH)
A.yo = 20
A.xo = 0
if(EAST)
A.yo = 0
A.xo = 20
if(WEST)
A.yo = 0
A.xo = -20
else // Any other
A.yo = -20
A.xo = 0
A.process() //TODO: Carn: check this out
/obj/machinery/emitter/attackby(obj/item/W, mob/user)

View File

@@ -13,9 +13,7 @@
var/turf/T = get_turf(src)
if(src.energy >= 200)
new /obj/machinery/singularity/(T, 50)
spawn(0)
del(src)
return
if(src) del(src)
/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))

View File

@@ -83,7 +83,7 @@
sunfrac = cos(p_angle) ** 2
/obj/machinery/power/solar/process()
/obj/machinery/power/solar/process()//TODO: remove/add this from machines to save on processing as needed ~Carn PRIORITY
if(stat & BROKEN) return
if(!control) return
if(obscured) return
@@ -141,7 +141,7 @@
/obj/machinery/power/solar/fake/process()
machines.Remove(src)
. = PROCESS_KILL
return

View File

@@ -76,7 +76,7 @@
use_power(100)
affecting = loc.contents - src // moved items will be all in loc
spawn(1) // slight delay to prevent infinite propagation due to map order
spawn(1) // slight delay to prevent infinite propagation due to map order //TODO: please no spawn() in process(). It's a very bad idea
var/items_moved = 0
for(var/atom/movable/A in affecting)
if(!A.anchored)

View File

@@ -82,7 +82,7 @@ var/global/list/obj/machinery/message_server/message_servers = list()
/obj/machinery/message_server/process()
//if(decryptkey == "password")
// decryptkey = generateKey()
if((stat & (BROKEN|NOPOWER)) && active)
if(active && (stat & (BROKEN|NOPOWER)))
active = 0
return
update_icon()

View File

@@ -90,7 +90,7 @@
..()
/obj/machinery/r_n_d/server/proc/
//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 world)
@@ -190,7 +190,7 @@
no_id_servers -= S
/obj/machinery/r_n_d/server/centcom/process()
return
return PROCESS_KILL //don't need process()
/obj/machinery/computer/rdservercontrol