Using Mafia on Two Different Computers

natnit

Member
So I've spent a bit of time setting up Firefox Portable and Mafia on my old iPod. Figure it'd be nice to be able to play on the laptop in a pinch, and it wasn't too hard to get going.

My only concern now is how to synchronize the data between play sessions? Assuming I don't do anything crazy on the laptop (i.e. install or modify new scripts, etc.) what files change within a run and contain pertinent information. The only one I can think of is charname_prefs.txt, but I'm pretty sure I'm missing some.

With that covered, what would be the best way to maintain such a file? Someway to sync it based on whichever was most recently modified? I've found some software, but would a solution that uploaded it to some ftp somewhere be wiser?

Any help or advice is appreciated. Thanks!
 

lostcalpolydude

Developer
Staff member
If you use a .jar, there's a command-line flag you can use to force all the preference files to be saved in the same location as mafia (the way it works for Windows, but if both computers ran Windows you probably wouldn't be here asking about it). I don't remember the command-line flag though. That would be a lot easier than syncing files all the time.
 

natnit

Member
I wouldn't be asking here if they both ran windows? Color me embarrassed. :)

I guess you're right, it's pretty trivial to just copy that one file back and forth between two windows machines. I am very afraid of user error, however, and would hate to mess up data during a run. If I could automate it easily, perhaps upon detection of the USB device, that would be ideal. I guess my Plan B isn't as bad as I was making it out to be.
 

lostcalpolydude

Developer
Staff member
Aren't the preference files all on the USB drive with mafia? They never need to be moved to the computer, and nothing needs to be synchronized. You could copy the whole folder to one computer or another sometimes as a backup, but there's no reason to ever use those files unless something happens to the USB drive.
 

fronobulax

Developer
Staff member
When I was running on multiple computers I found the easiest thing to do was run mafia from a USB device that had the jar file and all the preferences. The only issue was managing storage because I had an old (small) USB device that started running out of space after a month of playing two characters because of session logs.

When I had separate installations on different hardware I found I had to synch the settings subdirectory. However as my use of features increased I found I also needed ccs and data and that hassle is what lead me to putting everything on a thumb drive.
 

zarqon

Well-known member
Best solution: Play from a flash drive.
Second best: Play one character per computer.
Third Best: Regularly copy most of your mafia folder back and forth (basically everything except sessions). You can avoid copying the contents of the actual mafia directory if you are using something like Rinn's automatic daily build checker/downloader/runner.
Fourth Best: set up some kind of automated FTP sync using a remote server. Quite a few FTP clients can do this -- but it seems a bit gratuitous.

Or, mix and match the above as needed.
 

Bale

Minion
Fourth Best: set up some kind of automated FTP sync using a remote server. Quite a few FTP clients can do this -- but it seems a bit gratuitous..
A google search turned up Dropbox. Does anyone have any experience with that service? It could easily be the best and easiest option if it really works. It's free for 2GB or less and that's plenty for my mafia usage.
 
Last edited:

zarqon

Well-known member
I've had good experience using them for file sharing -- the link is direct, no delay, no advertising. Download speed is fine. Haven't tried syncing, though.
 

Bale

Minion
Can you define the existing mafia folders for synching/sharing or does it have to be for a special Dropbox folder that would only work if I ran mafia from that folder?

If so, it might be nice to have the same mafia information available everywhere even if I forgot my USB drive.
 

lingh0e

New member
Can you define the existing mafia folders for synching/sharing or does it have to be for a special Dropbox folder that would only work if I ran mafia from that folder?

It's the latter. You have to pile everything into one folder. It's not a terribly big deal if Mafia is all you want to sync. Just drop it in the folder and make a few symlinks to make navigation a little easier.

If so, it might be nice to have the same mafia information available everywhere even if I forgot my USB drive.

Forgetting my USB drive... or not having the correct one, that's always been my issue.

As of right now, DropBox is probably the most painless way to automate the synchronization from machine to machine... if you don't mind a third party app sitting on your system with a constant eye on your data. Call me paranoid, but I'm going to continue to explore other options.

I've been known to SSH into my main machine to sync up Mafia data, but that's just me.
 
Last edited:

lostcalpolydude

Developer
Staff member
The short answer is that everything has to be inside the Dropbox folder.

The longer answer is that you can create a symbolic link inside the Dropbox folder pointing to the folder at some other location you want to back up. I don't know if there's a good way to do that in Windows. You can use the command line for OSX or linux, or you can use http://www.macupdate.com/info.php/id/10433 in OSX to do it from Finder (I tracked that down because of Dropbox, but I had already set up all the symlinks I needed and haven't actually used the program).

Using a referral link gives both people an extra 250 MB for free. Posting a referral link feels too much like spam to me (especially when someone else posted the link), so if you want that then feel free to message me.
 

fronobulax

Developer
Staff member
As of right now, DropBox is probably the most painless way to automate the synchronization from machine to machine... if you don't mind a third party app sitting on your system with a constant eye on your data. Call me paranoid, but I'm going to continue to explore other options.
Overkill and with a lot of prerequisites, but if you are running the right version of Microsoft Office or are just willing to buy it, Microsoft Groove is very good at synchronizing directory trees between computers. Data leaving your computer is encrypted and you have a lot of control over who gets to see it. It also runs asynchronously which can be useful. Obviously you have to run Groove on every machine. In fact when I had a site desktop, corporate laptop and personal laptop it is exactly what I used to run mafia on whichever machine I had available. It was especially useful since, if I followed the rules, I had to declare I had a USB device before I could use it at the site.
 

zarqon

Well-known member
Would like to mention that I've just set up Dropbox for all my machines (including my phone!). The primary reason, of course, being syncing mafia across computers. I'm enjoying my newfound freedom! Previously, each computer would only be for certain characters, to avoid the hassle of moving settings files and scripts back and forth on a flash drive. But now, I can play any character from any machine, and everything syncs automatically. Very cool. Also, I don't need to update scripts more than once, which was a hassle when a script.

Another benefit is that Rinn's "automatic latest version" utility only has to hit kolmafia.us once -- rather than once per machine. This even speeds up playing since by the time I'm ready to play the latest daily has already propagated into my dropbox dir.

It takes up more RAM than I'd expect would be necessary (28,000 KB while working), but this is small by today's standards. Overall, a recommended experience.
 

mredge73

Member
My clan bot auto runs and auto-login on Mafia.
I am looking to try drop-box to sync my mafia folders between the machine that runs my bot and the one that I actually use to play my non-bot characters.

Is there a way do keep this functionality without duplicating the folders?
In other words, I don't want to double click mafia and it try to auto-login my bot if I want to play my other characters and vice versa.
 

Bale

Minion
Does this work for Macs or Linux? From what I understand those systems don't set up housekeeping in mafia's subdirectories. Do I understand incorrectly?
 
Last edited:

Bale

Minion
LOL! I just noticed zarqon's new signature:
slyz said:
Ignore me, I thought we were talking about BatMan.
That's hysterical!

Back to the topic at hand, could you write a very simple explanation for people on Linux and Macs to do that? For the sake of the wiki!
 
Top