mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 09:04:06 +02:00
handle changed domain-server port on start
This commit is contained in:
parent
14cd044359
commit
78920234bb
2 changed files with 5 additions and 12 deletions
|
@ -35,7 +35,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"name": "port",
|
||||
"name": "local_port",
|
||||
"label": "Local UDP Port",
|
||||
"help": "This is the local port your domain-server binds to for UDP connections.<br/>Depending on your router, this may need to be changed to run multiple full automatic networking domain-servers in the same network.",
|
||||
"default": "40102",
|
||||
|
|
|
@ -196,20 +196,13 @@ const QString DISABLED_AUTOMATIC_NETWORKING_VALUE = "disabled";
|
|||
|
||||
void DomainServer::setupNodeListAndAssignments(const QUuid& sessionUUID) {
|
||||
|
||||
const QString CUSTOM_PORT_OPTION = "port";
|
||||
unsigned short domainServerPort = DEFAULT_DOMAIN_SERVER_PORT;
|
||||
const QString CUSTOM_LOCAL_PORT_OPTION = "metaverse.local_port";
|
||||
|
||||
QVariant localPortValue = _settingsManager.valueOrDefaultValueForKeyPath(CUSTOM_LOCAL_PORT_OPTION);
|
||||
unsigned short domainServerPort = (unsigned short) localPortValue.toUInt();
|
||||
|
||||
QVariantMap& settingsMap = _settingsManager.getSettingsMap();
|
||||
|
||||
QVariant autoNetworkingValue = _settingsManager.valueOrDefaultValueForKeyPath(METAVERSE_AUTOMATIC_NETWORKING_KEY_PATH);
|
||||
|
||||
if (!autoNetworkingValue.isNull() && autoNetworkingValue.toString() == FULL_AUTOMATIC_NETWORKING_VALUE) {
|
||||
// when using full networking use an ephemeral port - disabled until nodes can find us this way
|
||||
// domainServerPort = 0;
|
||||
} else if (settingsMap.contains(CUSTOM_PORT_OPTION)) {
|
||||
domainServerPort = (unsigned short) settingsMap.value(CUSTOM_PORT_OPTION).toUInt();
|
||||
}
|
||||
|
||||
unsigned short domainServerDTLSPort = 0;
|
||||
|
||||
if (_isUsingDTLS) {
|
||||
|
|
Loading…
Reference in a new issue