diff options
author | LawnCable <lawncable.tmw2@simonlaux.de> | 2018-06-29 00:08:32 +0200 |
---|---|---|
committer | LawnCable <lawncable.tmw2@simonlaux.de> | 2018-06-29 00:08:32 +0200 |
commit | 49f3654d60267a8d66850297f843022706d76ba2 (patch) | |
tree | f79d39dba0ea750673de57808f434838368ac157 | |
parent | 0227331ff38716076ea0e6b2bdd6ec76b178b5e6 (diff) | |
parent | 5fcd4751188ce49ccd04e710b990711ae236e180 (diff) | |
download | electron-49f3654d60267a8d66850297f843022706d76ba2.tar.gz electron-49f3654d60267a8d66850297f843022706d76ba2.tar.bz2 electron-49f3654d60267a8d66850297f843022706d76ba2.tar.xz electron-49f3654d60267a8d66850297f843022706d76ba2.zip |
Merge branch 'master' into onlineCount
-rw-r--r-- | src/main/manaplus/manaplus.ts | 7 | ||||
-rw-r--r-- | src/renderer/gameserver/TOSCheck.ts | 3 | ||||
-rw-r--r-- | src/renderer/gameserver/news.ts | 3 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/main/manaplus/manaplus.ts b/src/main/manaplus/manaplus.ts index 9183b94..2f028b8 100644 --- a/src/main/manaplus/manaplus.ts +++ b/src/main/manaplus/manaplus.ts @@ -42,7 +42,8 @@ export namespace ManaPlus{ //params = ['-v'];// DEBUG: This option is to disable manaplus for testing (open it just for getting the version) } catch (e){ console.log(e); - Status.showError("Launch Preperation Failed", e.message, "Launch preparation failed") + Status.showError("Launch Preperation Failed (LPF_PARMS)", e.message, "Launch preparation failed"); + Status.setPlaying(false); return; } let willUpdate:boolean=false; @@ -54,7 +55,9 @@ export namespace ManaPlus{ willUpdate = (version.isNewVersion && await updateDialog(version.newestVersion)); } catch (e){ console.log(e); - Status.showError("Launch Preperation Failed", e.message, "Launch preparation failed") + Status.showError("Launch Preperation Failed (LPF_Update): This error can also mean that you are offline, \ +please check you network connection first.", e.message, "Launch preparation failed") + Status.setPlaying(false); return; } } else { diff --git a/src/renderer/gameserver/TOSCheck.ts b/src/renderer/gameserver/TOSCheck.ts index 8dc29f2..e2e4bfc 100644 --- a/src/renderer/gameserver/TOSCheck.ts +++ b/src/renderer/gameserver/TOSCheck.ts @@ -35,6 +35,9 @@ function request(url:string):Promise<string>{ return new Promise((res, rej)=>{ var xhr = new XMLHttpRequest(); xhr.open('GET', url); + xhr.addEventListener("error", (ev)=>{ + rej(ev); + }); xhr.onload = function() { if (xhr.status === 200) { res(xhr.responseText); diff --git a/src/renderer/gameserver/news.ts b/src/renderer/gameserver/news.ts index b748777..094172c 100644 --- a/src/renderer/gameserver/news.ts +++ b/src/renderer/gameserver/news.ts @@ -26,6 +26,9 @@ export namespace News { // Fetches only the most recent entry function request(url:string):Promise<string>{ return new Promise((res, rej)=>{ var xhr = new XMLHttpRequest(); + xhr.addEventListener("error", (ev)=>{ + rej(ev); + }); xhr.open('GET', url); xhr.onload = function() { if (xhr.status === 200) { |