asset_transport
Base browse_rsc asset transport
Vars | |
dont_mutate_filenames | Don't mutate the filename of assets when sending via browse_rsc. This is to make it easier to debug issues with assets, and allow server operators to bypass issues that make it to production. If turning this on fixes asset issues, something isn't using get_asset_url and the asset isn't marked legacy, fix one of those. |
---|---|
Procs | |
Initialize | Initialize - Called when SSassets initializes. |
Load | Called when the transport is loaded by the config controller, not called on the default transport unless it gets loaded by a config change. |
get_asset_url | Returns a url for a given asset. asset_name - Name of the asset. asset_cache_item - asset cache item datum for the asset, optional, overrides asset_name |
register_asset | Register a browser asset with the asset cache system. returns a /datum/asset_cache_item. mutiple calls to register the same asset under the same asset_name return the same datum. |
send_assets | Sends a list of browser assets to a client client - a client or mob asset_list - A list of asset filenames to be sent to the client. Can optionally be assoicated with the asset's asset_cache_item datum. Returns TRUE if any assets were sent. |
send_assets_slow | Precache files without clogging up the browse() queue, used for passively sending files on connection start. |
validate_config | Check the config is valid to load this transport Returns TRUE or FALSE |
Var Details
dont_mutate_filenames
Don't mutate the filename of assets when sending via browse_rsc. This is to make it easier to debug issues with assets, and allow server operators to bypass issues that make it to production. If turning this on fixes asset issues, something isn't using get_asset_url and the asset isn't marked legacy, fix one of those.
Proc Details
Initialize
Initialize - Called when SSassets initializes.
Load
Called when the transport is loaded by the config controller, not called on the default transport unless it gets loaded by a config change.
get_asset_url
Returns a url for a given asset. asset_name - Name of the asset. asset_cache_item - asset cache item datum for the asset, optional, overrides asset_name
register_asset
Register a browser asset with the asset cache system. returns a /datum/asset_cache_item. mutiple calls to register the same asset under the same asset_name return the same datum.
Arguments:
- asset_name - the identifier of the asset.
- asset - the actual asset file (or an asset_cache_item datum).
- file_hash - optional, a hash of the contents of the asset files contents. used so asset_cache_item doesnt have to hash it again
- dmi_file_path - optional, means that the given asset is from the rsc and thus we dont need to do some expensive operations
send_assets
Sends a list of browser assets to a client client - a client or mob asset_list - A list of asset filenames to be sent to the client. Can optionally be assoicated with the asset's asset_cache_item datum. Returns TRUE if any assets were sent.
send_assets_slow
Precache files without clogging up the browse() queue, used for passively sending files on connection start.
validate_config
Check the config is valid to load this transport Returns TRUE or FALSE