Skip to content

Commit

Permalink
Re-enable --server and --port on patched 1.15.2 builds. (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
dscalzi committed Jun 12, 2020
1 parent 1bdb413 commit b09cd2e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
20 changes: 20 additions & 0 deletions app/assets/js/assetguard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

}


Expand Down
13 changes: 11 additions & 2 deletions app/assets/js/processbuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit b09cd2e

Please sign in to comment.