mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Cleanup ClientLauncher structure (#10160)
Remove duplicated variables and unify the startup data into a new (inherited) struct.
This commit is contained in:
parent
2bec83eec0
commit
4fa1e03f68
7 changed files with 197 additions and 200 deletions
12
src/main.cpp
12
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue