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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,6 @@ NaNVR-Launcher
CMakeLists.txt
cmake-build-debug/

*.jks
*.jks

deps/
10 changes: 0 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions nanvr/client_core/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ pub struct ConnectionContext {

fn set_hud_message(event_queue: &Mutex<VecDeque<ClientCoreEvent>>, message: &str) {
let message = format!(
"{NANVR_NAME} v{}\nhostname: {}\nIP: {}\n\n{message}",
*NANVR_VERSION,
"{NANVR_NAME} {}\nhostname: {}\nIP: {}\n\n{message}",
NANVR_VERSION.to_owned(),
Config::load().hostname,
system_info::local_ip(),
);
Expand Down Expand Up @@ -165,7 +165,7 @@ fn connection_pipeline(
dbg_connection!("connection_pipeline: Send stream capabilities");
proto_control_socket
.send(&ClientConnectionResult::ConnectionAccepted {
client_protocol_id: shared::protocol_id_u64(),
client_protocol_id: shared::protocol_id(),
display_name: system_info::platform().to_string(),
server_ip,
streaming_capabilities: Some(
Expand Down
2 changes: 1 addition & 1 deletion nanvr/client_openxr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ libc = "0.2"
ndk-context = "0.1"

[package.metadata.android]
package = "nanvr.client.dev" # Changed for Meta Store
package = "nanvr.client" # Changed for Meta Store
install_location = "auto"
build_targets = ["aarch64-linux-android"]
runtime_libs = "../../deps/android_openxr"
Expand Down
2 changes: 1 addition & 1 deletion nanvr/client_tester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ gui_shared.workspace = true
eframe = { version = "0.31", default-features = false, features = [
"accesskit",
"glow",
"wayland", # Required for Linux support (including CI!)
"wayland", # Required for Linux support (including CI!)
"web_screen_reader",
"x11",
] }
Expand Down
5 changes: 2 additions & 3 deletions nanvr/configuration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use settings_schema::{NumberType, SchemaNode};
use shared::{
ConnectionState, NANVR_VERSION, ToAny,
anyhow::{Result, bail},
semver::Version,
};
use std::{
collections::{HashMap, HashSet},
Expand Down Expand Up @@ -119,7 +118,7 @@ pub struct ClientConnectionConfig {

#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct SessionConfig {
pub server_version: Version,
pub server_version: String,
pub openvr_config: OpenvrConfig,
// The hashmap key is the hostname
pub client_connections: HashMap<String, ClientConnectionConfig>,
Expand All @@ -129,7 +128,7 @@ pub struct SessionConfig {
impl Default for SessionConfig {
fn default() -> Self {
Self {
server_version: NANVR_VERSION.clone(),
server_version: NANVR_VERSION.to_owned(),
openvr_config: OpenvrConfig {
// avoid realistic resolutions, as on first start, on Linux, it
// could trigger direct mode on an existing monitor
Expand Down
10 changes: 3 additions & 7 deletions nanvr/configuration/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1917,11 +1917,7 @@ pub fn session_settings_default() -> SettingsDefault {
},
wired_client_type: ClientFlavorDefault {
Custom: format!("{NANVR_LOW_NAME}.client"),
variant: if shared::is_stable() {
ClientFlavorDefaultVariant::Store
} else {
ClientFlavorDefaultVariant::Github
},
variant: ClientFlavorDefaultVariant::Github,
},
wired_client_autolaunch: true,
web_server_port: 8082,
Expand Down Expand Up @@ -2009,9 +2005,9 @@ pub fn session_settings_default() -> SettingsDefault {
linux_async_reprojection: false,
},
velocities_multiplier: 1.0,
open_setup_wizard: shared::is_stable() || shared::is_nightly(),
open_setup_wizard: true,
new_version_popup: SwitchDefault {
enabled: shared::is_stable(),
enabled: false,
content: NewVersionPopupConfigDefault {
hide_while_version: NANVR_VERSION.to_string(),
},
Expand Down
2 changes: 1 addition & 1 deletion nanvr/dashboard/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ chrono = "0.4"
eframe = { version = "0.31", default-features = false, features = [
"accesskit",
"glow",
"wayland", # Required for Linux support (including CI!)
"wayland", # Required for Linux support (including CI!)
"web_screen_reader",
"x11",
] }
Expand Down
8 changes: 7 additions & 1 deletion nanvr/dashboard/src/dashboard/components/about.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ use gui_shared::theme;
use shared::{NANVR_NAME, NANVR_VERSION};

pub fn about_tab_ui(ui: &mut Ui) {
ui.label(RichText::new(format!("{NANVR_NAME} streamer v{}", *NANVR_VERSION)).size(30.0));
ui.label(
RichText::new(format!(
"{NANVR_NAME} streamer {}",
NANVR_VERSION.to_owned()
))
.size(30.0),
);
ui.add_space(10.0);
ui.hyperlink_to("Visit us on GitHub", "https://github.com/nanvr/NaNVR");
ui.hyperlink_to(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl NewVersionPopup {
ui.add_space(10.0);

ui.vertical(|ui| {
ui.heading(format!("{NANVR_NAME} v{}", self.version));
ui.heading(format!("{NANVR_NAME} {}", self.version));

ui.horizontal(|ui| {
ui.spacing_mut().item_spacing.x = 5.0;
Expand Down
19 changes: 5 additions & 14 deletions nanvr/dashboard/src/data_sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ use net_packets::ServerRequest;
use server_io::ServerSessionManager;
use shared::{
NANVR_HIGH_NAME, NANVR_NAME, NANVR_VERSION, RelaxedAtomic, debug, error, info,
parking_lot::Mutex,
semver::{Version, VersionReq},
warn,
parking_lot::Mutex, warn,
};
use std::{
io::ErrorKind,
Expand Down Expand Up @@ -59,7 +57,7 @@ pub fn clean_session() {

if session_manager.session().server_version != *NANVR_VERSION {
let mut session_ref = session_manager.session_mut();
session_ref.server_version = NANVR_VERSION.clone();
session_ref.server_version = NANVR_VERSION.to_owned();
session_ref.client_connections.clear();
session_ref.session_settings.extra.open_setup_wizard = true;
session_ref
Expand Down Expand Up @@ -157,7 +155,7 @@ impl DataSources {
.as_option()?
.hide_while_version;

VersionReq::parse(&format!(">{version}")).unwrap()
&format!(">{version}")
};

let request_agent: ureq::Agent = ureq::Agent::config_builder()
Expand All @@ -177,12 +175,7 @@ impl DataSources {
.get("tag_name")
.and_then(|v| Some(v.as_str()?.trim_start_matches("v")))?;

let version = version_str.parse::<Version>().ok();

if version
.map(|v| version_requirement.matches(&v))
.unwrap_or(false)
{
if version_requirement == version_str {
let message = version_data
.get("body")
.and_then(|v| v.as_str())
Expand Down Expand Up @@ -402,9 +395,7 @@ impl DataSources {
.header(format!("X-{NANVR_HIGH_NAME}"), "true")
.call()
.ok()
.and_then(|r| {
Version::from_str(&r.into_body().read_to_string().ok()?).ok()
});
.and_then(|r| r.into_body().read_to_string().ok());

let connected = if let Some(version) = maybe_server_version {
// We need exact match because we don't do session extrapolation at the
Expand Down
5 changes: 4 additions & 1 deletion nanvr/dashboard/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ fn main() {
}

eframe::run_native(
&format!("{NANVR_NAME} Dashboard (streamer v{})", *NANVR_VERSION),
&format!(
"{NANVR_NAME} Dashboard (streamer {})",
NANVR_VERSION.to_owned()
),
NativeOptions {
viewport: ViewportBuilder::default()
.with_app_id(format!("{NANVR_LOW_NAME}.dashboard"))
Expand Down
2 changes: 1 addition & 1 deletion nanvr/egui_fonts/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pub const HACK_REGULAR: &[u8] = include_bytes!("../fonts/Hack-Regular.ttf");
pub const UBUNTU_LIGHT: &[u8] = include_bytes!("../fonts/Ubuntu-Light.ttf");
pub const OPENMOJI_BLACK_GLYF: &[u8] = include_bytes!("../fonts/OpenMoji-black-glyf.ttf");
pub const OPENMOJI_BLACK_GLYF: &[u8] = include_bytes!("../fonts/OpenMoji-black-glyf.ttf");
8 changes: 7 additions & 1 deletion nanvr/gui_shared/src/font.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
use egui::{epaint::{self, text::{FontInsert, InsertFontFamily}}, Context, FontData, FontFamily};
use egui::{
Context, FontData, FontFamily,
epaint::{
self,
text::{FontInsert, InsertFontFamily},
},
};
use egui_fonts::{HACK_REGULAR, OPENMOJI_BLACK_GLYF, UBUNTU_LIGHT};

pub fn add_fonts(ctx: &Context) {
Expand Down
4 changes: 2 additions & 2 deletions nanvr/launcher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ anyhow = "1"
eframe = { version = "0.31", default-features = false, features = [
"accesskit",
"glow",
"wayland", # Required for Linux support (including CI!)
"wayland", # Required for Linux support (including CI!)
"web_screen_reader",
"x11",
] }
Expand All @@ -34,4 +34,4 @@ reqwest = { version = "0.12", default-features = false, features = [
serde_json = "1"
tar = "0.4"
tokio = { version = "1", features = ["rt-multi-thread"] }
zip = "2"
zip = "2"
25 changes: 5 additions & 20 deletions nanvr/launcher/src/actions.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
use crate::{
InstallationInfo, Progress, ReleaseChannelsInfo, ReleaseInfo, UiMessage, WorkerMessage,
};
use anyhow::Context;
use flate2::read::GzDecoder;
use futures_util::StreamExt;
use shared::{
NANVR_GH_REPO_PATH, NANVR_LOW_NAME, NANVR_NAME, ToAny, anyhow::Result, semver::Version,
};
use shared::{NANVR_GH_REPO_PATH, NANVR_LOW_NAME, NANVR_NAME, ToAny, anyhow::Result};
use std::{
env,
fs::{self, File},
Expand All @@ -15,6 +12,7 @@ use std::{
process::Command,
sync::mpsc::{Receiver, Sender},
};
use system_info::PACKAGE_NAME;

const APK_NAME: &str = "client.apk";

Expand Down Expand Up @@ -179,25 +177,12 @@ fn install_and_launch_apk(
.find_map(|d| d.serial.clone())
.ok_or(anyhow::anyhow!("Failed to find connected device"))?;

let v = if release.version.starts_with('v') {
release.version[1..].to_string()
} else {
release.version
};
let version = Version::parse(&v).context("Failed to parse release version")?;
let stable = version.pre.is_empty() && !version.build.contains("nightly");
let application_id = if stable {
system_info::PACKAGE_NAME_GITHUB_STABLE
} else {
system_info::PACKAGE_NAME_GITHUB_DEV
};

if wired::commands::is_package_installed(&adb_path, &device_serial, application_id)? {
if wired::commands::is_package_installed(&adb_path, &device_serial, PACKAGE_NAME)? {
worker_message_sender.send(WorkerMessage::ProgressUpdate(Progress {
message: "Uninstalling old APK".into(),
progress: 0.0,
}))?;
wired::commands::uninstall_package(&adb_path, &device_serial, application_id)?;
wired::commands::uninstall_package(&adb_path, &device_serial, PACKAGE_NAME)?;
}

worker_message_sender.send(WorkerMessage::ProgressUpdate(Progress {
Expand All @@ -206,7 +191,7 @@ fn install_and_launch_apk(
}))?;
wired::commands::install_package(&adb_path, &device_serial, &apk_path.to_string_lossy())?;

wired::commands::start_application(&adb_path, &device_serial, application_id)?;
wired::commands::start_application(&adb_path, &device_serial, PACKAGE_NAME)?;

Ok(())
}
Expand Down
5 changes: 2 additions & 3 deletions nanvr/net_packets/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use shared::{
BodySkeleton, ConnectionState, DeviceMotion, LogEntry, LogSeverity, Pose, ViewParams,
anyhow::Result,
glam::{Quat, UVec2, Vec2},
semver::Version,
};
use std::{
collections::HashSet,
Expand Down Expand Up @@ -63,7 +62,7 @@ impl VideoStreamingCapabilities {
#[derive(Serialize, Deserialize)]
pub enum ClientConnectionResult {
ConnectionAccepted {
client_protocol_id: u64,
client_protocol_id: String,
display_name: String,
server_ip: IpAddr,
streaming_capabilities: Option<VideoStreamingCapabilities>,
Expand Down Expand Up @@ -113,7 +112,7 @@ pub struct StreamConfigPacket {

#[derive(Serialize, Deserialize, Clone)]
pub struct StreamConfig {
pub server_version: Version,
pub server_version: String,
pub settings: Settings,
pub negotiated_config: NegotiatedStreamingConfig,
}
Expand Down
14 changes: 4 additions & 10 deletions nanvr/server_core/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,22 +280,16 @@ pub fn handshake_loop(ctx: Arc<ConnectionContext>, lifecycle_state: Arc<RwLock<L
};

let stream_port;
let client_type;
let client_autolaunch;
{
let session_manager_lock = SESSION_MANAGER.read();
let connection = &session_manager_lock.settings().connection;
stream_port = connection.stream_port;
client_type = connection.wired_client_type.clone();
client_autolaunch = connection.wired_client_autolaunch;
}

let status = match wired_connection.setup(
CONTROL_PORT,
stream_port,
&client_type,
client_autolaunch,
) {
let status = match wired_connection.setup(CONTROL_PORT, stream_port, client_autolaunch)
{
Ok(status) => status,
Err(e) => {
error!("{e:?}");
Expand Down Expand Up @@ -540,10 +534,10 @@ fn connection_pipeline(
ClientListAction::SetDisplayName(display_name),
);

if client_protocol_id != shared::protocol_id_u64() {
if client_protocol_id != shared::protocol_id() {
warn!(
"Trusted client is incompatible! Expected protocol ID: {}, found: {}",
shared::protocol_id_u64(),
shared::protocol_id(),
client_protocol_id,
);

Expand Down
Loading