log invocation

This commit is contained in:
Lion Kortlepel 2024-10-07 00:43:25 +02:00
parent 7b59cb6f87
commit 76cfc47a2f
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B
4 changed files with 14 additions and 4 deletions

View File

@ -9,8 +9,8 @@ The launcher is the way we communitcate to outside the game, it does a few autom
In the root directory of the project,
1. `cmake -DCMAKE_BUILD_TYPE=Release . -B bin -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static`
2. `cmake --build bin --parallel --config Release`
Remember to change `C:/vcpkg` to wherever you have vcpkg installed.
Remember to change `C:/vcpkg` to wherever you have vcpkg installed.
## How to build - Debug

View File

@ -10,6 +10,16 @@ void InitOptions(int argc, const char *argv[], Options &options) {
options.argc = argc;
options.argv = argv;
std::string AllOptions;
for (int i = 0; i < argc; ++i) {
AllOptions += std::string(argv[i]);
if (i + 1 < argc) {
AllOptions += " ";
}
}
debug("Launcher was invoked as: '" + AllOptions + "'");
if (argc > 2) {
if (std::string(argv[1]) == "0" && std::string(argv[2]) == "0") {
options.verbose = true;
@ -26,7 +36,7 @@ void InitOptions(int argc, const char *argv[], Options &options) {
while (i < argc) {
std::string argument(argv[i]);
if (argument == "-p" || argument == "--port") {
if (argc > i) {
if (i + 1 >= argc) {
std::string error_message =
"No port specified, resorting to default (";
error_message += std::to_string(options.port);

View File

@ -242,7 +242,6 @@ void InitLauncher() {
#elif defined(__linux__)
void InitLauncher() {
InitLog();
info("BeamMP Launcher v" + GetVer() + GetPatch());
CheckName();
CheckLocalKey();

View File

@ -54,6 +54,7 @@ int main(int argc, const char** argv) try {
}
}
InitLog();
InitOptions(argc, argv, options);
InitLauncher();