[MIRROR] Increase first connect responsiveness by delaying vox sound preload [MDB IGNORE] (#20396)

* Increase first connect responsiveness by delaying vox sound preload (#74559)

These were getting sent too early and clogged up the queue of resources
to send the client, delaying chat load if the client had no byond rsc
cache and the cdn was not enabled.

Also this way if the cdn rsc download happens quick enough than these
calls can become noops. (if byond isn't smart enough to do that now, it
will be.)

* Increase first connect responsiveness by delaying vox sound preload

---------

Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
This commit is contained in:
SkyratBot
2023-04-08 01:29:16 +02:00
committed by GitHub
parent acf6256c30
commit 46daee76f7

View File

@@ -1037,7 +1037,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
preload_rsc = external_rsc_urls[next_external_rsc]
#endif
spawn (10) //removing this spawn causes all clients to not get verbs.
spawn (10) //removing this spawn causes all clients to not get verbs. (this can't be addtimer because these assets may be needed before the mc inits)
//load info on what assets the client has
src << browse('code/modules/asset_cache/validate_assets.html', "window=asset_cache_browser")
@@ -1047,12 +1047,16 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
addtimer(CALLBACK(SSassets.transport, TYPE_PROC_REF(/datum/asset_transport, send_assets_slow), src, SSassets.transport.preload), 5 SECONDS)
#if (PRELOAD_RSC == 0)
for (var/name in GLOB.vox_sounds)
var/file = GLOB.vox_sounds[name]
Export("##action=load_rsc", file)
stoplag()
addtimer(CALLBACK(src, TYPE_PROC_REF(/client, preload_vox)), 1 MINUTES)
#endif
#if (PRELOAD_RSC == 0)
/client/preload_vox()
for (var/name in GLOB.vox_sounds)
var/file = GLOB.vox_sounds[name]
Export("##action=load_rsc", file)
stoplag()
#endif
//Hook, override it to run code when dir changes
//Like for /atoms, but clients are their own snowflake FUCK