Fix replay response recording for retry handling#3116
Merged
Conversation
This was
linked to
issues
Jun 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the replay response stream format to support response payloads larger than 255 bytes (YRP 2.5) and improves replay integrity by removing responses that are rejected by ocgcore with MSG_RETRY.
Changes:
- Add YRP 2.5 response segment encoding via
Replay::WriteResponse()(u8 length for 1..255, otherwise0x00 + u16 length), and update the reader to support it. - Track the last recorded response size in
SingleDuel/TagDueland roll it back from the replay stream whenMSG_RETRYoccurs. - Switch
SingleModeresponse recording to use the newWriteResponse()helper.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| gframe/tag_duel.h | Adds tracking for last recorded replay response size. |
| gframe/tag_duel.cpp | Rolls back the last recorded response on MSG_RETRY; records responses via WriteResponse(). |
| gframe/single_mode.cpp | Records responses via WriteResponse() (enables extended lengths). |
| gframe/single_duel.h | Adds tracking for last recorded replay response size. |
| gframe/single_duel.cpp | Rolls back the last recorded response on MSG_RETRY; records responses via WriteResponse(). |
| gframe/replay.h | Declares WriteResponse() and RemoveData() APIs. |
| gframe/replay.cpp | Implements YRP 2.5 write/read logic and replay rollback support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mercury233
approved these changes
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
solves #3113
Previous issue: replay response recording wrote length and payload directly at each call site, while retry handling did not remove the response that had just been recorded before the engine requested the same response again.
Impact: a replay could keep an extra stale response after
MSG_RETRY, causing later replay playback to consume responses out of order. Oversized response payloads could also leave the encoded length and written payload size inconsistent.Fix: centralize response recording in
Replay::WriteResponse, cap recorded payloads toUINT8_MAX, and return the actual encoded byte count. Single and tag duels now remember that byte count and remove the last recorded response whenMSG_RETRYoccurs before requesting the response again.