Skip to content

Commit

Permalink
Prepare for future refactor of shouldEcho()
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSchinazi committed Jan 10, 2025
1 parent 410975b commit 5249151
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/jazzlights/network/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/jazzlights/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5249151

Please sign in to comment.