started work on writing the tool, its not quite ready yet, but we're

getting close.
This commit is contained in:
pyro57000
2025-11-14 16:53:06 -06:00
parent 47d6ed5556
commit 1a72bcee98
30 changed files with 2248 additions and 0 deletions

17
src/network.rs Normal file
View File

@@ -0,0 +1,17 @@
use tokio;
use std::{io::Write, net::TcpStream};
use crate::print_error;
pub async fn send_to_server(input: String, address: String) -> Option<String>{
let connect_res = TcpStream::connect(address);
if connect_res.is_err(){
print_error("error connection to server", Some(connect_res.err().unwrap().to_string()));
return Some(String::from("failed to connect to server!"));
}
let mut stream = connect_res.unwrap();
let server_send_line = format!("1|||command|||0|||{}", input);
stream.write(server_send_line.as_bytes()).unwrap();
return None;
}