From c1a5ef41086de9de60d808994aecc3e2355d6b62 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 20 Sep 2020 22:23:46 +0200 Subject: [PATCH] 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. --- common/TracyProtocol.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/TracyProtocol.hpp b/common/TracyProtocol.hpp index 1a2c7ea5..7bb19835 100644 --- a/common/TracyProtocol.hpp +++ b/common/TracyProtocol.hpp @@ -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]; };