Add server list persistence and UDP ping to platform trait
Add ServerEntry model, load_servers/save_servers/set_default_server to PlatformInterface with implementations for desktop (etcetera config), web (localStorage), mobile (stub), and stub platforms. Implement mumble_udp_ping protocol on desktop for direct server status queries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+20
-1
@@ -3,7 +3,7 @@
|
||||
use crate::{app::SharedState, effects::AudioProcessor};
|
||||
use color_eyre::eyre::Error;
|
||||
use dioxus::hooks::UnboundedReceiver;
|
||||
use mumble_web2_common::{ProxyOverrides, ServerStatus};
|
||||
use mumble_web2_common::{ProxyOverrides, ServerEntry, ServerStatus};
|
||||
use std::future::Future;
|
||||
|
||||
pub struct StubPlatform;
|
||||
@@ -36,10 +36,29 @@ impl super::PlatformInterface for StubPlatform {
|
||||
async { panic!("stubbed platform") }
|
||||
}
|
||||
|
||||
fn ping_server(
|
||||
_address: &str,
|
||||
_port: u16,
|
||||
) -> impl Future<Output = color_eyre::Result<ServerStatus>> {
|
||||
async { panic!("stubbed platform") }
|
||||
}
|
||||
|
||||
fn load_proxy_overrides() -> impl Future<Output = color_eyre::Result<ProxyOverrides>> {
|
||||
async { panic!("stubbed platform") }
|
||||
}
|
||||
|
||||
fn set_default_server(_server: &str) -> Option<()> {
|
||||
panic!("stubbed platform")
|
||||
}
|
||||
|
||||
fn load_servers() -> Vec<ServerEntry> {
|
||||
panic!("stubbed platform")
|
||||
}
|
||||
|
||||
fn save_servers(_servers: &[ServerEntry]) {
|
||||
panic!("stubbed platform")
|
||||
}
|
||||
|
||||
fn sleep(_duration: std::time::Duration) -> impl Future<Output = ()> {
|
||||
async { panic!("stubbed platform") }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user