skrillax_stream/
lib.rs

1//! Provides convenient abstractions for handling streams of Silkroad Online
2//! packets.
3//!
4//! While it is possible to simply use the abstractions provided by more lover
5//! level crates of the stack, such as simply using [skrillax_packet] and
6//! [skrillax_codec], it can become quite cumbersome. In particular, when
7//! dealing with lots of different packets it might be easier to create logical
8//! groupings of packets: protocols.
9//!
10//! Protocols are essentially just a collection of packets and possibly other
11//! protocols that allow reading and writing a single type instead of handling
12//! all possible cases manually.
13//!
14//! It is expected that you'll be using a [tokio::net::TcpStream] for the
15//! connection such that you can create a Silkroad stream from by calling
16//! [stream::SilkroadTcpExt::into_silkroad_stream]. With the resulting
17//! [stream::SilkroadStreamRead] and [stream::SilkroadStreamWrite], you can now
18//! read packets using [stream::SilkroadStreamRead::next_packet]
19//! and write packets using [stream::SilkroadStreamWrite::write_packet].
20//!
21//! On top of the provided stream abstraction, this provides a way to handle the
22//! security handshake through [handshake::ActiveSecuritySetup] and
23//! [handshake::PassiveSecuritySetup] for the server point of view and the
24//! client respectively.
25
26pub mod handshake;
27pub mod stream;
28
29pub mod packet {
30    pub use skrillax_packet::*;
31}
32pub use stream::InputProtocol;