mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
[Crash] World CLI validation (#4728)
* [Crash] World CLI validation * Clean
This commit is contained in:
parent
acb7584e26
commit
23c4aa241b
@ -76,7 +76,7 @@ void PathManager::LoadPaths()
|
|||||||
constexpr int path_width = 0;
|
constexpr int path_width = 0;
|
||||||
constexpr int break_length = 70;
|
constexpr int break_length = 70;
|
||||||
|
|
||||||
std::cout << std::endl;
|
LogInfo("Loading server paths");
|
||||||
LogInfo("{}", Strings::Repeat("-", break_length));
|
LogInfo("{}", Strings::Repeat("-", break_length));
|
||||||
for (const auto& [name, in_path] : paths) {
|
for (const auto& [name, in_path] : paths) {
|
||||||
if (!in_path.empty()) {
|
if (!in_path.empty()) {
|
||||||
|
|||||||
@ -101,6 +101,13 @@ bool WorldBoot::HandleCommandInput(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if we ran a valid command, this whole CLI handler needs to be improved at a later time
|
||||||
|
std::string arg1 = argc >= 2 ? argv[1] : "";
|
||||||
|
if (argc >= 2 && !Strings::Contains(arg1, ":")) {
|
||||||
|
std::cout << "Invalid command, use --help to see available commands" << std::endl;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user