v1.0.0-beta.3 - Added error handling for LaunchWrapper failure.

Fixes #5.
pull/19/head v1.0.0-beta.3
Daniel Scalzi 2018-08-19 03:16:08 -04:00
parent 845721a830
commit 58a8215b05
No known key found for this signature in database
GPG Key ID: 5CA2F145B63535F9
3 changed files with 19 additions and 2 deletions

View File

@ -598,6 +598,7 @@ function dlAsync(login = true){
} }
proc.stdout.on('data', gameStateChange) proc.stdout.on('data', gameStateChange)
proc.stdout.removeListener('data', tempListener) proc.stdout.removeListener('data', tempListener)
proc.stderr.removeListener('data', gameErrorListener)
} }
} }
@ -611,12 +612,28 @@ function dlAsync(login = true){
} }
} }
const gameErrorListener = function(data){
data = data.trim()
if(data.indexOf('Could not find or load main class net.minecraft.launchwrapper.Launch') > -1){
console.error('Game launch failed, LaunchWrapper was not downloaded properly.')
setOverlayContent(
'Error During Launch',
'The main file, LaunchWrapper, failed to download properly. As a result, the game cannot launch.<br><br>To fix this issue, temporarily turn off your antivirus software and launch the game again.<br><br>If you have time, please <a href="https://github.com/WesterosCraftCode/ElectronLauncher/issues">submit an issue</a> and let us know what antivirus software you use. We\'ll contact them and try to straighten things out.',
'Okay'
)
setOverlayHandler(null)
toggleOverlay(true)
toggleLaunchArea(false)
}
}
try { try {
// Build Minecraft process. // Build Minecraft process.
proc = pb.build() proc = pb.build()
// Bind listeners to stdout. // Bind listeners to stdout.
proc.stdout.on('data', tempListener) proc.stdout.on('data', tempListener)
proc.stderr.on('data', gameErrorListener)
setLaunchDetails('Done. Enjoy the server!') setLaunchDetails('Done. Enjoy the server!')

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "westeroscraftlauncher", "name": "westeroscraftlauncher",
"version": "1.0.0-beta.2", "version": "1.0.0-beta.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "westeroscraftlauncher", "name": "westeroscraftlauncher",
"version": "1.0.0-beta.2", "version": "1.0.0-beta.3",
"description": "Custom modded launcher for Westeroscraft", "description": "Custom modded launcher for Westeroscraft",
"productName": "WesterosCraft Launcher", "productName": "WesterosCraft Launcher",
"main": "index.js", "main": "index.js",