| 2011 | } |
| 2012 | |
| 2013 | void Player::getNetArmorSecrets() { |
| 2014 | if (isSlave() && getSecretPropertyPtr("armorWearer.replicating") != nullptr) { |
| 2015 | auto itemDatabase = Root::singleton().itemDatabase(); |
| 2016 | |
| 2017 | for (uint8_t i = 0; i != 12; ++i) { |
| 2018 | auto slot = EquipmentSlot((uint8_t)EquipmentSlot::Cosmetic1 + i); |
| 2019 | String const& slotName = EquipmentSlotNames.getRight(slot); |
| 2020 | auto& curVersion = m_armorSecretNetVersions[slot]; |
| 2021 | uint64_t newVersion = 0; |
| 2022 | if (auto jVersion = getSecretProperty(strf("armorWearer.{}.version", slotName), 0); jVersion.isType(Json::Type::Int)) |
| 2023 | newVersion = jVersion.toUInt(); |
| 2024 | if (newVersion > curVersion) { |
| 2025 | curVersion = newVersion; |
| 2026 | ArmorItemPtr item; |
| 2027 | itemDatabase->diskLoad(getSecretProperty(strf("armorWearer.{}.data", slotName)), item); |
| 2028 | m_inventory->setItem(slot, item); |
| 2029 | m_armor->setCosmeticItem(i, item); |
| 2030 | } |
| 2031 | } |
| 2032 | } |
| 2033 | } |
| 2034 | |
| 2035 | void Player::setAdmin(bool isAdmin) { |
| 2036 | m_isAdmin = isAdmin; |
nothing calls this directly
no test coverage detected