MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / doLoad

Method doLoad

source/base/StarAssets.cpp:1092–1109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1090
1091
1092bool Assets::doLoad(AssetId const& id) const {
1093 try {
1094 // loadAsset automatically manages the queue and freshens the asset
1095 // data.
1096 return (bool)loadAsset(id);
1097 } catch (std::exception const& e) {
1098 Logger::error("Exception caught loading asset: {}, {}", id.path, outputException(e, true));
1099 } catch (...) {
1100 Logger::error("Unknown exception caught loading asset: {}", id.path);
1101 }
1102
1103 // There was an exception, remove the asset from the queue and fill the cache
1104 // with null so that getAsset will throw.
1105 m_assetsCache[id] = {};
1106 m_assetsDone.broadcast();
1107 m_queue.remove(id);
1108 return true;
1109}
1110
1111bool Assets::doPost(AssetId const& id) const {
1112 shared_ptr<AssetData> assetData;

Callers

nothing calls this directly

Calls 4

errorFunction · 0.85
outputExceptionFunction · 0.50
broadcastMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected