Re-enable --server and --port on patched 1.15.2 builds. (#74)

This commit is contained in:
Daniel Scalzi 2020-06-12 19:56:57 -04:00
parent 1bdb413ab5
commit b09cd2ef28
No known key found for this signature in database
GPG Key ID: D18EA3FB4B142A57
4 changed files with 35 additions and 6 deletions

View File

@ -194,6 +194,26 @@ class Util {
}
}
static isAutoconnectBroken(forgeVersion) {
const forgeVer = forgeVersion.split('-')[1]
const minWorking = [31, 2, 15]
const verSplit = forgeVer.split('.').map(v => Number(v))
if(verSplit[0] === 31) {
for(let i=0; i<minWorking.length; i++) {
if(verSplit[i] > minWorking[i]) {
return false
} else if(verSplit[i] < minWorking[i]) {
return true
}
}
}
return false
}
}

View File

@ -474,11 +474,20 @@ class ProcessBuilder {
}
// Autoconnect
if(Util.mcVersionAtLeast('1.15', this.server.getMinecraftVersion())) {
logger.error('Server autoconnect disabled on 1.15+ due to OpenGL Stack Overflow issue.')
let isAutoconnectBroken
try {
isAutoconnectBroken = Util.isAutoconnectBroken(this.forgeData.id.split('-')[2])
} catch(err) {
logger.error('Forge version format changed.. assuming autoconnect works.')
}
if(isAutoconnectBroken) {
logger.error('Server autoconnect disabled on Forge 1.15.2 for builds earlier than 31.2.15 due to OpenGL Stack Overflow issue.')
logger.error('Please upgrade your Forge version to at least 31.2.15!')
} else {
this._processAutoConnectArg(args)
}
// Forge Specific Arguments
args = args.concat(this.forgeData.arguments.game)

6
package-lock.json generated
View File

@ -1025,9 +1025,9 @@
}
},
"electron": {
"version": "9.0.3",
"resolved": "https://registry.npmjs.org/electron/-/electron-9.0.3.tgz",
"integrity": "sha512-rY59wy50z0oWp/q69zq0UIzvtcM5j2BJbLAwEoLfVNS3DLt9wDZqRqSIBvLEBl+xWbafCnRA9haEqi7ssM94GA==",
"version": "9.0.4",
"resolved": "https://registry.npmjs.org/electron/-/electron-9.0.4.tgz",
"integrity": "sha512-QzkeZNAiNB7KxcdoQKSoaiVT/GQdB4Vt0/ZZOuU8tIKABAsni2I7ztiAbUzxcsnQsqEBSfChuPuDQ5A4VbbzPg==",
"dev": true,
"requires": {
"@electron/get": "^1.0.1",

View File

@ -41,7 +41,7 @@
},
"devDependencies": {
"cross-env": "^7.0.2",
"electron": "^9.0.3",
"electron": "^9.0.4",
"electron-builder": "^22.7.0",
"eslint": "^7.2.0"
},