| 2407 | } |
| 2408 | |
| 2409 | Json Player::diskStore() { |
| 2410 | JsonObject genericScriptStorage; |
| 2411 | for (auto& p : m_genericScriptContexts) { |
| 2412 | auto scriptStorage = p.second->getScriptStorage(); |
| 2413 | if (!scriptStorage.empty()) |
| 2414 | genericScriptStorage[p.first] = std::move(scriptStorage); |
| 2415 | } |
| 2416 | |
| 2417 | return JsonObject{ |
| 2418 | {"uuid", *uniqueId()}, |
| 2419 | {"description", m_description}, |
| 2420 | {"modeType", PlayerModeNames.getRight(m_modeType)}, |
| 2421 | {"shipUpgrades", m_shipUpgrades.toJson()}, |
| 2422 | {"blueprints", m_blueprints->toJson()}, |
| 2423 | {"universeMap", m_universeMap->toJson()}, |
| 2424 | {"codexes", m_codexes->toJson()}, |
| 2425 | {"techs", m_techs->toJson()}, |
| 2426 | {"identity", m_identity.toJson()}, |
| 2427 | {"team", getTeam().toJson()}, |
| 2428 | {"inventory", m_inventory->store()}, |
| 2429 | {"movementController", m_movementController->storeState()}, |
| 2430 | {"techController", m_techController->diskStore()}, |
| 2431 | {"statusController", m_statusController->diskStore()}, |
| 2432 | {"log", m_log->toJson()}, |
| 2433 | {"aiState", m_aiState.toJson()}, |
| 2434 | {"quests", m_questManager->diskStore()}, |
| 2435 | {"companions", m_companions->diskStore()}, |
| 2436 | {"deployment", m_deployment->diskStore()}, |
| 2437 | {"genericProperties", m_genericProperties}, |
| 2438 | {"genericScriptStorage", genericScriptStorage}, |
| 2439 | }; |
| 2440 | } |
| 2441 | |
| 2442 | ByteArray Player::netStore(NetCompatibilityRules rules) { |
| 2443 | DataStreamBuffer ds; |
no test coverage detected