mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-26 06:40:08 +01:00
Configuration Controller (#7857)
This commit is contained in:
@@ -12,14 +12,14 @@
|
||||
|
||||
/// Called when the transport is loaded by the config controller, not called on the default transport unless it gets loaded by a config change.
|
||||
/datum/asset_transport/proc/Load()
|
||||
if (config.asset_simple_preload)
|
||||
if (CONFIG_GET(flag/asset_simple_preload)) // CHOMPEdit
|
||||
for(var/client/C in GLOB.clients)
|
||||
addtimer(CALLBACK(src, PROC_REF(send_assets_slow), C, preload), 1 SECONDS)
|
||||
|
||||
/// Initialize - Called when SSassets initializes.
|
||||
/datum/asset_transport/proc/Initialize(list/assets)
|
||||
preload = assets.Copy()
|
||||
if (!config.asset_simple_preload)
|
||||
if (!CONFIG_GET(flag/asset_simple_preload)) // CHOMPEdit
|
||||
return
|
||||
for(var/client/C in GLOB.clients)
|
||||
addtimer(CALLBACK(src, PROC_REF(send_assets_slow), C, preload), 1 SECONDS)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
/// Saves the asset to the webroot taking into account namespaces and hashes.
|
||||
/datum/asset_transport/webroot/proc/save_asset_to_webroot(datum/asset_cache_item/ACI)
|
||||
var/webroot = config.asset_cdn_webroot
|
||||
var/webroot = CONFIG_GET(string/asset_cdn_webroot) // CHOMPEdit
|
||||
var/newpath = "[webroot][get_asset_suffex(ACI)]"
|
||||
if (fexists(newpath))
|
||||
return
|
||||
@@ -39,7 +39,7 @@
|
||||
/datum/asset_transport/webroot/get_asset_url(asset_name, datum/asset_cache_item/asset_cache_item)
|
||||
if (!istype(asset_cache_item))
|
||||
asset_cache_item = SSassets.cache[asset_name]
|
||||
var/url = config.asset_cdn_url //config loading will handle making sure this ends in a /
|
||||
var/url = CONFIG_GET(string/asset_cdn_url) //config loading will handle making sure this ends in a / // CHOMPEdit
|
||||
return "[url][get_asset_suffex(asset_cache_item)]"
|
||||
|
||||
/datum/asset_transport/webroot/proc/get_asset_suffex(datum/asset_cache_item/asset_cache_item)
|
||||
@@ -76,11 +76,11 @@
|
||||
return FALSE
|
||||
|
||||
/datum/asset_transport/webroot/validate_config(log = TRUE)
|
||||
if (!config.asset_cdn_url)
|
||||
if (!CONFIG_GET(string/asset_cdn_url)) // CHOMPEdit
|
||||
if (log)
|
||||
log_asset("ERROR: [type]: Invalid Config: ASSET_CDN_URL")
|
||||
return FALSE
|
||||
if (!config.asset_cdn_webroot)
|
||||
if (!CONFIG_GET(string/asset_cdn_webroot)) // CHOMPEdit
|
||||
if (log)
|
||||
log_asset("ERROR: [type]: Invalid Config: ASSET_CDN_WEBROOT")
|
||||
return FALSE
|
||||
|
||||
Reference in New Issue
Block a user