Skip to content

Commit

Permalink
* fixed binaries zmq for games
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
RyuMaster committed Jan 7, 2019
1 parent a563b1f commit b8c409f
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 54 deletions.
4 changes: 2 additions & 2 deletions daemon/chim.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ cls
if exist "!AppData!\Xaya\appdata.orv" (
set /p DataDirPath=<!AppData!\Xaya\appdata.orv
tasklist|find /i "xayad.exe" >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
)

4 changes: 2 additions & 2 deletions daemon/chim_main.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ cls
if exist "!AppData!\Xaya\appdata.orv" (
set /p DataDirPath=<!AppData!\Xaya\appdata.orv
tasklist|find /i "xayad.exe" >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
)

4 changes: 2 additions & 2 deletions daemon/chim_mainx86.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ cls
if exist "!AppData!\Xaya\appdata.orv" (
set /p DataDirPath=<!AppData!\Xaya\appdata.orv
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 -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
)

4 changes: 2 additions & 2 deletions daemon/chimx86.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ cls
if exist "!AppData!\Xaya\appdata.orv" (
set /p DataDirPath=<!AppData!\Xaya\appdata.orv
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 -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
)

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
77 changes: 56 additions & 21 deletions src/app/service/global.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 1 addition & 2 deletions src/app/settings/settings.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ <h4 class="card-title ">{{'SSETTINGS.CONNECTIONSETTINGS' | translate }}</h4>
<div class="col-sm-6">
<div class = "sstspace" *ngIf="this.usedefault==false"></div>
<div class = "warntexset"><span style = "color: #ff0000">*</span> {{'SSETTINGS.WARN' | translate }}</div>
<button mat-raised-button type="submit" class="btn btn-danger pull-right buttonBas specialBUBut" (click)="backUpWallet(0); $event.stopPropagation();">{{'SSETTINGS.BACKUP' | translate }} [{{'SOVERVIEW.VAULTWALLET' | translate }}]</button>
<button mat-raised-button type="submit" class="btn btn-danger pull-right buttonBas specialBUBut" (click)="backUpWallet(1); $event.stopPropagation();">{{'SSETTINGS.BACKUP' | translate }} [{{'SOVERVIEW.GAMEWALLET' | translate}}]</button>
<button mat-raised-button type="submit" class="btn btn-danger pull-right buttonBas specialBUBut" (click)="backUpWallet(0); $event.stopPropagation();">{{'SSETTINGS.BACKUP' | translate }}</button>
<button mat-raised-button type="submit" class="btn btn-danger pull-right buttonBas specialBUBut" (click)="askIfResynch(); $event.stopPropagation();">{{'SSETTINGS.RESYNCH' | translate }}</button>
<fieldset style = "text-align: center;">
<div class="form-group">
Expand Down
30 changes: 8 additions & 22 deletions src/app/settings/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b8c409f

Please sign in to comment.