1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 09:05:19 +02:00

Cleanup ClientLauncher structure (#10160)

Remove duplicated variables and unify the startup data into a new (inherited) struct.
This commit is contained in:
SmallJoker
2020-07-14 19:10:37 +02:00
committed by GitHub
parent 2bec83eec0
commit 4fa1e03f68
7 changed files with 197 additions and 200 deletions

View File

@@ -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;