| 2285 | } |
| 2286 | |
| 2287 | RpcPromise<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 | |
| 2303 | RpcPromise<Json> WorldClient::sendEntityMessage(Variant<EntityId, String> const& entityId, String const& message, JsonArray const& args) { |
| 2304 | if (!inWorld()) |
nothing calls this directly
no test coverage detected