| 839 | } |
| 840 | |
| 841 | String CommandProcessor::addBiomeRegion(ConnectionId connectionId, String const& argumentString) { |
| 842 | if (auto errorMsg = adminCheck(connectionId, "add biome regions")) |
| 843 | return *errorMsg; |
| 844 | |
| 845 | auto arguments = m_parser.tokenizeToStringList(argumentString); |
| 846 | |
| 847 | String biomeName = arguments.at(0); |
| 848 | int width = lexicalCast<int>(arguments.at(1)); |
| 849 | |
| 850 | String subBlockSelector = "largeClumps"; |
| 851 | if (arguments.size() > 2) |
| 852 | subBlockSelector = arguments.at(2); |
| 853 | |
| 854 | bool done = m_universe->executeForClient(connectionId, |
| 855 | [biomeName, width, subBlockSelector](WorldServer* world, PlayerPtr const& player) { |
| 856 | world->addBiomeRegion(Vec2I::floor(player->aimPosition()), biomeName, subBlockSelector, width); |
| 857 | }); |
| 858 | |
| 859 | return done ? strf("added region of biome {} with width {}", biomeName, width) : "failed to add biome region"; |
| 860 | } |
| 861 | |
| 862 | String CommandProcessor::expandBiomeRegion(ConnectionId connectionId, String const& argumentString) { |
| 863 | if (auto errorMsg = adminCheck(connectionId, "expand biome regions")) |
nothing calls this directly
no test coverage detected