Open vE5li opened 3 months ago
I can see this being used to communicate with RO using WebSocket (jokes) 😆
I don't think this is quite as simple as suggested.
serde
only supports arrays of up to [_; 32]
. In other words, any arrays with N > 32
means defining a new struct that implements Serialize, Deserialize
, in addition to e.g.:
ElementDisplay
PrototypeElement
As an example, see ragnarok_packets/lib.rs::struct CharacterSelectionPacket
and CharacterServerInformation
.
Still a good issue, but you probably want some familiarity with serde
before tackling it.
Good point!
To be honest I thought serde
would have moved to using const generics by now. I will link an issue providing a possible solution and an explainiation as to why it's a problem in the first place.
There is currently no use case for this but I can imagine something like converting the packets to JSON for debugging or data collection, and there is really no reason the packets shouldn't implement Serde traits.
This ticket is pretty easy, just a bit of manual labor (much less when using a good Regex I assume).