bancho-packets-4.0.0 has been yanked.
bancho-packets
osu! bancho packet Reading & Writing library.
docs https://docs.rs/bancho-packets
Usage
Add to your cargo.toml
[]
= "4"
Or run the following Cargo command in your project directory:
Examples
see more: examples, src/tests.rs
Reading packets
use ;
// Packets from osu! bancho
let data = &;
// Create reader
let mut reader = new;
// Read packets
while let Some = reader.next
/* Results
packet id: OSU_PING: Non-payload
packet id: BANCHO_NOTIFICATION: payload: Some("Hello, World!💖")
packet id: OSU_PING: Non-payload
packet id: BANCHO_NOTIFICATION: payload: Some("哈哈【😃】")
packet id: BANCHO_ACCOUNT_RESTRICTED: Non-payload
packet id: BANCHO_NOTIFICATION: payload: Some("读取完了!!✨")
*/
Writing packets
use *;
// Single packet
let login_reply_from_server = login_reply;
let serverside_notification = notification;
// Multiple packets with Builder
let packets = new
.add
.add
.add
.add
.add
.add
.build;
Build your own packet
use *;
// Build simple packet
let number_data: i32 = 1;
let packet = packet!
// Complex
Run Test
cargo test
Run Benchmark
cargo bench