| 799 | } |
| 800 | |
| 801 | String CommandProcessor::placeDungeon(ConnectionId connectionId, String const& argumentString) { |
| 802 | if (auto errorMsg = adminCheck(connectionId, "place dungeons")) |
| 803 | return *errorMsg; |
| 804 | |
| 805 | auto arguments = m_parser.tokenizeToStringList(argumentString); |
| 806 | String dungeonName = arguments.at(0); |
| 807 | |
| 808 | Maybe<Vec2I> targetPosition; |
| 809 | if (arguments.size() > 1) { |
| 810 | auto pos = arguments.at(1).split(",", 1); |
| 811 | targetPosition = Vec2I(lexicalCast<int>(pos.at(0)), lexicalCast<int>(pos.at(1))); |
| 812 | } |
| 813 | |
| 814 | bool done = m_universe->executeForClient(connectionId, |
| 815 | [dungeonName, targetPosition](WorldServer* world, PlayerPtr const& player) { |
| 816 | world->placeDungeon(dungeonName, targetPosition.value(Vec2I::floor(player->aimPosition())), true); |
| 817 | }); |
| 818 | |
| 819 | return done ? "" : "Unable to place dungeon " + dungeonName; |
| 820 | } |
| 821 | |
| 822 | String CommandProcessor::setUniverseFlag(ConnectionId connectionId, String const& argumentString) { |
| 823 | if (auto errorMsg = adminCheck(connectionId, "set universe flags")) |
nothing calls this directly
no test coverage detected