Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PacketIndex is increased even when userdata didn't change #18

Open
zapek opened this issue Feb 7, 2021 · 1 comment
Open

PacketIndex is increased even when userdata didn't change #18

zapek opened this issue Feb 7, 2021 · 1 comment
Assignees
Milestone

Comments

@zapek
Copy link
Contributor

zapek commented Feb 7, 2021

When a packet is received, packet_index is checked for increments to see if the userdata needs to be updated:

bool update_user_data = ((*find_it).last_received_packet() < header.packet_index);

But here:

++packet_index_;

packet_index is incremented everytime a packet is sent, even if the userdata didn't change.

Shouldn't it be increased only if the userdata changed?

@truvorskameikin truvorskameikin self-assigned this Feb 8, 2021
@truvorskameikin truvorskameikin added this to the Release 1.0 milestone Feb 8, 2021
@truvorskameikin
Copy link
Owner

That is a good idea to not increment packet_index every send. And I think that it also can be renamed to something like snapshot_index. Now it should increase on every user_data change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants