diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs index 4a0de93..d496270 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,13 @@ mod consts; -mod net; - +mod client; mod protocol; #[macro_use] mod util; +#[macro_use] +extern crate failure; + #[cfg(test)] mod tests; @@ -13,26 +15,31 @@ mod tests; use protocol::primitive::{String, StringList}; use protocol::message::{ClientInit}; -fn main() -> std::io::Result<()> { +use failure::Error; - let mut server = net::connect( +#[tokio::main] +async fn main() -> Result<(), Error> { + + let mut client = client::Client::connect( "localhost", 4242, false, true, - )?; + ).await.unwrap(); let mut features = StringList::new(); features.push("SynchronizedMarkerLine".to_string()); features.push("Authenticators".to_string()); features.push("ExtendedFeatures".to_string()); - let client = ClientInit { + let client_init = ClientInit { client_version:String::from("Rust 0.0.0"), client_date: String::from("1579009211"), feature_list: features, client_features: 0x00008000, }; - server.login("audron", "audron", client); + + client.handler().await?; +// client.login("audron", "audron", client_init); Ok(()) } // the stream is closed here |
