1
0
forked from 0ad/0ad
0ad/source/ps
wraitii d740b4f335 Fix bug where 'archive' XMB files could end up being written to the user mod
Users sometimes ended up with bad (wrong version) XMB files in the user
mod. This resulted in A25 loading a black screen.
There is a combination of unfortunate code paths that lead to this. The
core issue is that:
- cdd75deafb changed the XMB loading code that if there is an error in
Init from a cached XMB, it reports an error. This error happens to be
silent, because the GUI expects CXeromyces to do its own error reporting
(a pretty poor decision, all in all, but whatever). This explained why
the black screen showed no errors.
- The code flow attemps to load an 'archive' XMB first, then only a
loose cache. _But_ if the XMB that fails to load is an archive (which
generally never happens except when using incompatible mods, which is
generally less easy in A25 since we added code to stop that), then the
game will try to recreate the XMB as an 'archived' path, not a 'loose
cache' path as it would usually do.
- Because the 'archived' path already exists in the VFS, the game will
attempt to overwrite that. It so happens that in non-dev copies, this
writes to the user mod.
- Because the user-mod is always loaded, this was unexpected for users.

Fixing this is rather simple: the game should never attempt to write
'archive' XMBs in that function. Added explicit barrier, which shouldn't
matter performance-wise but fixes the issue by writing in the proper
place, and also properly recovering in case of read failure.
I will note that the game will still try to load the archived file, and
recreate it every time, but I don't think that's a particularly big
deal, in general having engine-incompatible mods in the future should be
harder because of A25 changes there.
(NB: users that have used both A24 and A25 should perhaps still be
advised to check their user mod folder, otherwise they'll end up
recreating those files forever).

Reported by: dave_k
Fixes #6320

Differential Revision: https://code.wildfiregames.com/D4275
This was SVN commit r26272.
2022-01-30 12:50:43 +00:00
..
GameSetup Remove leftover terrain-based movement cost code. 2022-01-29 08:22:28 +00:00
scripting Fix replay folders with special characters. 2021-11-19 11:34:26 +00:00
tests Add "Invalid signature" reason to modio 2021-12-25 19:31:51 +00:00
XMB Removes unused forward declarations of class and struct. 2021-09-08 19:43:01 +00:00
XML Fix bug where 'archive' XMB files could end up being written to the user mod 2022-01-30 12:50:43 +00:00
ArchiveBuilder.cpp Make real directory paths on the VFS predictable (retry) 2021-03-23 12:46:59 +00:00
ArchiveBuilder.h Handle mods specified on the command line when using the archive builder. 2014-06-15 16:43:08 +00:00
CacheLoader.cpp Make real directory paths on the VFS predictable (retry) 2021-03-23 12:46:59 +00:00
CacheLoader.h Fix biome-specific mappreviews in 7f602037ba for zipped mods, refs #4962. 2018-08-05 21:50:00 +00:00
CConsole.cpp Cleanups console a little bit. 2021-12-23 07:37:03 +00:00
CConsole.h Cleanups console a little bit. 2021-12-23 07:37:03 +00:00
CLogger.cpp Add support for GL_KHR_debug in Debug Mode. 2021-12-30 15:07:17 +00:00
CLogger.h Cleanups includes for cassert and streams. 2021-03-03 22:26:49 +00:00
Compress.cpp More build fixes for FreeBSD. 2012-01-31 00:06:56 +00:00
Compress.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
ConfigDB.cpp Fix options occasionally thinking they've been modified when they haven't. 2021-06-16 15:54:55 +00:00
ConfigDB.h De-singletonify CConfigDB, make hooks RAII. 2021-04-27 07:45:40 +00:00
CStr.cpp Moves macro-defined methods of CStr to templates. 2021-09-07 21:01:34 +00:00
CStr.h Drops custom utf16 string implementation (from cdd3317ded), uses C++11 one. 2021-11-29 12:10:41 +00:00
CStrForward.h Adds header for forward declarations of CStr. 2021-09-09 17:39:08 +00:00
CStrIntern.cpp Adds std namespace to shared_ptr usages in network and engine. 2021-05-22 19:28:40 +00:00
CStrIntern.h Include CStrInternStatic where necessary only. 2021-05-18 11:09:54 +00:00
CStrInternStatic.h Moves culling mode and front face state management to DeviceCommandContext. 2022-01-27 17:25:37 +00:00
DllLoader.cpp Fix and disable some pesky Windows warnings. 2021-02-05 12:20:06 +00:00
DllLoader.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
Errors.cpp Don't leak all GUI objects on name ambiguity following 5cc814759f and remove ERROR_GROUP GUI. 2019-10-11 16:20:50 +00:00
Errors.h Catch exceptions by reference (by convention), based on patch from Markus, refs #1852 2013-05-22 22:27:53 +00:00
FileIo.cpp Update (and debundle) fmt dependancy 2020-11-26 21:01:32 +00:00
FileIo.h Adds header for forward declarations of CStr. 2021-09-09 17:39:08 +00:00
Filesystem.cpp Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
Filesystem.h Adds header for forward declarations of CStr. 2021-09-09 17:39:08 +00:00
Future.h Implement a global task manager using a pool of worker threads 2021-06-03 14:48:38 +00:00
FutureForward.h Implement a global task manager using a pool of worker threads 2021-06-03 14:48:38 +00:00
Game.cpp Moves frame rendering function to CRenderer and combines with making screenshots. 2022-01-04 18:13:45 +00:00
Game.h Removes unused and outdated includes, replaces some includes by forward declarations. 2021-05-15 17:27:01 +00:00
Globals.cpp Fix hotkeys not releasing properly. 2021-01-16 15:24:58 +00:00
Globals.h Fix hotkeys not releasing properly. 2021-01-16 15:24:58 +00:00
GUID.cpp Actually remove trailing whitespace for non-header files as well. 2016-11-23 13:02:58 +00:00
GUID.h Adds header for forward declarations of CStr. 2021-09-09 17:39:08 +00:00
Hashing.cpp Additional entropy when hashing match passwords. 2021-05-18 14:47:36 +00:00
Hashing.h Adds header for forward declarations of CStr. 2021-09-09 17:39:08 +00:00
Hotkey.cpp Fix nopch / tiny hotkey optimisation 2021-04-06 12:26:34 +00:00
Hotkey.h Further hotkey work: clear hotkeys when an input box/the console gets focus. 2021-04-03 20:12:40 +00:00
Joystick.cpp De-singletonify CConfigDB, make hooks RAII. 2021-04-27 07:45:40 +00:00
Joystick.h Renames our sdl.h to libsdl.h, to avoid case sensitivity errors when it includes SDL.h. 2012-01-12 23:32:27 +00:00
KeyName.cpp Fixes without PCH build after af567560b8. 2021-11-30 18:03:39 +00:00
KeyName.h Adds header for forward declarations of CStr. 2021-09-09 17:39:08 +00:00
Loader.cpp Remove binary_function usage. 2020-11-30 15:45:05 +00:00
Loader.h Resolve Loader memory leak from 1f1642bfe3. 2019-09-30 08:49:00 +00:00
LoaderThunks.h Adds std namespace to shared_ptr usages in network and engine. 2021-05-22 19:28:40 +00:00
Mod.cpp Fix pathname not matching name incompatible mod detection 2021-10-28 20:33:01 +00:00
Mod.h Fix downloanded mods not showing in list until restart 2021-08-22 09:54:16 +00:00
ModInstaller.cpp Fix nopch build. broken in 52baaa4bbd. 2021-08-22 13:20:41 +00:00
ModInstaller.h Fix updating existing mods 2021-08-22 11:35:34 +00:00
ModIo.cpp Add "Invalid signature" reason to modio 2021-12-25 19:31:51 +00:00
ModIo.h Fixes broken PCH after wraitii commits (4f972bc623, 0f60bf3a97) and Itms (833c9f108c). 2021-05-15 14:50:24 +00:00
Profile.cpp Fix windows SEH hook when crashing in an std::thread 2021-01-10 08:39:54 +00:00
Profile.h Fix Profiler1 "time per turn". 2021-05-06 16:49:34 +00:00
Profiler2.cpp Adds std namespace to shared_ptr usages in network and engine. 2021-05-22 19:28:40 +00:00
Profiler2.h Removes unused containers included in headers. 2021-03-03 23:01:08 +00:00
Profiler2GPU.cpp Use GLAD2 a multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator. 2021-12-21 22:03:31 +00:00
Profiler2GPU.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
ProfileViewer.cpp Removes Z value from TextRenderer translate, renames TextRenderer methods to more explicit ones. 2021-06-02 21:21:28 +00:00
ProfileViewer.h Removes unused forward declarations of class and struct. 2021-09-08 19:43:01 +00:00
Pyrogenesis.cpp Bump version to alpha 26. 2021-08-27 16:32:34 +00:00
Pyrogenesis.h Fix windows SEH hook when crashing in an std::thread 2021-01-10 08:39:54 +00:00
Replay.cpp Remove leftover terrain-based movement cost code. 2022-01-29 08:22:28 +00:00
Replay.h Allow mods to say they should be ignored in replay/MP compatibility checks 2021-06-02 06:50:16 +00:00
SavedGame.cpp Allow mods to say they should be ignored in replay/MP compatibility checks 2021-06-02 06:50:16 +00:00
SavedGame.h Removes unused forward declarations of class and struct. 2021-09-08 19:43:01 +00:00
Singleton.h Simple refactoring of Singleton. Make it non-copyable. 2019-01-13 15:11:40 +00:00
TaskManager.cpp Default-init atomics in TaskManager::Impl 2021-06-05 09:48:41 +00:00
TaskManager.h Tweaks to TaskManager code 2021-06-04 12:55:15 +00:00
TemplateLoader.cpp Fix d73a3f59ad - wstring_view on a temporary & wrong utf16->8 conversion. 2021-04-09 18:08:37 +00:00
TemplateLoader.h Allow arbitrary compositions in TemplateLoader template names. 2021-04-09 15:43:50 +00:00
Threading.cpp Fix windows SEH hook when crashing in an std::thread 2021-01-10 08:39:54 +00:00
Threading.h Fix windows SEH hook when crashing in an std::thread 2021-01-10 08:39:54 +00:00
ThreadUtil.h Fix windows SEH hook when crashing in an std::thread 2021-01-10 08:39:54 +00:00
TouchInput.cpp Cleanup Camera related code and uses constant references where possible. 2019-10-03 12:58:47 +00:00
TouchInput.h Set svn:eol-style=native, fix some inconsistent line endings 2013-12-06 00:42:50 +00:00
UniDoubler.h Moves macro-defined methods of CStr to templates. 2021-09-07 21:01:34 +00:00
UserReport.cpp Adds std namespace to shared_ptr usages in network and engine. 2021-05-22 19:28:40 +00:00
UserReport.h Write UserReport data to local logfiles, so that users can review the personal data impact without exposing the data to JS/mods, refs #5257, b3438cabd2. 2018-08-22 22:17:42 +00:00
Util.cpp Moves frame rendering function to CRenderer and combines with making screenshots. 2022-01-04 18:13:45 +00:00
Util.h Moves frame rendering function to CRenderer and combines with making screenshots. 2022-01-04 18:13:45 +00:00
VideoMode.cpp Uses core GL functions for GLSL shaders. 2022-01-06 11:41:04 +00:00
VideoMode.h Uses forward declaration for SDL in GL device. 2021-12-15 10:50:31 +00:00
VisualReplay.cpp Remove Custom implementation of wrename on windows. 52baaa4bbd removed the other occurences. 2021-09-09 17:53:17 +00:00
VisualReplay.h Adds header for forward declarations of CStr. 2021-09-09 17:39:08 +00:00
World.cpp Splits CRenderer part about scene to CSceneRenderer. 2022-01-04 13:29:01 +00:00
World.h Adds header for forward declarations of CStr. 2021-09-09 17:39:08 +00:00