@@ -19,7 +19,7 @@ export const getBasePunishment = (crime: BanReason) => {
19
19
return LIGHT_PUNISHMENT ;
20
20
case BanReason . LOAD_FAILURE :
21
21
return MEDIUM_PUNISHMENT ;
22
- case BanReason . REPORTS :
22
+ case BanReason . ABANDON :
23
23
return HARD_PUNISHMENT ;
24
24
default :
25
25
return 0 ;
@@ -29,7 +29,7 @@ export const getBasePunishment = (crime: BanReason) => {
29
29
export const countCrimes = ( crimes : PlayerCrimeLogEntity [ ] ) => {
30
30
const grouped : Map < BanReason , number > = new Map ( ) ;
31
31
for ( let crime of crimes ) {
32
- grouped . set ( crime . crime , + grouped . get ( crime . crime ) + 1 ) ;
32
+ grouped . set ( crime . crime , ( grouped . get ( crime . crime ) || 0 ) + 1 ) ;
33
33
}
34
34
return grouped ;
35
35
} ;
@@ -86,11 +86,17 @@ export class CrimeLogCreatedHandler
86
86
const basePunishment = getBasePunishment ( thisCrime . crime ) ;
87
87
let punishmentDuration = basePunishment * totalPunishmentCount ;
88
88
89
+ console . log ( countedCrimes , totalPunishmentCount , basePunishment , punishmentDuration , thisCrime )
90
+
89
91
this . logger . log (
90
92
`Punishment: ${ punishmentDuration / 1000 / 60 } minutes for ${
91
93
thisCrime . steam_id
92
94
} . Total punishment count: ${ totalPunishmentCount } `,
93
95
) ;
96
+ thisCrime . banTime = punishmentDuration ;
97
+ thisCrime . handled = true ;
98
+ await this . playerCrimeLogEntityRepository . save ( thisCrime ) ;
99
+
94
100
await this . applyBan (
95
101
thisCrime . steam_id ,
96
102
punishmentDuration ,
0 commit comments