Add missing derives, `favicon` field and new `Packet` struct.
- Derive
Debugfor every struct. - Add missing
faviconfield forServerStatus. - Add
Packetstruct to decode full packets.
Do you have an example for how this works?
I've bodged together packet reading/writing with compression support here:
https://github.com/timvisee/lazymc/blob/0c69752fecdc4ad95d2c5c96c3fd37f72ea11d70/src/proto/packet.rs#L18-L235
My implementation handles compression, but no encryption though.
In the login stage, the server may send a SetCompression(n) packet after which compression should be enabled if the packet payload is >= n bytes.
Read more about compression here: https://wiki.vg/Protocol#Packet_format
Thanks @timvisee, I will have a look, your “Lobby” feature looks very interesting.
For my use case (a Kubernetes game server proxy for auto-scaling, pretty similar to your lazymc project actually) I didn't need compression/encryption support since the only thing I need to know is whether a login packet has been received, after that everything else is forwarded as is to the upstream server.
Okay, looking at @timvisee's implementation, this Packet struct with its Decoder implementation could replace the read_packet_id_data function. Maybe calling it UncompressedPacket makes more sense then?
Okay, I renamed the Packet to RawPacket and also added structs for CompressedRawPacket and UncompressedRawPacket to support both compressed and uncompressed packets.
@vaIgarashi, can you have another look?