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

Method getNetArmorSecrets

source/game/StarPlayer.cpp:2013–2033  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2011}
2012
2013void 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
2035void Player::setAdmin(bool isAdmin) {
2036 m_isAdmin = isAdmin;

Callers

nothing calls this directly

Calls 9

singletonClass · 0.85
EquipmentSlotEnum · 0.85
strfFunction · 0.85
itemDatabaseMethod · 0.80
toUIntMethod · 0.80
setCosmeticItemMethod · 0.80
isTypeMethod · 0.45
diskLoadMethod · 0.45
setItemMethod · 0.45

Tested by

no test coverage detected