mafia limits?

incon_muppet

New member
I know this may be a simple issue, but for the life of me I cannot figure out how to have more than 2 mafia sessions open at the same time. If I have 1 open, and my sons want to play on other PCs, we cannot use the same jar. We have a lot of scripts we share, and sometimes we switch up and trade players (sounds kooky, but fun when we have "wars" where we try to mess something up for each other to try to fix the next day), so we want to use the same jar in the same folder, but only 2 of us can play at the same time. Any suggestions?
:confused:
 

Spiny

Member
I live with 2 other KoL players. We have 3 computers networked and run a single mafia .jar file. We do however each have our respective .kolmafia folder containing data, scripts, sessions etc in our home directory. I have no problem playing one of my characters, then shutting mafia down completely and loading up another of my characters. I also don't have any problem playing kol via mafia at the same time as the others in my household. Mind you, we have Linux here. I can't speak for other OS.
 

Alhifar

Member
Mafia is indeed limited to two sessions at a time, to limit the ability to run hundreds of farmbots, if I'm not mistaken.
 

holatuwol

Developer
If you don't mind me asking, how many people use the same JAR?

If you're on Windows and you share scripts, you could probably use a combination of Dropbox and Junction Link Magic (to avoid having Dropbox sync everything, like chat logs, you could just put the scripts folder on Dropbox and junction link your scripts folder to it). If you're on Linux or OS X, Dropbox and symlinks should be sufficient for the same purpose.
 

incon_muppet

New member
There are 3 of us wanting to use the same jar, and sometimes a 4th. We are running a combination of Windows 7 and XP. I do not know what dropbox or Junction are, but I am sure I could find out. We have actually had 8 sessions on 3 computers before, but some had different home folders. I thought someone here would know what file in the jar was limiting the sessions to 2, and that I could then change it and recompile. But it definitely sounds like something that may be more trouble than it is worth. :p

I definitely appreciate all the help tho
 

dj_d

Member
FWIW, 3 instances of mafia (versus the existing 2) would be superfabulous. It's not uncommon that I'm running tests on my 2 multis while adventuring with my main. My scripts tend take a long time to debug. :)
 

Catch-22

Active member
Not sure if my post got deleted or I just didn't click the post button.

I don't have a need for more than 2 sessions at a time, but it is possible to add support (or rather, remove the limitation).

Comment out the following lines of KoLmafia.java

Code:
REMOVED.

and then compile.

Obviously it's completely unsupported and not my problem if your KoLmafia breaks as a result of this.
 
Last edited:

dj_d

Member
As with many Mafia limitations, you're right - it's easy to circumvent them. But I prefer not to, as it seems like bad juju, and makes it much harder to keep builds up to date.
 

lostcalpolydude

Developer
Staff member
Catch-22, I reported your post so it could be deleted, because posts about circumventing hard-coded limits generally aren't appreciated. Since your post was in fact deleted, obviously someone with forum power agreed.
 

Catch-22

Active member
Catch-22, I reported your post so it could be deleted, because posts about circumventing hard-coded limits generally aren't appreciated. Since your post was in fact deleted, obviously someone with forum power agreed.

Sorry incon_muppet, looks like an admin did delete my post last time and I wasn't going crazy.

Are you accessing KoLmafia from a network share? As far as I know, an NTFS junction will not work across a network share.

I guess the next best way is for you to make a copy of the entire KoLmafia folder on to each of the computers you are using, instead of running KoLmafia from a central location.
 

holatuwol

Developer
Actually, the suggestion about the NTFS junction was to do it against a Dropbox'd folder, not against a file share.

It works out pretty well if you're just trying to share scripts, or if you want to keep session logs sync'd across machines. You also get the benefit that you won't have to worry about your settings overriding someone else's settings and/or corrupting them due to two KoLmafia instances trying to hit the same settings file.

Which is the secondary reason why that code is still there and the limit isn't bumped to three. The fewer the number, the less likely some random corruption occurs.
 

Bale

Minion
Wait! You admit that two kolMafia instances trying to hit the settings file at the same time can corrupt it! Yay!
 

Camber

Member
Not a surprise, but could explain some poeple's problems with corrupt settings files. I thought i could only run 1 instance of mafia at a time, so i never had any settings corruption problems (knocks on wood).

So now the dilemma; do i expand to 2 sessions of mafia and risk a corrupted settings file, or stay the course i've been on these last 3 years...
 

Heffed

Member
I seem to recall over a year ago before I went on hiatus, Holatuwol announced that KoLmafia officially now only supported a single instance for this reason. Was it stepped back up in the interim, or is two instances simply "unofficial"? (Or am I misremembering?)
 

holatuwol

Developer
KoLmafia allows for two, due to some operating systems leaving files locked for a few minutes after the process terminates. In those cases, only allowing for one would mean you'd have to wait a few minutes after exiting KoLmafia to start it up again.

We strongly recommend against running more than one, though.
 

dj_d

Member
Good to know. I didn't realize that I was off in Unsupported Land. I usually run each instance with a separate folder, though, which is why (I guess) I haven't hit it.
 

Catch-22

Active member
You can run as many instances of KoLmafia as you want if they are in separate folders, they won't affect each other.
 
Top