Compare commits

...

1 commit

Author SHA1 Message Date
Nickiel12
b57633b89a feat!: doesn't hardcode host ip 2022-11-05 14:28:48 -07:00
3 changed files with 7 additions and 13 deletions

View file

@ -18,7 +18,8 @@
"windows":{ "windows":{
"obs_re": "OBS *", "obs_re": "OBS *",
"propresenter_re": "ProPresenter - .*", "propresenter_re": "ProPresenter - .*",
"chrome_re": ".* - Google Chrome" "chrome_re": ".* - Google Chrome",
"tcp_port": "8005"
}, },
"hotkeys":{ "hotkeys":{
"obs":{ "obs":{

View file

@ -10,24 +10,17 @@ use crate::modules::stream_states::state_update::StateUpdate;
mod tests; mod tests;
mod modules; mod modules;
#[cfg(target_os = "windows")] const SERVER_ADDRESS: &str = "0.0.0.0:";
const SERVER_ADDRESS: &str = "10.0.0.114:5000";
#[cfg(release)]
#[cfg(target_os = "windows")]
const SERVER_ADDRESS: &str = "10.0.0.209:5000";
#[cfg(target_os = "linux")]
const SERVER_ADDRESS: &str = "10.0.0.168:5000";
fn main() { fn main() {
let settings_json = load_json(); let settings_json = load_json();
let hotkeys = Hotkeys::new(settings_json); let hotkeys = Hotkeys::new(settings_json.clone());
let (from_socket_tx, from_socket_rx) = unbounded::<String>(); let (from_socket_tx, from_socket_rx) = unbounded::<String>();
let hotkey_channel_tx = from_socket_tx.clone(); let hotkey_channel_tx = from_socket_tx.clone();
let mut socket = Socket::handle_connections(Socket::make_listener(SERVER_ADDRESS), from_socket_tx); println!("Opening on port: {}", settings_json["windows"]["tcp_port"]);
let mut socket = Socket::handle_connections(Socket::make_listener((String::from(SERVER_ADDRESS) + &settings_json["windows"]["tcp_port"].to_string()).as_str()), from_socket_tx);
let (hotkey_close_flag_tx, hotkey_close_flag_rx) = sync_flag::new_syncflag(true); let (hotkey_close_flag_tx, hotkey_close_flag_rx) = sync_flag::new_syncflag(true);
let control_c_called_flag_rx = setup_control_c(hotkey_close_flag_tx); let control_c_called_flag_rx = setup_control_c(hotkey_close_flag_tx);

View file

@ -30,7 +30,7 @@ pub fn create_keyboard_hooks(channel_tx: crossbeam_channel::Sender<String>, clos
tx_2.send(StateUpdate::ChangeSlide(SlideChange::NextHotkey).to_json().to_string()).unwrap(); tx_2.send(StateUpdate::ChangeSlide(SlideChange::NextHotkey).to_json().to_string()).unwrap();
}); });
inputbot::handle_input_events(close_flag); inputbot::handle_input_events();
} }
#[cfg(feature = "no_hotkeys")] #[cfg(feature = "no_hotkeys")]