mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-11 16:14:08 +01:00
5146cfd403
## About The Pull Request When a camera update is triggered, it is instead added to a queue on a background subsystem An AI entering a camera chunk which is queued to update will force the update immediately (bypassing the queue) While the root problem of this is, ultimately, not addressed... <img width="554" height="58" alt="467828777-eff3f0e5-49d6-4997-b4d7-05eff6432155" src="https://github.com/user-attachments/assets/c2d6a5f5-d958-463e-959f-116bd0dab475" /> ...the change will ultimately prevent update spam from consuming all of the server's resources - instead allocating updates to the backburner in times of high server stress (or on multi-z maps) ## Changelog 🆑 Melbert refactor: Refactored the way camera updates are handled to hopefully reduce some lag. Report any oddities /🆑
25 lines
662 B
Plaintext
25 lines
662 B
Plaintext
/datum/round_event_control/camera_failure
|
|
name = "Camera Failure"
|
|
typepath = /datum/round_event/camera_failure
|
|
weight = 100
|
|
max_occurrences = 20
|
|
alert_observers = FALSE
|
|
category = EVENT_CATEGORY_ENGINEERING
|
|
description = "Turns off a random amount of cameras."
|
|
|
|
/datum/round_event/camera_failure
|
|
fakeable = FALSE
|
|
|
|
/datum/round_event/camera_failure/start()
|
|
var/iterations = 1
|
|
var/list/cameras = SScameras.cameras.Copy()
|
|
while(prob(round(100/iterations)))
|
|
var/obj/machinery/camera/C = pick_n_take(cameras)
|
|
if (!C)
|
|
break
|
|
if (!(CAMERANET_NETWORK_SS13 in C.network))
|
|
continue
|
|
if(C.camera_enabled)
|
|
C.toggle_cam(null, 0)
|
|
iterations *= 2.5
|