File tree Expand file tree Collapse file tree 4 files changed +21
-16
lines changed Expand file tree Collapse file tree 4 files changed +21
-16
lines changed Original file line number Diff line number Diff line change 1
1
const { app, BrowserWindow, ipcMain } = require ( 'electron' ) ;
2
2
const fs = require ( 'fs' ) ;
3
3
const ncp = require ( 'ncp' ) . ncp ;
4
- const path = require ( 'path ' ) ;
4
+ const request = require ( 'request ' ) ;
5
5
const storage = require ( 'electron-json-storage' ) ;
6
6
const _ = require ( 'lodash' ) ;
7
7
const SWProxy = require ( './proxy/SWProxy' ) ;
8
8
9
+ const path = require ( 'path' ) ;
10
+ const url = require ( 'url' ) ;
11
+
9
12
let win ;
10
13
let defaultConfig = {
11
14
Config : {
@@ -83,7 +86,11 @@ function createWindow () {
83
86
autoHideMenuBar : true ,
84
87
titleBarStyle : 'hidden-inset'
85
88
} ) ;
86
- win . loadURL ( `file://${ __dirname } /index.html` ) ;
89
+ win . loadURL ( url . format ( {
90
+ pathname : path . join ( __dirname , 'index.html' ) ,
91
+ protocol : 'file:' ,
92
+ slashes : true
93
+ } ) )
87
94
}
88
95
89
96
function loadPlugins ( ) {
@@ -113,7 +120,7 @@ function loadPlugins() {
113
120
// Initialize plugins
114
121
plugins . forEach ( function ( plug ) {
115
122
config [ plug . pluginName ] = _ . merge ( plug . defaultConfig , config [ plug . pluginName ] ) ;
116
- plug . init ( proxy , config [ plug . pluginName ] ) ;
123
+ plug . init ( proxy , config [ plug . pluginName ] , request ) ;
117
124
} )
118
125
119
126
return plugins ;
Original file line number Diff line number Diff line change 1
- const request = require ( 'request' ) ;
2
-
3
1
module . exports = {
4
2
defaultConfig : {
5
3
enabled : true
6
4
} ,
7
5
pluginName : 'SwagLogger' ,
8
6
log_url : 'https://gw.swop.one/data/upload/' ,
9
- init ( proxy , config ) {
7
+ init ( proxy , config , request ) {
10
8
proxy . on ( 'GetGuildWarBattleLogByGuildId' , ( req , resp ) => {
11
9
if ( config . enabled )
12
- this . log ( proxy , req , resp ) ;
10
+ this . log ( proxy , req , resp , request ) ;
13
11
} ) ;
14
12
proxy . on ( 'GetGuildWarBattleLogByWizardId' , ( req , resp ) => {
15
13
if ( config . enabled )
16
- this . log ( proxy , req , resp ) ;
14
+ this . log ( proxy , req , resp , request ) ;
17
15
} ) ;
18
16
} ,
19
17
20
- log ( proxy , req , resp ) {
18
+ log ( proxy , req , resp , request ) {
21
19
const { command} = req ;
22
20
23
21
let options = {
Original file line number Diff line number Diff line change 1
- const request = require ( 'request' ) ;
2
-
3
1
module . exports = {
4
2
defaultConfig : {
5
3
enabled : true
@@ -8,7 +6,7 @@ module.exports = {
8
6
commands_url : 'https://swarfarm.com/data/log/accepted_commands/' ,
9
7
log_url : 'https://swarfarm.com/data/log/upload/' ,
10
8
accepted_commands : false ,
11
- init ( proxy ) {
9
+ init ( proxy , config , request ) {
12
10
this . proxy = proxy ;
13
11
let options = {
14
12
method : 'get' ,
@@ -25,11 +23,11 @@ module.exports = {
25
23
} ) ;
26
24
proxy . on ( 'apiCommand' , ( req , resp ) => {
27
25
if ( config . enabled )
28
- this . log ( proxy , req , resp ) ;
26
+ this . log ( proxy , req , resp , request ) ;
29
27
} ) ;
30
28
} ,
31
29
32
- log ( proxy , req , resp ) {
30
+ log ( proxy , req , resp , request ) {
33
31
const { command} = req ;
34
32
35
33
if ( ! this . accepted_commands || ! this . accepted_commands [ command ] )
Original file line number Diff line number Diff line change @@ -6,11 +6,13 @@ packager({
6
6
dir : '.' ,
7
7
out : 'dist' ,
8
8
//all: true,
9
- platform : 'win32,darwin,linux ' ,
9
+ platform : 'win32' ,
10
10
arch : 'x64' ,
11
11
ignore : [ '/plugins($|/)' ] ,
12
12
overwrite : true ,
13
- asar : true ,
13
+ asar : {
14
+ unpack : '*.node'
15
+ } ,
14
16
win32metadata : {
15
17
CompanyName : 'SW Exporter Company' ,
16
18
FileDescription : 'Summoners War Exporter' ,
You can’t perform that action at this time.
0 commit comments