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

Method findUniqueEntity

source/game/StarWorldClient.cpp:2287–2301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2285}
2286
2287RpcPromise<Vec2F> WorldClient::findUniqueEntity(String const& uniqueId) {
2288 if (!inWorld())
2289 return RpcPromise<Vec2F>::createFailed("Not currently in a world");
2290
2291 if (auto entity = m_entityMap->uniqueEntity(uniqueId))
2292 return RpcPromise<Vec2F>::createFulfilled(entity->position());
2293
2294 auto pair = RpcPromise<Vec2F>::createPair();
2295 auto& rpcPromises = m_findUniqueEntityResponses[uniqueId];
2296 if (rpcPromises.empty())
2297 m_outgoingPackets.append(make_shared<FindUniqueEntityPacket>(uniqueId));
2298 rpcPromises.append(pair.second);
2299
2300 return pair.first;
2301}
2302
2303RpcPromise<Json> WorldClient::sendEntityMessage(Variant<EntityId, String> const& entityId, String const& message, JsonArray const& args) {
2304 if (!inWorld())

Callers

nothing calls this directly

Calls 4

uniqueEntityMethod · 0.80
positionMethod · 0.45
emptyMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected