gtker / wow_messages

Auto generated messages for the World of Warcraft network protocol
Apache License 2.0
26 stars 11 forks source link

`bool` implementation is not parse->encode stable #84

Closed kerhong closed 8 months ago

kerhong commented 1 year ago

Currently bool is read as any non 0 value, but written as 1.

This means [5] -> parse_as_bool -> true -> encode -> [1].

Having stable parse->encode would help find other issues with fuzzing (see #83)

from #77

gtker commented 1 year ago

I'm not sure I value a stable parse/encode cycle as much as I value ergonomics for users.

That said, there are facets of this that might be improved with change:

It might be that we should treat only 1 as true and 0 as false and error on any other value, however given how closely aligned the client is with the semantics of C++ where any positive integer is true this might be setting ourselves up for failure.