Reduce broadcast message size by 4 bytes.

Note that this is compatible with previous clients, which will never get
values 0 or 1 in the 32-bit integer that is now split between
broadcastVersion and listenPort.
This commit is contained in:
Bartosz Taudul 2020-09-20 22:23:46 +02:00
parent 593ce74042
commit c1a5ef4108

View File

@ -10,7 +10,7 @@ namespace tracy
constexpr unsigned Lz4CompressBound( unsigned isize ) { return isize + ( isize / 255 ) + 16; }
enum : uint32_t { ProtocolVersion = 40 };
enum : uint32_t { BroadcastVersion = 2 };
enum : uint16_t { BroadcastVersion = 2 };
using lz4sz_t = uint32_t;
@ -108,9 +108,9 @@ enum { OnDemandPayloadMessageSize = sizeof( OnDemandPayloadMessage ) };
struct BroadcastMessage
{
uint32_t broadcastVersion;
uint16_t broadcastVersion;
uint16_t listenPort;
uint32_t protocolVersion;
uint32_t listenPort;
int32_t activeTime; // in seconds
char programName[WelcomeMessageProgramNameSize];
};