Closed bundabrg closed 4 years ago
I've noticed that the flags are set and retrieved different in the serializer/deserializer.
When deserializing the flags are set using:
for (int i = 0; i < 8; i++) { if (((flagsByte >>> i) & 0xf) != 0) { flags.add(CommandData.Flag.values()[i]); } }
When serializing:
for (CommandData.Flag flag : commandData.getFlags()) { flags |= 1 << flag.ordinal(); }
Serializing will set the bits of each flag to 1. So if its value is 3 then the 3rd bit is set.
Deserializing will set a flag and every flag below its position to 1 (due to the & 0xf and the !=0).
Fixed in 2.6.0-SNAPSHOT
2.6.0-SNAPSHOT
I've noticed that the flags are set and retrieved different in the serializer/deserializer.
When deserializing the flags are set using:
When serializing:
Serializing will set the bits of each flag to 1. So if its value is 3 then the 3rd bit is set.
Deserializing will set a flag and every flag below its position to 1 (due to the & 0xf and the !=0).