set netplay id from environment (#606)

This commit is contained in:
Logan McNaughton
2025-11-04 08:27:32 +01:00
committed by GitHub
parent ab630cc8cb
commit 002fbbe8a4
2 changed files with 6 additions and 3 deletions
+3
View File
@@ -193,5 +193,8 @@ fn main() {
let git_hash = String::from_utf8(git_output.stdout).unwrap();
println!("cargo:rustc-env=GIT_HASH={git_hash}");
let netplay_id = std::env::var("NETPLAY_ID").unwrap_or("gopher64".to_string());
println!("cargo:rustc-env=NETPLAY_ID={netplay_id}");
println!("cargo:rustc-env=N64_STACK_SIZE={}", 8 * 1024 * 1024);
}
+3 -3
View File
@@ -111,7 +111,7 @@ impl NetplayPages for NetplayJoin {
fn populate_server_names<T: ComponentHandle + NetplayPages + 'static>(weak: slint::Weak<T>) {
let task = reqwest::Client::new()
.get("https://dispatch.gopher64.com/getRegions")
.header("netplay-id", EMU_NAME)
.header("netplay-id", env!("NETPLAY_ID"))
.send();
tokio::spawn(async move {
let mut local_servers: Vec<(String, String)> = vec![];
@@ -296,7 +296,7 @@ pub fn setup_create_window(
let task = reqwest::Client::new()
.get("https://dispatch.gopher64.com/createServer")
.query(&[("region", server_url.strip_prefix("dispatcher:").unwrap())])
.header("netplay-id", EMU_NAME)
.header("netplay-id", env!("NETPLAY_ID"))
.send();
let netplay_read_sender = netplay_read_sender.clone();
let netplay_write_receiver = netplay_write_receiver.resubscribe();
@@ -448,7 +448,7 @@ fn show_netplay_error(message: String) {
fn update_sessions(weak: slint::Weak<NetplayJoin>) {
let task = reqwest::Client::new()
.get("https://dispatch.gopher64.com/getServers")
.header("netplay-id", EMU_NAME)
.header("netplay-id", env!("NETPLAY_ID"))
.send();
tokio::spawn(async move {
let mut dispatcher_servers = std::collections::HashMap::new();