diff --git a/src/jazzlights/network/network.h b/src/jazzlights/network/network.h index db9542f..f3881b6 100644 --- a/src/jazzlights/network/network.h +++ b/src/jazzlights/network/network.h @@ -94,6 +94,8 @@ struct NetworkMessage { Milliseconds currentPatternStartTime = 0; Milliseconds lastOriginationTime = 0; // Receipt values are not sent over the wire. + // Note that, when sending, `receiptNetworkId` and `receiptNetworkType` represent + // the network where our followed next hop is; or 0 / kLeading if we are leading. NetworkId receiptNetworkId = 0; NetworkType receiptNetworkType = NetworkType::kLeading; std::string receiptDetails; diff --git a/src/jazzlights/player.cpp b/src/jazzlights/player.cpp index d498f55..2d99dbe 100644 --- a/src/jazzlights/player.cpp +++ b/src/jazzlights/player.cpp @@ -769,8 +769,10 @@ void Player::checkLeaderAndPattern(Milliseconds currentTime) { messageToSend.precedence = precedence; messageToSend.lastOriginationTime = lastOriginationTime; messageToSend.numHops = currentNumHops_; + messageToSend.receiptNetworkId = followedNextHopNetworkId_; + messageToSend.receiptNetworkType = followedNextHopNetworkType_; for (Network* network : networks_) { - if (!network->shouldEcho() && followedNextHopNetworkId_ == network->id()) { + if (!network->shouldEcho() && messageToSend.receiptNetworkId == network->id()) { jll_debug("%u Not echoing for %s to %s ", currentTime, NetworkTypeToString(network->type()), networkMessageToString(messageToSend, currentTime).c_str()); network->disableSending(currentTime);