handle custom local UDP port for domain-server from webpage

This commit is contained in:
Stephen Birarda 2014-10-06 14:41:16 -07:00
parent 2d3f3edcad
commit 14cd044359
3 changed files with 16 additions and 0 deletions

View file

@ -33,6 +33,14 @@
"label": "None: use the network information I have entered for this domain at data.highfidelity.io"
}
]
},
{
"name": "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",
"type": "int",
"advanced": true
}
]
},

View file

@ -46,6 +46,11 @@ var viewHelpers = {
form_group += "<input type='hidden' name='" + setting_name + "' value='" + setting_value + "'>"
} else {
if (input_type == 'integer') {
input_type = "text"
}
form_group += "<input type='" + input_type + "' class='form-control' name='" + setting_name +
"' placeholder='" + (_.has(setting, 'placeholder') ? setting.placeholder : "") +
"' value='" + setting_value + "'" + (isLocked ? " disabled" : "") + "/>"

View file

@ -254,11 +254,14 @@ void DomainServerSettingsManager::recurseJSONObjectAndOverwriteSettings(const QJ
QString settingType = groupObject[SETTING_DESCRIPTION_TYPE_KEY].toString();
const QString INPUT_DOUBLE_TYPE = "double";
const QString INPUT_INTEGER_TYPE = "int";
// make sure the resulting json value has the right type
if (settingType == INPUT_DOUBLE_TYPE) {
settingsVariant[key] = rootValue.toString().toDouble();
} else if (settingType == INPUT_INTEGER_TYPE) {
settingsVariant[key] = rootValue.toString().toInt();
} else {
settingsVariant[key] = rootValue.toString();
}