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

Method notifyEntityCreate

source/game/StarWorldClient.cpp:1918–1927  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1916}
1917
1918void WorldClient::notifyEntityCreate(EntityPtr const& entity) {
1919 if (entity->isMaster() && !m_masterEntitiesNetVersion.contains(entity->entityId())) {
1920 // Server was unaware of this entity until now
1921 auto netRules = m_clientState.netCompatibilityRules();
1922 auto firstNetState = entity->writeNetState(0, netRules);
1923 m_masterEntitiesNetVersion[entity->entityId()] = firstNetState.second;
1924 m_outgoingPackets.append(make_shared<EntityCreatePacket>(entity->entityType(),
1925 Root::singleton().entityFactory()->netStoreEntity(entity, netRules), std::move(firstNetState.first), entity->entityId()));
1926 }
1927}
1928
1929Vec2I WorldClient::environmentBiomeTrackPosition() const {
1930 if (!inWorld())

Callers

nothing calls this directly

Calls 10

singletonClass · 0.85
isMasterMethod · 0.80
entityIdMethod · 0.80
netStoreEntityMethod · 0.80
entityFactoryMethod · 0.80
containsMethod · 0.45
netCompatibilityRulesMethod · 0.45
writeNetStateMethod · 0.45
appendMethod · 0.45
entityTypeMethod · 0.45

Tested by

no test coverage detected