Support --port command line option to change a client or servers

port number.
This commit is contained in:
hiker 2016-12-01 22:29:23 +11:00
parent 09ca38d36e
commit ee63f2c456

View File

@ -980,6 +980,13 @@ int handleCmdLine()
// Networking command lines
NetworkConfig::get()->
setMaxPlayers(UserConfigParams::m_server_max_players);
if (CommandLine::has("--port", &n))
{
// We don't know if this instance is going to be a client
// or server, so just set both ports, only one will be used anyway
NetworkConfig::get()->setClientPort(n);
NetworkConfig::get()->setServerPort(n);
}
if (CommandLine::has("--connect-now", &s))
{
TransportAddress ip(s);