bzflag
bzflag copied to clipboard
Unify Team/Flag/Shot/PlayerID types
Currently different messages use different sizes for IDs, even of the same type. All IDs should be made consistent.
Team and Player IDs should be unsigned 2 byte shorts. Flag and ShotIDs should be unsigned 4 byte longs.
(From @JeffM2501)
Should flags really be 4 bytes? I'd argue for 2 bytes there as well.
Yes 4 bytes because we have plans to change how IDs are allocated. They will no longer be simply per player, but global IDs. 4 bytes gives more room before rollover. This allows for the server to create more shots (world weapons and custom flags like a triple shot).
The messages are not near the packet limit, so having the headroom is not an issue.