feat: add saving client settings to file

This commit is contained in:
2026-08-18 22:08:15 +02:00
parent 894c4c1cfb
commit a6cc7109b3
5 changed files with 45 additions and 19 deletions

View File

@@ -21,14 +21,9 @@ use crate::{
},
network_identity::NetworkIdentity,
},
settings::{client_settings::ClientSettings, general_settings::SettingsLike},
};
#[derive(Clone)]
pub struct ClientSettings {
server_url: SocketAddr,
name: String,
}
pub enum ClientCommands {
SendCapture(CapturePath),
SendMove { from: Position, to: Position },
@@ -64,10 +59,7 @@ pub struct Client {
impl Client {
pub async fn new() -> Option<Client> {
let settings = ClientSettings {
server_url: SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 6767),
name: "Morbius".into(),
};
let settings = ClientSettings::new();
let (conn_sender, conn_reciever) =
mpsc::channel::<(SocketAddr, Message<ServerMessage>)>(1024);