Skip to content

Preserve completed rounds after a match backup rollback - #545

Merged
pnxenopoulos merged 1 commit into
pnxenopoulos:mainfrom
VIEWVIEWVIEW:codex/preserve-rounds-on-rollback
Nov 22, 2026
Merged

pnxenopoulos merged 1 commit into
pnxenopoulos:mainfrom
VIEWVIEWVIEW:codex/preserve-rounds-on-rollback

Conversation

@VIEWVIEWVIEW

Copy link
Copy Markdown
Contributor

Closes #544.

When a server restores a round backup, m_totalRoundsPlayed can decrease mid-match. RoundTracker cleared its entire history on any decrease. It now keeps rounds through the restored count and discards later attempts. A full restart at zero still clears every round. Resetting the freeze state also lets the tracker capture the replay’s start when the restore happens during freeze time.

Verification

I compared Demo.rounds with demoparser2 0.42.1 on the Nuke recording from RED Canids vs. 9z. Demo archive

Awpy 3.3.0 With this patch
Rounds returned 16–24 (9 rows) 1–24 (24 rows)
Replayed round 16 start Missing Tick 177613

demoparser2 returned 26 raw round-end events, including the superseded round 16 and the rollback event with no winner. All 24 scored rounds matched the patched output on end tick and winning side. The replayed round 16 ended at tick 187154 with 9z winning, and the final score was 13–11 for RED.

cargo test --locked -p awpy --lib passed locally (159 passed, 5 ignored), including the new partial-rollback and full-restart regression test. cargo fmt --all --check passed.

@pnxenopoulos

Copy link
Copy Markdown
Owner

This looks good to me. Before I release 3.3.1, I'm going to take this demo and add it to awpy-fixtures, and add one more targeted test. Thanks for this fix!

@pnxenopoulos
pnxenopoulos merged commit 374c29c into pnxenopoulos:main Nov 22, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Demo.rounds drops 15 valid rounds when a single round is rolled back

2 participants