mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-14 19:03:21 +00:00
Asset cache now caches the asset's md5 This should solve the high cpu usage issues with it. line by line profile suggests that the next hotspot is the asset log. Simplied asset cache code, moved verify functionality to a flush_assets proc that blocks until a client has all currently sending assets. (sidenote: there is an argument for moving most of asset_cache's global procs onto the client, get_asset_datum and register_asset are really the only valid global procs.) Re-added batched passive sends since it does speed up how quickly the asset cache pre-caches to clients.
22 lines
526 B
Plaintext
22 lines
526 B
Plaintext
/**
|
|
* # asset_cache_item
|
|
*
|
|
* An internal datum containing info on items in the asset cache. Mainly used to cache md5 info for speed.
|
|
**/
|
|
/datum/asset_cache_item
|
|
var/name
|
|
var/md5
|
|
var/resource
|
|
|
|
/datum/asset_cache_item/New(name, file)
|
|
if (!isfile(file))
|
|
file = fcopy_rsc(file)
|
|
md5 = md5(file)
|
|
if (!md5)
|
|
md5 = md5(fcopy_rsc(file))
|
|
if (!md5)
|
|
CRASH("invalid asset sent to asset cache")
|
|
debug_world_log("asset cache unexpected success of second fcopy_rsc")
|
|
src.name = name
|
|
resource = file
|