[TEST] add data sync

This commit is contained in:
olcxja 2026-10-01 14:18:15 +02:00
commit 8e3512b5cd
16 changed files with 1935 additions and 5 deletions

View file

@ -4,11 +4,12 @@ const { app } = require('electron')
const { ensureDirs, DIRS } = require('./paths')
const i18n = require('./i18n')
const wines = require('./wines')
const { registerIpc } = require('./ipc')
const { registerIpc, sendToWindow } = require('./ipc')
const { createMainWindow } = require('./window')
const { setAppIcon } = require('./appicon')
const { parseArgv } = require('./argv')
const openwith = require('./openwith')
const lansync = require('./lansync')
const path = require('path')
const fs = require('fs')
@ -232,6 +233,14 @@ app.whenReady().then(async () => {
const { games } = registerIpc({ getWindow, onGamesChanged: rebuildTrayMenu })
gamesService = games
// LAN sync runs whenever the launcher runs - that is what makes this
// device show up on the other machines' client lists
lansync.start({
onDevices: devices => sendToWindow(win, 'lansync:devices', devices),
onApplied: info => sendToWindow(win, 'lansync:applied', info),
isBusy: () => !!(gamesService && gamesService.listRunning().length)
})
createTray()
if (headless) {
@ -250,4 +259,5 @@ app.whenReady().then(async () => {
app.on('before-quit', () => {
quitting = true
lansync.stop()
})