Skip to content

Commit

Permalink
[FEAT] Add anticheat information to the log file if there is antichea…
Browse files Browse the repository at this point in the history
…t infor… (#4128)

add anticheat information to the log file if there is anticheat information to be found

remove elint error in shortcuts.ts
  • Loading branch information
RawToast225 authored Feb 25, 2025
1 parent c6dfbfb commit 2d682a0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/backend/logger/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { gamesConfigPath, isWindows } from 'backend/constants'
import { gameManagerMap } from 'backend/storeManagers'
import { existsSync, mkdirSync, openSync } from 'graceful-fs'
import { Winetricks } from 'backend/tools'
import { gameAnticheatInfo } from 'backend/anticheat/utils'

export enum LogPrefix {
General = '',
Expand Down Expand Up @@ -510,12 +511,22 @@ class GameLogWriter extends LogWriter {
const gameSettings = await gameManagerMap[runner].getSettings(app_name)
const gameSettingsString = JSON.stringify(gameSettings, null, '\t')
const startPlayingDate = new Date()
// log anticheat info
const antiCheatInfo = gameAnticheatInfo(this.gameInfo.namespace)

await appendFile(
this.filePath,
`Game Settings: ${gameSettingsString}\n\n`
)

if (antiCheatInfo != null) {
await appendFile(
this.filePath,
`Anticheat Status: ${antiCheatInfo.status}\n` +
`Anticheats: ${JSON.stringify(antiCheatInfo.anticheats)}\n\n`
)
}

await appendFile(
this.filePath,
`Game launched at: ${startPlayingDate}\n\n`
Expand Down

0 comments on commit 2d682a0

Please sign in to comment.