aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 78a4e2b37f7855dffe633e2a205ea1f11f055d29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
mod consts;
mod net;

mod protocol;

#[macro_use]
mod util;

#[cfg(test)]
mod tests;

//use util::Hex;
use protocol::primitive::{String, StringList};
use protocol::message::{ClientInit};

fn main() -> std::io::Result<()> {
    let mut server = net::connect(
        "localhost",
        4242,
        false,
        false,
    )?;

    let mut features = StringList::new();
    features.push("SynchronizedMarkerLine".to_string());
    let client = ClientInit {
        client_version:String::from("Rust 0.0.0"),
        client_date: String::from("1579009211"),
        feature_list: features,
        client_features: 0,
    };
    server.login("audron", "audron", client);

    Ok(())
} // the stream is closed here