Always lowercase filenames in CUtlFilenameSymbolTable to fix loading packed files on Linux (fixes #865)
Description
Tracked down in https://github.com/ValveSoftware/source-sdk-2013/issues/865, loading packed files (e.g. from bsps & vpks) is often broken on community maps for Linux users (& servers!!!) leading to missing textures and broken model collisions.
Also reported at https://github.com/ValveSoftware/Source-1-Games/issues/6868
I'm making this PR to bring more visibility to the cause and to hopefully be merged.
(The cause being that CUtlFilenameSymbolTable only lowercases filenames on Windows, which is called from CZipPackFile::GetFileInfo() to use a cached file-handle.)
Have you compiled and tested it works on all platforms like normal? As well fixing the issue https://github.com/ValveSoftware/Source-1-Games/issues/6868?
Have you compiled and tested it works on all platforms like normal? As well fixing the issue ValveSoftware/Source-1-Games#6868?
It's used in engine code (CZipPackFile) which we can't rebuild, so it can't be tested by compiling, but it has been confirmed to fix https://github.com/ValveSoftware/Source-1-Games/issues/6868 after hooking the relevant functions:
- client-side https://github.com/ValveSoftware/Source-1-Games/issues/6868#issuecomment-2707662934
- server-side https://github.com/rtldg/linux_file_lowercaser
~~A user of the server-side plugin reported that it could conflict with packed models that use capital letters https://github.com/rtldg/linux_file_lowercaser/issues/1#~~
~~But there's not much I can investigate for it right now.~~
EDIT: Seems to be fine after all so never mind 😇
@mutezero has posted about another approach to handle case-insensitive file name/path comparisons that could be considered too https://github.com/ValveSoftware/source-sdk-2013/issues/865#issuecomment-3149873648