| 2474 | } |
| 2475 | |
| 2476 | void 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 | |
| 2499 | bool WorldServer::isVisibleToPlayer(RectF const& region) const { |
| 2500 | for (auto const& p : m_clientInfo) { |
nothing calls this directly
no test coverage detected