]> git.localhorst.tv Git - blank.git/blobdiff - src/app/runtime.cpp
client-side implementation of login packet
[blank.git] / src / app / runtime.cpp
index 2f0f82ec1522e845602236aa32cf745d0cfc90f6..2d128631a2e19d8bde4af93c022cee5da248e798 100644 (file)
@@ -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);
 }