Tweakeroo

Tweakeroo

2M Downloads

Tweakeroo resets all its config settings if the game is force shut down

James103 opened this issue ยท 1 comments

commented

As of Tweakeroo version 0.10.0-dev.20210710.155746 for Minecraft 1.17.1, if you force shut down the game, there is a small chance (increases if the game is crashing or spends a long time "Saving world") that all of your Tweakeroo settings get reset.

Possible steps to reproduce:

  1. Start up the game.
  2. Open a new world or join a world.
  3. (Recommended) Create a lot of client-side lag.
  4. Force shut down the game with Task Manager.
  5. Restart the game.
  6. An error will print to the log saying that Tweakeroo was unable to read the config file.
  7. Therefore, all Tweakeroo settings get reset to default.

This may be because Tweakeroo writes its config file in 32 KiB blocks (32,767 bytes at a time). If the file is only half written (i.e. the first chunk is written but not the second), that most likely creates JSON errors which make the file unparsable.

commented

Try if this still happens with malilib dev.25 which I just uploaded to CF now. It changes the JSON writing to happen to a temporary file first, which then gets renamed over the old config file.

In future versions malilib will also start making rotating config backups before writing to the files (this was already implemented a few months back in the main development code).