diff --git a/config.toml b/config.toml index dd57618..b812cc9 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,3 @@ [[mapping]] event = "/avatar/parameters/MuteSelf" key = "F24" - -[server] -port = 9090 \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 97f1e19..536af2c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,7 +93,7 @@ fn load_config() -> Result { // If the config file isn't found, create one with default values if !std::path::Path::new("config.toml").exists() { let default_config = Config { - server: Some(ServerConfig { port: 9000 }), + server: Some(ServerConfig { port: 9001 }), mappings: vec![], }; let toml = toml::to_string_pretty(&default_config).map_err(|e| e.to_string())?; @@ -104,7 +104,7 @@ fn load_config() -> Result { let mut config: Config = toml::from_str(&config_file).map_err(|e| e.to_string())?; // Provide a default ServerConfig if one is not set. if config.server.is_none() { - config.server = Some(ServerConfig { port: 9000 }); + config.server = Some(ServerConfig { port: 9001 }); } Ok(config) } @@ -112,11 +112,6 @@ fn load_config() -> Result { fn handle_packet(packet: OscPacket, mappings: &HashMap) { match packet { OscPacket::Message(msg) => { - // Print message - println!("OSC Message: {:?}", msg); - // Print address - println!("OSC Address: {}", msg.addr); - // Match event to key let reaction = match mappings.get(&msg.addr) { Some(k) => k, None => { @@ -124,7 +119,6 @@ fn handle_packet(packet: OscPacket, mappings: &HashMap) { } }; if reaction.value.is_some() { - // If the event has a value, check if the value matches the value in the config if msg.args.len() != 1 { return; }