mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 05:23:22 +01:00
Begin, the Lag Wars Have (#21839)
<img width="700" height="848" alt="image" src="https://github.com/user-attachments/assets/e0db50af-35db-43c7-b78e-6c1ea5ac569c" /> you take a tiny little two year LOA and this happens this PR hits some large lag culprits: - UpdateOverlays() getting spammed by human/update_icon. This was 0.85% of server CPU time during the event. Doesn't sound like a whole lot but it's insane. 99% of it was caused by sloppy duplicate calls of update_icon in set_dir (as well as update icon itself!). Refactored to stop that - Makes Follow menu update manually, which cuts down on the 2.8 million REF() calls it made during the event. This was ~1% of CPU time including ui_data as well. - Gets rid of a bunch of random runtimes and some lighting-related harddels. - NanoUIs now clean themselves up when their owner qdels rather than forcing the owner to do REF(src) and close all matching UIs. saves us ~0.1% server cpu time! wowza!
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
GLOBAL_DATUM_INIT(follow_menu, /datum/tgui_module/follow_menu, new)
|
||||
|
||||
/datum/tgui_module/follow_menu/ui_interact(var/mob/user, var/datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
@@ -14,9 +16,15 @@
|
||||
return
|
||||
|
||||
if(action == "follow_target")
|
||||
ghost.ManualFollow(locate(params["follow_target"]) in GLOB.mob_list)
|
||||
if(!ghost.ManualFollow(locate(params["follow_target"]) in GLOB.mob_list))
|
||||
to_chat(ghost, SPAN_WARNING("Failed to follow selected target. Refreshing mob list..."))
|
||||
return TRUE
|
||||
|
||||
/datum/tgui_module/follow_menu/ui_data(mob/user)
|
||||
if(action == "refresh")
|
||||
ui.send_full_update()
|
||||
return TRUE
|
||||
|
||||
/datum/tgui_module/follow_menu/ui_static_data(mob/user)
|
||||
var/list/data = list()
|
||||
// Don't worry about this is_mod check being for storytellers as well - all it does is highlight antags in red.
|
||||
var/is_mod = check_rights(R_MOD|R_ADMIN, 0, user) || isstoryteller(user)
|
||||
|
||||
@@ -519,7 +519,7 @@ nanoui is used to open and update nano browser uis
|
||||
* @return nothing
|
||||
*/
|
||||
/datum/nanoui/process(update = 0)
|
||||
if (!src_object || !user)
|
||||
if (QDELETED(src_object) || QDELETED(user))
|
||||
close()
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user