bugfix(replay): Handle replay deletion during version mismatch prompt#1837
bugfix(replay): Handle replay deletion during version mismatch prompt#1837bobtista wants to merge 8 commits into
Conversation
66502a8 to
9d06998
Compare
There was a problem hiding this comment.
There is already an established pathway for handling file deletion during a confirmation popup in ReplayMenu::delateReplay. Adopting this logic would simplify the implementation and resolve the message and list refresh inconsistencies of this change, which I've tabulated below for clarity.
| Action | Refreshes list | Message |
|---|---|---|
| DELETE REPLAY | Yes | The system cannot find the specified file. |
| LOAD REPLAY | No | This replay cannot be loaded because the file no longer exists on this device. |
9d06998 to
c5b68b2
Compare
Thank you - I implemented it this way, rebased the latest main, and force pushed |
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Source/Common/Recorder.cpp | Defers playback mode until replay initialization completes, preventing failed opens from exposing invalid playback state. |
| Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp | Revalidates prompted replays, restores the missing-map guard, and handles final playback failures with generic feedback and list refresh. |
| GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp | Mirrors the safe recorder mode transition for Zero Hour. |
| GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp | Mirrors the corrected replay validation and failure handling for Zero Hour. |
Reviews (9): Last reviewed commit: "bugfix(replay): Recheck replay map after..." | Re-trigger Greptile
c5b68b2 to
cbc36ff
Compare
|
The latest push does this:
|
The latest push uses readReplayMapInfo() to validate the file before playback (like loadReplay), shows the "REPLAY NOT FOUND" message, and refreshes the listbox on failure. Both the message and list refresh should now be consistent with deleteReplay. Ready for re-review when you get a chance. |
Is the latest push actually pushed? Issues still persist:
|
Yes latest was pushed, but you're right. RE Inconsistent messages — I'll switch to using the same FormatMessage/GetLastError pattern that deleteReplay uses, with "GUI:Error" as the title. RE Crash after clicking OK, I think that's something else - I'll investigate. |
6e161cc to
c50a803
Compare
|
Needs re-review @Stubbjax |
|
Reworked this. RE message consistency, reallyLoadReplay now re-validates with readReplayMapInfo() and shows the same "REPLAY NOT FOUND" message as loadReplay, instead of the raw OS FormatMessage string. RE Crash after OK, RecorderClass::playbackFile(): it was setting m_mode = RECORDERMODETYPE_PLAYBACK before opening the file, so a failed open left the recorder in playback mode with a NULL m_file, and the next update dereferenced it. Moved the assignment after the successful header read. Also drops the Win32/VC6 file-attribute code :) Ready for re-review. |
… prompt is open (Generals)
c50a803 to
89eec2b
Compare
|
Apologies - on 19 Jul I committed locally but never pushed, so you were both reviewing the February version. Pushed now and rebased onto current main. |
…ails to start (Generals)
Fixes #1732
Summary
Notes
reallyLoadReplay()andloadReplay()now handleplaybackFile()failure by keeping the menu open, showing the replay-not-found message, and refreshing the list.Testing