| 1317 | } |
| 1318 | |
| 1319 | static bool ConNewGame(std::span<std::string_view> argv) |
| 1320 | { |
| 1321 | if (argv.empty()) { |
| 1322 | IConsolePrint(CC_HELP, "Start a new game. Usage: 'newgame [seed]'."); |
| 1323 | IConsolePrint(CC_HELP, "The server can force a new game using 'newgame'; any client joined will rejoin after the server is done generating the new game."); |
| 1324 | return true; |
| 1325 | } |
| 1326 | |
| 1327 | uint32_t seed = GENERATE_NEW_SEED; |
| 1328 | if (argv.size() >= 2) { |
| 1329 | auto param = ParseInteger(argv[1]); |
| 1330 | if (!param.has_value()) { |
| 1331 | IConsolePrint(CC_ERROR, "The given seed must be a valid number."); |
| 1332 | return true; |
| 1333 | } |
| 1334 | seed = *param; |
| 1335 | } |
| 1336 | |
| 1337 | StartNewGameWithoutGUI(seed); |
| 1338 | return true; |
| 1339 | } |
| 1340 | |
| 1341 | static bool ConRestart(std::span<std::string_view> argv) |
| 1342 | { |
nothing calls this directly
no test coverage detected