Skip to content

Commit b09cd2e

Browse files
committed
Re-enable --server and --port on patched 1.15.2 builds. (dscalzi#74)
1 parent 1bdb413 commit b09cd2e

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

app/assets/js/assetguard.js

+20
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,26 @@ class Util {
194194
}
195195
}
196196

197+
static isAutoconnectBroken(forgeVersion) {
198+
199+
const forgeVer = forgeVersion.split('-')[1]
200+
201+
const minWorking = [31, 2, 15]
202+
const verSplit = forgeVer.split('.').map(v => Number(v))
203+
204+
if(verSplit[0] === 31) {
205+
for(let i=0; i<minWorking.length; i++) {
206+
if(verSplit[i] > minWorking[i]) {
207+
return false
208+
} else if(verSplit[i] < minWorking[i]) {
209+
return true
210+
}
211+
}
212+
}
213+
214+
return false
215+
}
216+
197217
}
198218

199219

app/assets/js/processbuilder.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,20 @@ class ProcessBuilder {
474474
}
475475

476476
// Autoconnect
477-
if(Util.mcVersionAtLeast('1.15', this.server.getMinecraftVersion())) {
478-
logger.error('Server autoconnect disabled on 1.15+ due to OpenGL Stack Overflow issue.')
477+
let isAutoconnectBroken
478+
try {
479+
isAutoconnectBroken = Util.isAutoconnectBroken(this.forgeData.id.split('-')[2])
480+
} catch(err) {
481+
logger.error('Forge version format changed.. assuming autoconnect works.')
482+
}
483+
484+
if(isAutoconnectBroken) {
485+
logger.error('Server autoconnect disabled on Forge 1.15.2 for builds earlier than 31.2.15 due to OpenGL Stack Overflow issue.')
486+
logger.error('Please upgrade your Forge version to at least 31.2.15!')
479487
} else {
480488
this._processAutoConnectArg(args)
481489
}
490+
482491

483492
// Forge Specific Arguments
484493
args = args.concat(this.forgeData.arguments.game)

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
"devDependencies": {
4343
"cross-env": "^7.0.2",
44-
"electron": "^9.0.3",
44+
"electron": "^9.0.4",
4545
"electron-builder": "^22.7.0",
4646
"eslint": "^7.2.0"
4747
},

0 commit comments

Comments
 (0)