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

Method resendEntity

source/game/StarWorldClient.cpp:150–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150void WorldClient::resendEntity(EntityId entityId) {
151 auto entity = m_entityMap->entity(entityId);
152 if (!entity || !entity->isMaster() || !m_masterEntitiesNetVersion.contains(entity->entityId()))
153 return;
154
155 auto fromVersion = m_masterEntitiesNetVersion.take(entity->entityId());
156 auto netRules = m_clientState.netCompatibilityRules();
157 ByteArray finalNetState = entity->writeNetState(fromVersion, netRules).first;
158 m_outgoingPackets.append(make_shared<EntityDestroyPacket>(entity->entityId(), std::move(finalNetState), false));
159 notifyEntityCreate(entity);
160}
161
162void WorldClient::removeEntity(EntityId entityId, bool andDie) {
163 auto entity = m_entityMap->entity(entityId);

Callers

nothing calls this directly

Calls 8

isMasterMethod · 0.80
entityIdMethod · 0.80
entityMethod · 0.45
containsMethod · 0.45
takeMethod · 0.45
netCompatibilityRulesMethod · 0.45
writeNetStateMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected