Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions crates/openplay-receiver/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ mod app;
mod window;

use clap::Parser;
use tracing::info;
use tracing::{info, warn};

/// OpenPlay Receiver — Display incoming screen casts.
#[derive(Parser, Debug)]
Expand All @@ -12,11 +12,18 @@ struct Args {
#[arg(long)]
config: Option<std::path::PathBuf>,

/// Override display name (shown in mDNS discovery).
/// Override display name (shown in the receiver window).
///
/// This does *not* affect discovery: the receiver does not advertise
/// itself over mDNS yet, so no sender can find it by name.
#[arg(long)]
name: Option<String>,

/// Override signaling port.
/// Override signaling port. Reserved — has no effect yet.
///
/// The receiver does not open a socket, so nothing binds this port. It is
/// accepted and validated so the flag keeps working once the signaling
/// server is wired up.
#[arg(long)]
port: Option<u16>,
}
Expand All @@ -36,6 +43,13 @@ fn main() -> anyhow::Result<()> {
config.display_name = name.clone();
}
if let Some(port) = args.port {
// Validated and stored, but nothing binds it: the receiver has no
// signaling server yet. Say so rather than letting the flag imply the
// receiver is reachable on that port.
warn!(
port,
"--port has no effect yet: this receiver does not listen for connections"
);
config.port = port;
}

Expand Down
21 changes: 18 additions & 3 deletions crates/openplay-receiver/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ impl ReceiverWindow {
Self { config }
}

/// The page shown while no sender is connected.
/// The page shown while the receiver cannot yet be reached.
///
/// This deliberately does not say "waiting for a sender" or "listening on
/// port N". Neither was ever true: the receiver opens no socket and
/// advertises no mDNS service, so a sender cannot discover it or connect to
/// it. Claiming otherwise sent at least one person debugging their network
/// for a feature that does not exist.
///
// TODO: Phase 1 — once the receiver pipeline is wired up, swap this for the
// decoded video frames and go fullscreen when a sender connects.
Expand All @@ -27,10 +33,19 @@ impl ReceiverWindow {
ui.add_space(ui.available_height() * 0.25);
ui.heading(&self.config.display_name);
ui.add_space(8.0);
ui.label("Waiting for a sender to connect...");
ui.label("Not reachable yet — this receiver is a placeholder.");
ui.add_space(16.0);
ui.label(
RichText::new(format!("Listening on port {}", self.config.port))
RichText::new(
"It does not advertise itself over mDNS and accepts no\n\
connections, so senders cannot discover or reach it.",
)
.color(Color32::GRAY),
);
ui.add_space(8.0);
ui.label(
RichText::new("Tracking: Developer1010x/openplay#11")
.small()
.color(Color32::GRAY),
);
});
Expand Down
Loading