Bug - Won't Fix Mafia and USB disconnect

I use Mafia on USB stick, and sometimes I can accidentally disconnect it during Mafia work - because of faulty port, or simply physical intervention when accidentally puch stick during inserting/removing another. Port restores after that, and everything seemingly work, so I could overlook it before, and I believe, it happens more often than I notice it, because I didn't change my behaviors recently - but Mafia did.

Before, if I port "glitched", I seen one from two behaviors:
- Chat works (I believe, it circumvent Mafia then) but any game related action or direct Mafia query - to store, to item manager, etc, give me "time out" error, and Mafia log "hash mismatch" error. Refresh session works in this cases.
- Mafia immediately crashed when I am trying to do anything.

Now I trice already seen quite confusing behavior.
1. Logging dies without warning. Mafia shows is as usual, but nothing goes to files.
2. _Some_ Mafia functions disabled, while others are not. I wasn't able to enter Item manager, but could auto-adventure, for example.
3. Refresh session does nothing. Attempt to logout or close Mafia ends with full hang.

Can I do something to change this behavior? Actually, I would prefer crash than loss of half-day of the logs. :) Or "be careful in the future" is only answer here?
 

Magus_Prime

Well-known member
I think that: "don't do that" is the likely answer. Mafia is constantly writing logs and data while running and any disruption of that can, and often does, leave things in an inconsistent state.
 

fronobulax

Developer
Staff member
There are several situations where it is difficult to write robust code that will reliably recover from severe errors. An intermittent disk failure is one. (A power failure is another one). So it is unlikely that mafia will be changed to handle this case. If it happens you should try and shut mafia down normally and then restart mafia. Your hope that mafia will continue to work is unrealistic.

If mafia is "unresponsive" after a "glitch" then you really have no choice besides terminating mafia at the operating system level.

Even if it appears to be responsive your only safe bet is to shut it down.

I never had the problem when running mafia from a USB drive but I found I was usually running mafia on the same two machines. Instead of using a USB for portability I set up shared cloud storage between the machines and ran mafia from it. I've standardized on Dropbox, not because it is the best now but it was the best for me when I made the decision years ago and I tend not to fix what isn't broken. You still run the risk of a network connection dropping but Dropbox is pretty robust about keeping changes locally and synching them when the connection is restored. Mafia is also a bit more forgiving about network failures than it is about catastrophic disk failures.

But "Don't Do That" is probably the only answer you are going to get.
 

zarqon

Well-known member
I also have my mafia folder in my Dropbox but these days I have remote access to my home machine via Splashtop and that's even better. I still like Dropbox though for reverting any unwanted changes to things like my settings files (has happened a handful of times through my long history with this game). Regardless of how you do it, I'd say the cloud or a remote connection is way better than carrying around a physical USB, and may be, if not the answer you hoped for, a good one nonetheless.
 
Unfortunately, using cloud service isn't an option at my work. Seems "be more careful" is an only option then. Thank you for the answers!
 
Top