open-dis / open-dis-cpp

C++ implementation of the IEEE-1278.1 Distributed Interactive Simulation (DIS) application protocol v6 and v7
BSD 2-Clause "Simplified" License
90 stars 65 forks source link

Inside SystemIdentifier, changeOptions class is incorrect and unneces… #61

Closed semihkurt closed 3 years ago

semihkurt commented 3 years ago

Helloo my friends,

Inside SystemIdentifier, changeOptions class is incorrect and unnecessary to use. I've changed this class as unsigned char as it is 8-bit record.

I've checked none other classes in DIS 7 use ChangeOptions class so I removed it from DIS 7. Also, systemMode marshal size increments 2 byte but it is 8-bit enum so it should be 1 byte.

You can check it with dis6-dis7 comparison doc on Page 28 or search "Change/Options" keyword inside the document for none of the classes use this class.

Authors of ChangeOptions had already mentioned in the header file that "// This is wrong and breaks serialization. See section 6.2.15 aka B.2.41" so deleting maybe the best.

By the way, Inside SystemID class in DIS 6, changeOptions variable is already unsigned char.

leif81 commented 3 years ago

Makes sense to me. Thank-you @semihkurt !