Results 1 to 9 of 9

Thread: Powercut causing preferences to be reset

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    7

    Default Powercut causing preferences to be reset

    When something causes my computer to shut down (e.g. powercut, blown fuse...) while Mafia is running, it resets all of my preferences and settings. After the most recent time, I've finally committed to keeping a backup of the pref file.
    Aside from that, is there anything I can do to prevent this. Also, can anyone explain exactly why it happens?
    Thanks.

  2. #2
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,567

    Default

    From the standpoint of most software developers that is a hardware problem and the best solution would be to do whatever needs to be done to make sure that the computer shuts down cleanly.

    There are a couple of possible reasons. If the act of shutting down causes file corruption on disk then mafia will reset things to the defaults since that is how it recovers. If the shutdown happens after a preference is updated but before it gets written to disk then the change obviously won't be saved.

    I personally can't think of a way to implement disk I/O that will guarantee all changes will be saved, even during an unexpected shutdown. If there is one it is almost certainly more effort than a volunteer is going to expend.

    I didn't look to see what mafia's write to disk strategy is but trying to write every time something changes causes performance problems so there is a trade off and at the moment a developer would have to change code.

    So what you can do is a) back up often and b) find a hardware solution to the power issue such as using a laptop or an uninterruptible power supply.

  3. #3
    Junior Member
    Join Date
    Feb 2013
    Posts
    7

    Default

    That makes sense. Thanks.

  4. #4
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,567

    Default

    That makes sense. Thanks.
    Originally Posted by discdeath View Post
    No problem. Sorry if I came across as snarky. It was late last night :-)
    Well, thank you.
    Originally Posted by Veracity View Post

  5. #5
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,526

    Default

    I lost all of my zlib settings because I stupidly ran out of disk space. One way to back these things up would be to use a revision control system like SVN. I should probably set up an automated job to do that daily.

  6. #6
    Senior Member
    Join Date
    Feb 2010
    Posts
    1,105

    Default

    I use sync.com to avoid exactly this issue. If something happens I just revert to an earlier version of the file.

  7. #7
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,567

    Default

    I lost all of my zlib settings because I stupidly ran out of disk space. One way to back these things up would be to use a revision control system like SVN. I should probably set up an automated job to do that daily.
    Originally Posted by Crowther View Post
    I had local SVN repositories for various things but I never automated the check in/out to the point where "It Just Worked" so it was more trouble than it was ultimately worth once I stopped generating a lot of "personal" source files.

    I did have some success with Dropbox. I was running mafia on multiple computers and it was a trivial way to synch scripts and preferences across machines. A side effect was that if I had a corrupted file I could unsynch until I got a better version from the other computer. Dropbox also has some limited versioning so I could also go back and get something closer to what was lost.

    In a world where there are lots of cloud options, synching the mafia dist subdirectory to a cloud probably won't hurt although space considerations might be an issue with the sessions subdirectory.

    In general writing a robust system that can survive a power outage is a high cost/high skill activity. Doing it reliably involves a lot of hardware and software redundancy.

    I wasn't thinking of a cloud synch before because that too can fail when he power goes, but I missed the fact that it can usually provide a recent backup and that is certainly better than not having a backup.
    Well, thank you.
    Originally Posted by Veracity View Post

  8. #8
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    940

    Default

    I did have some success with Dropbox. I was running mafia on multiple computers and it was a trivial way to synch scripts and preferences across machines. A side effect was that if I had a corrupted file I could unsynch until I got a better version from the other computer. Dropbox also has some limited versioning so I could also go back and get something closer to what was lost.
    Originally Posted by fronobulax View Post
    I use Dropbox for this reason - running mafia on multiple computers. Dropbox also keeps many multiple backup versions of files automatically, so if something get corrupted, it it easy to revert back to a previous version.

  9. #9
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,697

    Default

    I use Dropbox for this reason - running mafia on multiple computers. Dropbox also keeps many multiple backup versions of files automatically, so if something get corrupted, it it easy to revert back to a previous version.
    Originally Posted by ckb View Post
    Same, for the last 13 years. Dropbox doesn't give a lot of space for a free account, but it's more than enough for a mafia installation, even with various multis.
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •