Expand description
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.
Structs§
- Frame
Content Size - A frame content length proven to fit in the protocol’s 15-bit wire field.
- Silkroad
Codec - A codec to read and write SilkroadFrame from/onto a byte stream. This implements Encoder and Decoder to be used in combination with tokio framed read/write. Essentially, this wraps the SilkroadFrame::serialize and SilkroadFrame::parse functions to serialize and deserialize the frames.
Enums§
- Frame
Encode Error - An error encountered while encoding a
SilkroadFrame. - Frame
Parse Error - An error encountered while parsing bytes into a
SilkroadFrame. - Silkroad
Frame - A ‘frame’ denotes the most fundamental block of data that can be sent between the client and the server in Silkroad Online. Any and all operations or data exchanges are built on top of something like a frame.
Constants§
- MASSIVE_
CONTAINER_ MODE - Mode byte identifying a massive packet data container.
- MASSIVE_
HEADER_ MODE - Mode byte identifying a massive packet header.
- MASSIVE_
PACKET_ OPCODE - Opcode reserved for massive packet headers and containers.
- MAX_
FRAME_ CONTENT_ SIZE - The largest content length representable without setting the encrypted-frame flag.
- MAX_
MASSIVE_ CONTAINER_ INNER_ SIZE - The largest payload a massive container can carry after its one-byte mode field.