Files
2026-07-14 00:41:05 +02:00

1.9 KiB
Raw Permalink Blame History

Game Activity

Status: Active Last updated: 2026-07-05

Overview

"Now playing" game detection: Electron foreground-window/process heuristics, RAWG metadata match via signaling server, and P2P game-activity broadcast to peers. Shown on profile cards and room sidebars.

Responsibilities

Layer Owns
game-activity domain Scan loop, confidence scoring, P2P broadcast, user store updates
Electron IPC get-running-process-names, get-active-game-candidate
Signaling server POST /api/games/match (RAWG proxy + miss cache)
P2P game-activity data-channel event

Server API

POST /api/games/match

  • Auth: Public
  • Body: { processNames: string[], candidates?: { processName, score }[] } (bounded list sizes)
  • Response: { game: MatchedGame | null } — RAWG-backed title, cover art, store links

Misses cached in server SQLite (GameMatchMiss) to limit API calls.

Client detection

  • Periodic scan (default 10 s, configurable 560 s in localStorage metoyou_game_scan_interval_ms).
  • Ignores launcher/helper processes via IGNORED_PROCESS_NAMES and regex patterns.
  • Electron: suppresses scan when MetoYou window is focused; prefers foreground-window candidate from get-active-game-candidate.
  • Browser/Capacitor: no process scan — activity only from P2P peers.

P2P event

{ "type": "game-activity", "activity": { "game", "startedAt", "processName", ... } }

Peers merge into User.gameActivity in NgRx store.

Changelog

Date Change
2026-07-05 Initial cross-context game-activity contract