Steps 5-6 of game detection. BREAKING wire change — bump everyone. Wire (step 5): - PeerState.game: Option<String> (display label only — never appid/source). - SelfPresence.game + to_state carry it (single self-state builder). - GOSSIP_PROTO 2->3, GOSSIP_SIG_DOMAIN v3, version comment bumped together; Cargo MINOR 0.3.0 -> 0.4.0 per VERSIONING.md. v2/v3 isolate into different topics + signature domains, so a coordinated redeploy is required (same as the W4 avatar bump). - Gossip ingest sanitizes incoming game via sanitize_game_label (bidi/ control strip, 64-char/256-byte cap); empty -> None. - Bonus security fix (Codex find): reject inbound gossip frames over a 128KB cap BEFORE serde_json::from_slice — a legit Announce with a full 48KB avatar is ~49KB, so this bounds allocation abuse with headroom. Core wiring: - Spawns the detector at startup; consumes its watch channel in the main select. Detection runs continuously (for the local background); the broadcast is gated by game_presence_enabled (opt-in, default OFF). New commands: SetGamePresenceEnabled (immediate publish/clear, D8), SetGameOverride, SetGameProcessMap. New event: GameChanged. - game_presence_label sanitizes the outgoing label too. Background switch (step 6): - GUI handles GameChanged: stores current_game, swaps background to the per-game override (config.game_backgrounds[id]) or falls back to the W16 default; reuses the existing cached-handle path (no redraw flicker). 397 lib tests (all green), clippy --all-targets clean, full binary builds. Remaining: step 7 UI (opt-in toggle, roster 'Playing' text, manual override control, Settings game-backgrounds + process-map editors). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
77 lines
2.8 KiB
TOML
77 lines
2.8 KiB
TOML
[package]
|
|
name = "peerspeak"
|
|
version = "0.4.0"
|
|
edition = "2024"
|
|
# Application crate, not a crates.io library — refuse `cargo publish` and let
|
|
# cargo-deny's [licenses.private] skip the missing-license check.
|
|
publish = false
|
|
|
|
[lib]
|
|
name = "peerspeak"
|
|
path = "src/lib.rs"
|
|
|
|
[[bin]]
|
|
name = "peerspeak"
|
|
path = "src/main.rs"
|
|
|
|
[[bin]]
|
|
name = "test_net"
|
|
path = "src/bin/test_net.rs"
|
|
|
|
[[bin]]
|
|
name = "specview"
|
|
path = "src/bin/specview.rs"
|
|
|
|
[dependencies]
|
|
anyhow = "1.0.102"
|
|
async-trait = "0.1.89"
|
|
base64 = "0.22.1"
|
|
bytes = "1.11.1"
|
|
dirs = "6.0.0"
|
|
iced = { version = "0.14.0", features = ["canvas", "image", "tokio"] }
|
|
# W4 custom avatars: decode/resize an arbitrary user image (png/jpeg only to keep
|
|
# the codec surface small). The matching native file picker (`rfd`) is platform-
|
|
# gated below — its backend differs per OS (xdg-portal on Linux, Win32 on Windows).
|
|
image = { version = "0.25", default-features = false, features = ["png", "jpeg"] }
|
|
iroh = "1.0.0-rc.0"
|
|
iroh-gossip = "0.99.0"
|
|
opus = "0.3.1"
|
|
rand = "0.10.1"
|
|
ringbuf = "0.5.0"
|
|
rodio = "0.22.2"
|
|
serde = { version = "1.0.228", features = ["derive"] }
|
|
serde_json = "1.0.150"
|
|
thiserror = "2.0.18"
|
|
tokio = { version = "1.52.3", features = ["full"] }
|
|
tokio-stream = "0.1.18"
|
|
|
|
# --- Platform-specific dependencies -----------------------------------------
|
|
# Audio and the native file-picker backends differ per OS. Everything else in the
|
|
# app talks to the `AudioBackend` trait and the `PlatformAudioBackend` alias (see
|
|
# `src/audio/mod.rs`), so platform selection is confined to these few lines.
|
|
|
|
[target.'cfg(target_os = "linux")'.dependencies]
|
|
# Linux audio backend. v0_3_49 exposes `Buffer::requested()` (the graph's per-cycle
|
|
# quantum), used by the playback RT callback to fill exactly what the device asks
|
|
# for instead of a hard-coded 1024-frame quantum (crackle on non-1024 hardware).
|
|
# The field has existed in libpipewire since 0.3.49 (2022).
|
|
pipewire = { version = "0.9", features = ["v0_3_49"] }
|
|
# Native file picker via the XDG desktop portal (no GTK) on Linux.
|
|
rfd = { version = "0.17", default-features = false, features = ["xdg-portal"] }
|
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
# Native file picker using the built-in Win32 dialog backend on Windows.
|
|
rfd = { version = "0.17", default-features = false }
|
|
# Windows audio backend: cpal drives WASAPI for capture/playback behind the
|
|
# AudioBackend trait (src/audio/cpal_impl.rs). The Linux counterpart is pipewire.
|
|
cpal = "0.15"
|
|
# Win32 FFI for game detection (no new crate: windows-sys is already pulled in
|
|
# transitively by cpal/rfd). Registry reads the Steam RunningAppID + install path;
|
|
# Toolhelp enumerates running processes for the non-Steam process-scan fallback.
|
|
windows-sys = { version = "0.61", features = [
|
|
"Win32_Foundation",
|
|
"Win32_System_Registry",
|
|
"Win32_System_Diagnostics_ToolHelp",
|
|
"Win32_System_Threading",
|
|
] }
|