Skip to content

A games launcher for GOG, Amazon and Epic Games for Linux, Windows and macOS.

774 B
Raw Blame
import { backendEvents } from 'backend/backend_events'
import { addHandler } from '../ipc'
import { downloadAntiCheatData, gameAnticheatInfo } from './utils'
import { isMac, isWindows } from 'backend/constants/environment'
import { logDebug, LogPrefix } from 'backend/logger'

// we use the game's `namespace` value here, it's the value that can be easily fetch by AreWeAnticheatYet
addHandler('getAnticheatInfo', async (e, appNamespace) =>
  gameAnticheatInfo(appNamespace)
)

backendEvents.on('releasesInfoReady', (releasesInfo) => {
  if (isWindows) return

  logDebug('Releases info ready, checking anticheat data', LogPrefix.Backend)
  void downloadAntiCheatData(
    isMac
      ? releasesInfo.anticheatFiles.shaMac
      : releasesInfo.anticheatFiles.shaLinux
  )
})