Support --port command line option to change a client or servers
port number.
This commit is contained in:
parent
09ca38d36e
commit
ee63f2c456
@ -980,6 +980,13 @@ int handleCmdLine()
|
|||||||
// Networking command lines
|
// Networking command lines
|
||||||
NetworkConfig::get()->
|
NetworkConfig::get()->
|
||||||
setMaxPlayers(UserConfigParams::m_server_max_players);
|
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))
|
if (CommandLine::has("--connect-now", &s))
|
||||||
{
|
{
|
||||||
TransportAddress ip(s);
|
TransportAddress ip(s);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user