19 releases (5 breaking)

Uses old Rust 2015

0.6.2 Jan 24, 2018
0.6.1 Jan 13, 2018
0.5.5 Jan 4, 2018
0.4.0 Dec 27, 2017
0.1.4 Nov 26, 2017

#67 in #client-side

Custom license

25KB
544 lines

synac-rs Crates.io

A client side library for synac.

Example

extern crate synac;

use synac::{Session, State};

fn main() {
    // TODO: Error checking
    let mut session = Session::new(env!("ADDR"), env!("HASH")).unwrap();
    session.login_with_token(true, env!("USERNAME"), env!("TOKEN")).unwrap(); // true specifies it's a bot account

    // First packet should be either LoginSuccess or an error
    let result = session.read().unwrap();
    // TODO: Use result

    let mut state = State::new();
    loop {
        let packet = session.read().unwrap();
        state.update(&packet);

        // TODO: Use packet
    }
}

Dependencies

~2.3–4.5MB
~91K SLoC