瀏覽代碼

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

Fixes #5.
Daniel Scalzi 7 年之前
父節點
當前提交
58a8215b05
共有 3 個文件被更改,包括 19 次插入2 次删除
  1. 17 0
      app/assets/js/scripts/landing.js
  2. 1 1
      package-lock.json
  3. 1 1
      package.json

+ 17 - 0
app/assets/js/scripts/landing.js

@@ -598,6 +598,7 @@ function dlAsync(login = true){
                         }
                         proc.stdout.on('data', gameStateChange)
                         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 {
                     // Build Minecraft process.
                     proc = pb.build()
 
                     // Bind listeners to stdout.
                     proc.stdout.on('data', tempListener)
+                    proc.stderr.on('data', gameErrorListener)
 
                     setLaunchDetails('Done. Enjoy the server!')
 

+ 1 - 1
package-lock.json

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

+ 1 - 1
package.json

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