X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2Fruntime.cpp;h=2d128631a2e19d8bde4af93c022cee5da248e798;hb=104592aabdc70b21065c35fe4d092fc6cdaa1f49;hp=2f0f82ec1522e845602236aa32cf745d0cfc90f6;hpb=9ebe2c320fd9f94266ab93fa2f9d9908a0a284d3;p=blank.git diff --git a/src/app/runtime.cpp b/src/app/runtime.cpp index 2f0f82e..2d12863 100644 --- a/src/app/runtime.cpp +++ b/src/app/runtime.cpp @@ -142,6 +142,14 @@ void Runtime::ReadArgs(int argc, const char *const *argv) { config.server.port = strtoul(argv[i], nullptr, 10); config.client.port = config.server.port; } + } else if (strcmp(param, "player-name") == 0) { + ++i; + if (i >= argc || argv[i] == nullptr || argv[i][0] == '\0') { + cerr << "missing argument to --player-name" << endl; + error = true; + } else { + config.interface.player_name = argv[i]; + } } else if (strcmp(param, "save-path") == 0) { ++i; if (i >= argc || argv[i] == nullptr || argv[i][0] == '\0') { @@ -349,7 +357,7 @@ void Runtime::RunClient() { } Application app(env); - ClientState client_state(env, config.world, save, config.client); + ClientState client_state(env, config.world, save, config.interface, config.client); app.PushState(&client_state); Run(app); }