From 4fa1e03f6844a24fc4b37f22e7264957b2a71d06 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Tue, 14 Jul 2020 19:10:37 +0200 Subject: Cleanup ClientLauncher structure (#10160) Remove duplicated variables and unify the startup data into a new (inherited) struct. --- src/main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index b3b17c2d1..af6d307dc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -197,7 +197,7 @@ int main(int argc, char *argv[]) } #endif - GameParams game_params; + GameStartData game_params; #ifdef SERVER porting::attachOrCreateConsole(); game_params.is_dedicated_server = true; @@ -604,10 +604,14 @@ static bool game_configure(GameParams *game_params, const Settings &cmd_args) static void game_configure_port(GameParams *game_params, const Settings &cmd_args) { - if (cmd_args.exists("port")) + if (cmd_args.exists("port")) { game_params->socket_port = cmd_args.getU16("port"); - else - game_params->socket_port = g_settings->getU16("port"); + } else { + if (game_params->is_dedicated_server) + game_params->socket_port = g_settings->getU16("port"); + else + game_params->socket_port = g_settings->getU16("remote_port"); + } if (game_params->socket_port == 0) game_params->socket_port = DEFAULT_SERVER_PORT; -- cgit v1.2.3