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

Method TenantDatabase

source/game/StarTenantDatabase.cpp:15–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15TenantDatabase::TenantDatabase() {
16 auto assets = Root::singleton().assets();
17
18 auto& files = assets->scanExtension("tenant");
19 assets->queueJsons(files);
20 for (auto& file : files) {
21 try {
22 String name = assets->json(file).getString("name");
23 if (m_paths.contains(name))
24 Logger::error("Tenant {} defined twice, second time from {}", name, file);
25 else
26 m_paths[name] = file;
27 } catch (std::exception const& e) {
28 Logger::error("Error loading tenant file {}: {}", file, outputException(e, true));
29 }
30 }
31}
32
33void TenantDatabase::cleanup() {
34 MutexLocker locker(m_cacheMutex);

Callers

nothing calls this directly

Calls 8

singletonClass · 0.85
errorFunction · 0.85
assetsMethod · 0.80
queueJsonsMethod · 0.80
getStringMethod · 0.80
jsonMethod · 0.80
outputExceptionFunction · 0.50
containsMethod · 0.45

Tested by

no test coverage detected