UnofficialCrusaderPatch / UCP3-GUI

Dev work on the UCP3 gui
GNU Affero General Public License v3.0
2 stars 0 forks source link

[FILES] Try to better handle bigger file modifications while the game is running. #200

Closed TheRedDaemon closed 7 months ago

TheRedDaemon commented 7 months ago

Naturally, some changes by the GUI may have a bad effect on a potentially running game. At least two are rather problematic, since they might produce invalid states:

If the game is running, certain files are locked, so both of these actions could not only crash or break the game (something other actions could also), but easily produce an invalid folder state.
To avoid these, two actions should be performed:

Thoughts: In theory, no folder altering action should run if the game of the current folder is running. The issue is that checking this on every action would be impossible, even if a proper check exists. The GUI would need to be locked, except the action to change the folder. The process creation could actually be modified to keep a stream to the game open, which would indicate that is running. However, this would only work with games started from the GUI, so it would not be reliable. This handling is likely overkill for now, so the easier fix should be tried.