@@ -12,12 +12,12 @@ const steamId = new SteamId(readline.question('SteamID64: '));
12
12
const opt = readline . keyInSelect ( [ 'Report' , 'Commend' ] ) ;
13
13
14
14
let matchId ;
15
- if ( opt == 0 )
15
+ if ( opt === 0 )
16
16
matchId = readline . question ( 'Match ID: ' ) ;
17
17
18
18
if ( steamId . isValid ( ) && opt >= 0 ) {
19
19
accounts . forEach ( account => {
20
- if ( ! account ) {
20
+ if ( ! account ) {
21
21
return ;
22
22
}
23
23
@@ -29,14 +29,14 @@ if (steamId.isValid() && opt >= 0) {
29
29
const param = account . split ( ':' ) ;
30
30
let login = {
31
31
account_name : param [ 0 ] ,
32
- password : param [ 1 ] . replace ( / [ \n \t \r ] / g, "" )
32
+ password : param [ 1 ] . replace ( / [ \n \t \r ] / g, '' )
33
33
} ;
34
34
35
35
let keepAlive ;
36
- fs . access ( `/sentry/${ param [ 0 ] } ` , fs . F_OK , err => {
36
+ fs . access ( `. /sentry/${ param [ 0 ] } ` , fs . F_OK , err => {
37
37
if ( ! err ) {
38
38
console . info ( `[${ param [ 0 ] } ] Sentryfile found!` ) ;
39
- login . sha_sentryfile = fs . readFileSync ( `/sentry/${ param [ 0 ] } ` ) ;
39
+ login . sha_sentryfile = fs . readFileSync ( `. /sentry/${ param [ 0 ] } ` ) ;
40
40
}
41
41
} ) ;
42
42
@@ -86,6 +86,10 @@ if (steamId.isValid() && opt >= 0) {
86
86
return shasum . read ( ) ;
87
87
}
88
88
89
+ if ( ! fs . existsSync ( './sentry' ) ) {
90
+ fs . mkdirSync ( './sentry' ) ;
91
+ }
92
+
89
93
fs . writeFileSync ( `./sentry/${ param [ 0 ] } ` , SHA1 ( data . bytes ) ) ;
90
94
next ( { sha_file : SHA1 ( data . bytes ) } ) ;
91
95
} ) ;
@@ -95,13 +99,13 @@ if (steamId.isValid() && opt >= 0) {
95
99
client . disconnect ( ) ;
96
100
} ) ;
97
101
98
- gc . on ( 'message' , ( header , buffer , next ) => {
102
+ gc . on ( 'message' , ( header , buffer ) => {
99
103
switch ( header . msg ) {
100
104
case 4004 :
101
105
clearInterval ( keepAlive ) ;
102
- if ( opt == 0 ) {
106
+ if ( opt === 0 ) {
103
107
report ( gc , steamId , matchId , param [ 0 ] ) ;
104
- } else if ( opt == 1 ) {
108
+ } else if ( opt === 1 ) {
105
109
commend ( gc , steamId , param [ 0 ] ) ;
106
110
} else {
107
111
console . error ( 'idk' ) ;
@@ -134,7 +138,7 @@ function report(gc, sid, matchid, user) {
134
138
let accountId = sid . accountid ;
135
139
if ( matchid === null )
136
140
matchid = 8 ;
137
-
141
+
138
142
gc . send ( {
139
143
msg : Protos . ECsgoGCMsg . k_EMsgGCCStrike15_v2_ClientReportPlayer ,
140
144
proto : { }
0 commit comments