Repository navigation
bugfix(recorder): Validate next frame value range in RecorderClass::readNextFrame() - #3090
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughRecorder playback validates the first and subsequent next-frame values, except during analysis. A value earlier than the current frame or at least 3,600 logic-seconds ahead stops playback and sets the next frame to -1. ChangesPlayback frame validation
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: 🔵 Low · up to
|
[Medium impact] The PR appears safe to merge.
|
|
The bots are not too happy about this 😄 |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
00f01869-6682-4fb3-b5c4-2c58097628f4
📒 Files selected for processing (2)
GeneralsMD/Code/GameEngine/Include/Common/Recorder.hGeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
1489f3d to
e336693
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
fbdf2d4c-2fd1-451c-8729-ec3faf00f5d8
📒 Files selected for processing (2)
GeneralsMD/Code/GameEngine/Include/Common/Recorder.hGeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
4dc9a49 to
4cbacfa
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
adcc53f8-8715-48da-a761-2449570ddc24
📒 Files selected for processing (2)
GeneralsMD/Code/GameEngine/Include/Common/Recorder.hGeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
1efcb28 to
75bbe2b
Compare
They're much happier now :) Adding the |
xezon
left a comment
There was a problem hiding this comment.
Logic flow looks complicated again. Can we simplify this?
9ce0d83 to
f787ba8
Compare
|
Needs replicate. |
f787ba8 to
e5551c0
Compare
This PR adds a sanity check to
RecorderClass::readNextFrameto prevent replays with corrupt data from taking forever to complete. I came across a handful of GenTool replays that had this issue.Non-headless mode has a fail-safe that partially mitigates the issue there. The script engine triggers a call to
GameLogic::exitGameon the final victory / defeat screen, and this adds aGameMessage::MSG_CLEAR_GAME_DATAmessage to the message stream. This ends replay playback. The message stream is ignored in headless mode, so this doesn't apply there. It's also not a complete fix because the corrupted data may occur before a victory or defeat takes place. I have not encountered replays for which that was the case.The maximum next frame value is set one hour away, which seems more than reasonable to me. The only way this generates a false positive is if no game action is taken for an hour or more and the CRC interval is set to an hour or more (it's a couple of seconds by default).
Here are four Gentool replays that are corrupted somehow and cause the game to keep running without end in headless mode: replays.zip.
TODO:
@Skyaero42 Tagging you so you're aware of this PR.