You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the packet are just a big enum serialized as-is which limits the way we can craft packet.
For example it's hard to have packet with conditional data.
You could use an Option at the moment but :
if things get's nested heavily it's gonna be unreadable
if the packet contains a hundred conditional fields like the EntityUpdate will contains later (sending only changed fields), the packet will be twice the size it needs to be because of the way the serializer works with enums, and given the frequency and size of EntityUpdate, it's really bad.
A good idea would be to separate thing out like this :
A packet struct containing the pure data
A packet serializer/deserializer (which could use the
A packet handler to fill/do things with the pure data
The text was updated successfully, but these errors were encountered:
Interestingly, I believe Serde only serializes the exact enum variant required. If an enum variant requires less data than others to store, Serde will only store the minimum necessary to do so. More information here: serde-rs/serde#251
This would suggest that using serialized enums to send data is still relatively efficient.
Currently the packet are just a big enum serialized as-is which limits the way we can craft packet.
For example it's hard to have packet with conditional data.
You could use an Option at the moment but :
A good idea would be to separate thing out like this :
The text was updated successfully, but these errors were encountered: