- for (masternum = 0;sv_masters[masternum].name;masternum++)
- Cvar_RegisterVariable(&sv_masters[masternum]);
+ for (i = 0;sv_masters[i].name;i++)
+ Cvar_RegisterVariable(&sv_masters[i]);
+// COMMANDLINEOPTION: Server: -ip <ipaddress> sets the ip address of this machine for purposes of networking (default 0.0.0.0 also known as INADDR_ANY), use only if you have multiple network adapters and need to choose one specifically.
+ if ((i = COM_CheckParm("-ip")) && i + 1 < com_argc)
+ {
+ if (LHNETADDRESS_FromString(&tempaddress, com_argv[i + 1], 0) == 1)
+ {
+ Con_Printf("-ip option used, setting net_address to \"%s\"\n");
+ Cvar_SetQuick(&net_address, com_argv[i + 1]);
+ }
+ else
+ Con_Printf("-ip option used, but unable to parse the address \"%s\"\n", com_argv[i + 1]);
+ }
+// COMMANDLINEOPTION: Server: -port <portnumber> sets the port to use for a server (default 26000, the same port as QUAKE itself), useful if you host multiple servers on your machine
+ if (((i = COM_CheckParm("-port")) || (i = COM_CheckParm("-ipport")) || (i = COM_CheckParm("-udpport"))) && i + 1 < com_argc)
+ {
+ i = atoi(com_argv[i + 1]);
+ if (i >= 0 && i < 65536)
+ {
+ Con_Printf("-port option used, setting port cvar to %i\n", i);
+ Cvar_SetValueQuick(&sv_netport, i);
+ }
+ else
+ Con_Printf("-port option used, but %i is not a valid port number\n", i);