Connect to default port 23000 if port not specified

This commit is contained in:
gsemaj 2022-04-27 13:16:24 -04:00
parent 8d5a8df023
commit 6e881cbfaf

View File

@ -155,7 +155,19 @@ function setGameInfo(serverUUID) {
window.asseturl = gameversion.url; // gameclient.js needs to access this
remotefs.writeFileSync(__dirname+"\\assetInfo.php", asseturl);
remotefs.writeFileSync(__dirname+"\\loginInfo.php", result.ip);
// Server address parsing
var address;
var port;
var sepPos = result.ip.indexOf(":");
if (sepPos > -1) {
address = result.ip.substr(0, sepPos);
port = result.ip.substr(sepPos + 1);
} else {
address = result.ip
port = 23000 // default
}
remotefs.writeFileSync(__dirname+"\\loginInfo.php", address + ":" + port);
if (result.hasOwnProperty('endpoint')) {
var httpendpoint = result.endpoint.replace("https://", "http://")