1
0
Fork 0

Fix launcher failure with custom MP server

When the user specified an MP server without providing a port, the
launcher would pass a malformed command line, leading the the simulator
bailing out. 

(Should go to the release branch)
This commit is contained in:
James Turner 2017-05-18 20:03:40 +01:00
parent 18b8b59af6
commit 15c84139fa

View file

@ -59,18 +59,25 @@ Section {
placeholder: "localhost:5001"
}
readonly property int defaultMPPort: 5000
onApply: {
if (enableMP.checked) {
if (mpServer.currentIsCustom) {
var pieces = mpCustomServer.value.split(':')
var port = defaultMPPort;
if (pieces.length > 1) {
port = pieces[1];
}
_config.setProperty("/sim/multiplay/txhost", pieces[0]);
_config.setProperty("/sim/multiplay/txport", pieces[1]);
_config.setProperty("/sim/multiplay/txport", port);
} else {
var sel = mpServer.selectedIndex
_config.setProperty("/sim/multiplay/txhost", _mpServers.serverForIndex(sel));
var port = _mpServers.portForIndex(sel);
if (port == 0) {
port = 5000; // default MP port
port = defaultMPPort;
}
_config.setProperty("/sim/multiplay/txport", port);