#codec #silkroad #frame #online #networking #stream #packets

skrillax-codec

A framing codec for Silkroad Online network packets

2 releases

0.1.1 Apr 28, 2024
0.1.0 Apr 21, 2024

#702 in Encoding

Download history 100/week @ 2024-04-18 156/week @ 2024-04-25 11/week @ 2024-05-02

267 downloads per month
Used in skrillax-packet

MIT license

21KB
353 lines

skrillax-codec

Crates.io Docs.rs

skrillax-codec is part of the skrillax-network family of crates for handling the network part of communication between a Silkroad Online client and/or server. This crate specifically deals with partitioning a byte stream into individual frames which can then be handled by a higher layer.

Documentation

For documentation, please see the docs.rs page.

License

Like the rest of the skrillax-network crates, this crate is licensed under the MIT license.


lib.rs:

skrillax-codec is a crate to turn a raw stream of bytes into more meaningful frames in the format used by Silkroad Online. Framing is only the first step, as a frame is still quite a general object and does itself not provide many operations. Instead, operations are contained inside frames and will need to be decoded/encoded separately.

This crate provides two things: the [SilkroadFrame] and [SilkroadCodec]. The latter, [SilkroadCodec], is expected to be used in combination with tokio's tokio_util::codec::FramedWrite & tokio_util::codec::FramedRead. It uses the former, [SilkroadFrame], as the type it produces. However, it is totally possible to use this crate without using the codec by using the [SilkroadFrame]'s serialization and deserialization functions.

Dependencies

~0.2–1.3MB
~21K SLoC