| 535 | } |
| 536 | |
| 537 | String CommandProcessor::clearStagehand(ConnectionId connectionId, String const&) { |
| 538 | if (auto errorMsg = adminCheck(connectionId, "remove stagehands")) |
| 539 | return *errorMsg; |
| 540 | |
| 541 | unsigned removed = 0; |
| 542 | bool done = m_universe->executeForClient(connectionId, |
| 543 | [&](WorldServer* world, PlayerPtr player) { |
| 544 | auto queryRect = RectF::withCenter(player->aimPosition(), Vec2F{2, 2}); |
| 545 | for (auto stagehand : world->query<Stagehand>(queryRect)) { |
| 546 | world->removeEntity(stagehand->entityId(), true); |
| 547 | ++removed; |
| 548 | } |
| 549 | }); |
| 550 | return done ? strf("Removed {} stagehands", removed) : "Invalid client state"; |
| 551 | } |
| 552 | |
| 553 | String CommandProcessor::spawnLiquid(ConnectionId connectionId, String const& argumentString) { |
| 554 | if (auto errorMsg = adminCheck(connectionId, "spawn liquid")) |
nothing calls this directly
no test coverage detected