bzflag icon indicating copy to clipboard operation
bzflag copied to clipboard

Unify Team/Flag/Shot/PlayerID types

Open blast007 opened this issue 6 years ago • 2 comments

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)

blast007 avatar May 15 '18 11:05 blast007

Should flags really be 4 bytes? I'd argue for 2 bytes there as well.

timriker avatar May 15 '18 15:05 timriker

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.

JeffM2501 avatar May 15 '18 17:05 JeffM2501