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

Method writeMetadata

source/game/StarWorldServer.cpp:2476–2497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2474}
2475
2476void WorldServer::writeMetadata() {
2477 auto versioningDatabase = Root::singleton().versioningDatabase();
2478
2479 Json metadata = JsonObject{
2480 {"playerStart", jsonFromVec2F(m_playerStart)},
2481 {"respawnInWorld", m_respawnInWorld},
2482 {"adjustPlayerStart", m_adjustPlayerStart},
2483 {"worldTemplate", m_worldTemplate->store()},
2484 {"centralStructure", m_centralStructure.store()},
2485 {"protectedDungeonIds", jsonFromSet(m_protectedDungeonIds)},
2486 {"worldProperties", m_worldProperties},
2487 {"spawningEnabled", m_spawner.active()},
2488 {"dungeonIdGravity", m_dungeonIdGravity.pairs().transformed([](auto const& p) -> Json {
2489 return JsonArray{p.first, p.second};
2490 })},
2491 {"dungeonIdBreathable", m_dungeonIdBreathable.pairs().transformed([](auto const& p) -> Json {
2492 return JsonArray{p.first, p.second};
2493 })}
2494 };
2495
2496 m_worldStorage->setWorldMetadata(versioningDatabase->makeCurrentVersionedJson("WorldMetadata", metadata));
2497}
2498
2499bool WorldServer::isVisibleToPlayer(RectF const& region) const {
2500 for (auto const& p : m_clientInfo) {

Callers

nothing calls this directly

Calls 10

singletonClass · 0.85
jsonFromVec2FFunction · 0.85
jsonFromSetFunction · 0.85
versioningDatabaseMethod · 0.80
setWorldMetadataMethod · 0.80
storeMethod · 0.45
activeMethod · 0.45
transformedMethod · 0.45
pairsMethod · 0.45

Tested by

no test coverage detected