Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 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:
WalkthroughThe changes replace manual path-separator searches with shared ChangesShared path filename extraction
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: 🔵 Low · up to Maps with mixed separator styles can miss their water-grid settings. This is a narrow, pre-existing limitation, so the change is mergeable with owner awareness. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change lets forward-slash map paths resolve to the intended filenames during transfers. Receiving clients retain destination and content checks, and no new security bypass was established. Some uncertainty remains about where all map paths originate. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
ffcf008 to
312cf98
Compare
xezon
left a comment
There was a problem hiding this comment.
Looks plausible. Can you make a full audit over the code if there are any other places like that and fix them too?
|
Done. Audited all places that take a file name from a path with only a backslash and switched them to getFileName or getLastPathSeparator. I left the windows-only tools stuff eg WorldBuilder and getMapLeafAndDirName alone |
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: 822dca59-ce18-4fcc-ae4a-c01b2145c2d2
📒 Files selected for processing (29)
Core/GameEngine/Source/Common/Audio/AudioEventRTS.cppCore/GameEngine/Source/Common/CRCDebug.cppCore/GameEngine/Source/Common/INI/INIMapCache.cppCore/GameEngine/Source/GameClient/MapUtil.cppCore/GameEngine/Source/GameLogic/Map/TerrainLogic.cppCore/GameEngine/Source/GameNetwork/FileTransfer.cppCore/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cppCore/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cppCore/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cppCore/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cppGenerals/Code/GameEngine/Source/Common/Recorder.cppGenerals/Code/GameEngine/Source/Common/StatsCollector.cppGenerals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cppGenerals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cppGenerals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cppGenerals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cppGenerals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cppGenerals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cppGenerals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cppGenerals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cppGeneralsMD/Code/GameEngine/Source/Common/Recorder.cppGeneralsMD/Code/GameEngine/Source/Common/StatsCollector.cppGeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cppGeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cppGeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cppGeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cppGeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cppGeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cppGeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.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.
10a872c to
a426ff8
Compare
xezon
left a comment
There was a problem hiding this comment.
Very nice improvements. Does this cover all of them or is something left hanging?
|
Open question is left. |
| // Prefix bare filenames with the window directory. Keep supplied paths unchanged. | ||
| // | ||
| if( strchr( filename, '\\' ) == nullptr ) | ||
| if( getLastPathSeparator( filename ) == nullptr ) |
There was a problem hiding this comment.
Relative layouts lose Window prefix
Existing callers pass relative layout names such as Menus/SinglePlayerLoadScreen.wnd and Menus/MessageBox.wnd. The new check treats their / as a supplied path, so openFile receives Menus/... instead of Window\Menus/.... If those layouts are stored under the Window directory, load screens and message boxes will fail to open.
Knowledge Base Used: Game client runtime
|
I found and fixed a couple more directory checks in GameInfo and one in the window script loader. Then there's getMapLeafAndDirName, which I fixed in #3108. I didn't touch Windows-specific path handling, tools and the unused Get_W3D_Name helper |
Several filename extractions search only for a backslash. Paths using forward slashes can therefore retain directory names, and some callers use an invalid pointer when no backslash is found.
Use
getFileNameandgetLastPathSeparatorfromPathUtil.hto handle both separators. For example, the save list fallback label now usesfoo.mapforMaps/foo/foo.map. Existing map labels remain unchanged.The changes cover save labels and default descriptions, map cache names, lobby and game setup map names, replay lists, generated stats and replay filenames, audio localization, file transfer helpers, and diagnostic output. Applied to Generals and Zero Hour.
getMapLeafAndDirName, which constructs the portable save path, and Windows-only tools such as WorldBuilder are unchanged.Verification:
In-game verification covers the save list fallback label. The other changed call sites have not been tested in game.