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:
parent
18b8b59af6
commit
15c84139fa
1 changed files with 9 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue