Skip to content

Commit

Permalink
add anticheat information to the log file if there is anticheat infor…
Browse files Browse the repository at this point in the history
…mation to be found
  • Loading branch information
RawToast225 committed Nov 19, 2024
1 parent 47b0389 commit 7240bb4
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 7240bb4

Please sign in to comment.