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

Method placeDungeon

source/game/StarCommandProcessor.cpp:801–820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

799}
800
801String 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
822String CommandProcessor::setUniverseFlag(ConnectionId connectionId, String const& argumentString) {
823 if (auto errorMsg = adminCheck(connectionId, "set universe flags"))

Callers

nothing calls this directly

Calls 7

tokenizeToStringListMethod · 0.80
executeForClientMethod · 0.80
atMethod · 0.45
sizeMethod · 0.45
splitMethod · 0.45
valueMethod · 0.45
aimPositionMethod · 0.45

Tested by

no test coverage detected