Skip to content

Commit

Permalink
log invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
lionkor committed Oct 6, 2024
1 parent 7b59cb6 commit 76cfc47
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 11 additions & 1 deletion src/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
1 change: 0 additions & 1 deletion src/Startup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ void InitLauncher() {
#elif defined(__linux__)

void InitLauncher() {
InitLog();
info("BeamMP Launcher v" + GetVer() + GetPatch());
CheckName();
CheckLocalKey();
Expand Down
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ int main(int argc, const char** argv) try {
}
}

InitLog();
InitOptions(argc, argv, options);
InitLauncher();

Expand Down

0 comments on commit 76cfc47

Please sign in to comment.