Skip to content

Commit 1e8be5e

Browse files
committed
Dont punish solomid abandons
1 parent f39f70d commit 1e8be5e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/gameserver/event-handler/crime-log-created.handler.ts

+12-6
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ export class CrimeLogCreatedHandler
7373
),
7474
)
7575
.then((proms) => {
76-
this.logger.log(`Initial cathing up in crimes finished, ${proms.length} crimes handled`)
77-
})
76+
this.logger.log(
77+
`Initial cathing up in crimes finished, ${proms.length} crimes handled`,
78+
);
79+
});
7880
}
7981

8082
async handle(event: CrimeLogCreatedEvent) {
@@ -87,7 +89,11 @@ export class CrimeLogCreatedHandler
8789
if (!thisCrime) return;
8890

8991
// We don't punish for crimes in bots
90-
if (thisCrime.lobby_type === MatchmakingMode.BOTS || thisCrime.lobby_type === MatchmakingMode.LOBBY) {
92+
if (
93+
thisCrime.lobby_type === MatchmakingMode.BOTS ||
94+
thisCrime.lobby_type === MatchmakingMode.LOBBY ||
95+
thisCrime.lobby_type == MatchmakingMode.SOLOMID
96+
) {
9197
thisCrime.handled = true;
9298
thisCrime.banTime = 0;
9399
await this.playerCrimeLogEntityRepository.save(thisCrime);
@@ -103,17 +109,17 @@ export class CrimeLogCreatedHandler
103109

104110
const cumInterval = getPunishmentCumulativeInterval(thisCrime.crime);
105111

106-
this.logger.log(`Cumulative interval for crime is ${cumInterval}`)
112+
this.logger.log(`Cumulative interval for crime is ${cumInterval}`);
107113

108114
const frequentCrimesCount = await this.playerCrimeLogEntityRepository
109115
.createQueryBuilder("pc")
110116
.select()
111117
.where("pc.steam_id = :sid", { sid: thisCrime.steam_id })
112118
.andWhere(`pc.created_at >= now() - :cum_interval::interval`, {
113-
cum_interval: cumInterval
119+
cum_interval: cumInterval,
114120
}) // interval here
115121
.andWhere({
116-
handled: true
122+
handled: true,
117123
})
118124
.andWhere(`pc."banTime" > 0`)
119125
.getMany();

0 commit comments

Comments
 (0)