From b8c409fd908ae758976631b53e2de980bf5445d2 Mon Sep 17 00:00:00 2001 From: Ryu Master Date: Mon, 7 Jan 2019 20:23:28 +0200 Subject: [PATCH] * fixed binaries zmq for games * merged backup gui buttons into one * made stop not fire when 'automatically run on start" is not ticked * tested with the fresh daemon, which has unicode character issue fixed --- daemon/chim.bat | 4 +- daemon/chim_main.bat | 4 +- daemon/chim_mainx86.bat | 4 +- daemon/chimx86.bat | 4 +- package.json | 2 +- src/app/service/global.service.ts | 77 +++++++++++++++++------- src/app/settings/settings.component.html | 3 +- src/app/settings/settings.component.ts | 30 +++------ 8 files changed, 74 insertions(+), 54 deletions(-) diff --git a/daemon/chim.bat b/daemon/chim.bat index 7220e76..ec87e89 100644 --- a/daemon/chim.bat +++ b/daemon/chim.bat @@ -4,11 +4,11 @@ cls if exist "!AppData!\Xaya\appdata.orv" ( set /p DataDirPath=NUL - if errorlevel 1 xayad.exe -wallet=vault.dat -wallet=game.dat -testnet -server -rpcallowip=127.0.0.1 -datadir=!DataDirPath! -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqgameblocks=tcp://127.0.0.1:28332 + if errorlevel 1 xayad.exe -wallet=vault.dat -wallet=game.dat -testnet -server -rpcallowip=127.0.0.1 -datadir=!DataDirPath! -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqpubgameblocks=tcp://127.0.0.1:28332 goto :eof ) else ( tasklist|find /i "xayad.exe" >NUL - if errorlevel 1 xayad.exe -wallet=vault.dat -wallet=game.dat -testnet -server -rpcallowip=127.0.0.1 -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqgameblocks=tcp://127.0.0.1:28332 + if errorlevel 1 xayad.exe -wallet=vault.dat -wallet=game.dat -testnet -server -rpcallowip=127.0.0.1 -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqpubgameblocks=tcp://127.0.0.1:28332 goto :eof ) diff --git a/daemon/chim_main.bat b/daemon/chim_main.bat index 06241bd..4840e80 100644 --- a/daemon/chim_main.bat +++ b/daemon/chim_main.bat @@ -4,11 +4,11 @@ cls if exist "!AppData!\Xaya\appdata.orv" ( set /p DataDirPath=NUL - if errorlevel 1 xayad.exe -wallet=vault.dat -wallet=game.dat -server -rpcallowip=127.0.0.1 -datadir=!DataDirPath! -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqgameblocks=tcp://127.0.0.1:28332 + if errorlevel 1 xayad.exe -wallet=vault.dat -wallet=game.dat -server -rpcallowip=127.0.0.1 -datadir=!DataDirPath! -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqpubgameblocks=tcp://127.0.0.1:28332 goto :eof ) else ( tasklist|find /i "xayad.exe" >NUL - if errorlevel 1 xayad.exe -wallet=vault.dat -wallet=game.dat -server -rpcallowip=127.0.0.1 -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqgameblocks=tcp://127.0.0.1:28332 + if errorlevel 1 xayad.exe -wallet=vault.dat -wallet=game.dat -server -rpcallowip=127.0.0.1 -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqpubgameblocks=tcp://127.0.0.1:28332 goto :eof ) diff --git a/daemon/chim_mainx86.bat b/daemon/chim_mainx86.bat index 022d5eb..22c82bf 100644 --- a/daemon/chim_mainx86.bat +++ b/daemon/chim_mainx86.bat @@ -4,11 +4,11 @@ cls if exist "!AppData!\Xaya\appdata.orv" ( set /p DataDirPath=NUL - if errorlevel 1 xayad_x86.exe -wallet=vault.dat -wallet=game.dat -server -rpcallowip=127.0.0.1 -datadir=!DataDirPath! -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqgameblocks=tcp://127.0.0.1:28332 + if errorlevel 1 xayad_x86.exe -wallet=vault.dat -wallet=game.dat -server -rpcallowip=127.0.0.1 -datadir=!DataDirPath! -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqpubgameblocks=tcp://127.0.0.1:28332 goto :eof ) else ( tasklist|find /i "xayad_x86.exe" >NUL - if errorlevel 1 xayad_x86.exe -wallet=vault.dat -wallet=game.dat -server -rpcallowip=127.0.0.1 -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqgameblocks=tcp://127.0.0.1:28332 + if errorlevel 1 xayad_x86.exe -wallet=vault.dat -wallet=game.dat -server -rpcallowip=127.0.0.1 -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqpubgameblocks=tcp://127.0.0.1:28332 goto :eof ) diff --git a/daemon/chimx86.bat b/daemon/chimx86.bat index 718bd94..8af74af 100644 --- a/daemon/chimx86.bat +++ b/daemon/chimx86.bat @@ -4,11 +4,11 @@ cls if exist "!AppData!\Xaya\appdata.orv" ( set /p DataDirPath=NUL - if errorlevel 1 xayad_x86.exe -wallet=vault.dat -wallet=game.dat -testnet -server -rpcallowip=127.0.0.1 -datadir=!DataDirPath! -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqgameblocks=tcp://127.0.0.1:28332 + if errorlevel 1 xayad_x86.exe -wallet=vault.dat -wallet=game.dat -testnet -server -rpcallowip=127.0.0.1 -datadir=!DataDirPath! -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqpubgameblocks=tcp://127.0.0.1:28332 goto :eof ) else ( tasklist|find /i "xayad_x86.exe" >NUL - if errorlevel 1 xayad_x86.exe -wallet=vault.dat -wallet=game.dat -testnet -server -rpcallowip=127.0.0.1 -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqgameblocks=tcp://127.0.0.1:28332 + if errorlevel 1 xayad_x86.exe -wallet=vault.dat -wallet=game.dat -testnet -server -rpcallowip=127.0.0.1 -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqpubgameblocks=tcp://127.0.0.1:28332 goto :eof ) diff --git a/package.json b/package.json index bdb0a31..b904e7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "XAYA-Electron", - "version": "1.1.0", + "version": "1.1.1", "description": "XAYA", "homepage": "https://github.com/xaya/xaya_electron", "author": { diff --git a/src/app/service/global.service.ts b/src/app/service/global.service.ts index 557cb50..03e737d 100644 --- a/src/app/service/global.service.ts +++ b/src/app/service/global.service.ts @@ -724,6 +724,18 @@ export class GlobalService implements OnDestroy { { return false; } + + let rundaemon = this.container.get('rundaemon'); + + if( rundaemon == undefined || rundaemon == null) + { + rundaemon = true; + } + + if(!rundaemon) + { + return true; + } var _that = this; this.client.stop().then( @@ -751,32 +763,55 @@ export class GlobalService implements OnDestroy { return; } - - var _that = this; - this.client.stop().then( - (help) => - { - - window.require('electron').remote.getCurrentWindow().close(); - } - ).catch(function(e) { - - window.require('electron').remote.getCurrentWindow().close(); - - }); + + let rundaemon = this.container.get('rundaemon'); + + if( rundaemon == undefined || rundaemon == null) + { + rundaemon = true; + } + + if(!rundaemon) + { + window.require('electron').remote.getCurrentWindow().close(); + } + else + { + var _that = this; + this.client.stop().then( + (help) => + { + window.require('electron').remote.getCurrentWindow().close(); + } + ).catch(function(e) { + + window.require('electron').remote.getCurrentWindow().close(); + + }); + } } ngOnDestroy() { - this.client.stop().then( - (help) => - { - - } - ).catch(function(e) { - - }); + let rundaemon = this.container.get('rundaemon'); + + if( rundaemon == undefined || rundaemon == null) + { + rundaemon = true; + } + + if(rundaemon) + { + this.client.stop().then( + (help) => + { + + } + ).catch(function(e) { + + }); + } } getDefaultPort() diff --git a/src/app/settings/settings.component.html b/src/app/settings/settings.component.html index a43da29..9c232fa 100644 --- a/src/app/settings/settings.component.html +++ b/src/app/settings/settings.component.html @@ -103,8 +103,7 @@

{{'SSETTINGS.CONNECTIONSETTINGS' | translate }}

* {{'SSETTINGS.WARN' | translate }}
- - +
diff --git a/src/app/settings/settings.component.ts b/src/app/settings/settings.component.ts index 0637d1b..0ce7f97 100644 --- a/src/app/settings/settings.component.ts +++ b/src/app/settings/settings.component.ts @@ -184,37 +184,23 @@ export class SettingsComponent { backUpWallet(type) { - if(type == 0) + window.require('electron').remote.dialog.showSaveDialog({title: this.translate.instant('SSETTINGS.SELBUDIST'), defaultPath: '~/vault.dat', filters: [{name: 'Wallet Data', extensions: ['dat']}]}, (filePath) => { - window.require('electron').remote.dialog.showSaveDialog({title: this.translate.instant('SSETTINGS.SELBUDIST'), defaultPath: '~/vault.dat', filters: [{name: 'Wallet Data', extensions: ['dat']}]}, (filePath) => { if (filePath === undefined) { swal(this.translate.instant('SOVERVIEW.ERROR'), this.translate.instant('SSETTINGS.NOFILESEL'), "error"); return; } - - - this.globalService.walletBackUp(filePath, type); - }); - } - else - { - window.require('electron').remote.dialog.showSaveDialog({title: this.translate.instant('SSETTINGS.SELBUDIST'), defaultPath: '~/game.dat', filters: [{name: 'Wallet Data', extensions: ['dat']}]}, (filePath) => { - - if (filePath === undefined) - { - swal(this.translate.instant('SOVERVIEW.ERROR'), this.translate.instant('SSETTINGS.NOFILESEL'), "error"); - return; - } - - - - this.globalService.walletBackUp(filePath, type); - }); - } + this.globalService.walletBackUp(filePath, 0); + + filePath = filePath.replace(".dat","[game].dat"); + + this.globalService.walletBackUp(filePath, 1); + + }); } getCurrentWalletType()