Bug - Not A Bug Mafia and relay browser ports

Hello.

I use KOLMafia+Relay browser since... well, always. 8 years at least. For all this time it used http://127.0.0.1:60080 to connect to Mafia. No more. In last several months (I suspect it's "since migration" actually, but I can be wrong), my only TamperMonkey script sporadically stopping to work, and my Opera ask for confirmation for relay page. I attributed it to Opera changes up to late. Then, when in the same day the same script worked at home Opera and didn't work at my workplace (same Windows, same Opera, same instance on the USB-stick), I decided to check it more thoroughfully.

Reason was ridiculously simple: now Mafia gives different ports to the relay browser on connect. For the last three days it was 6080, 6081 and 6082. It may be more, as I never thought to watch it.

Can I change this behavior somehow, please?
 

Ryo_Sangnoir

Developer
Staff member
It tries 60080 first. If something's running on that port, it tries 60081, then 60082, and so on up to 60090, after which it fails to start the relay browser.

If it's not succeeding on 60080, something probably has that port locked somehow. Try restarting your computer. On Windows, this should be a hard reboot: make sure you do "start -> restart" instead of "start -> shut down", as the latter saves some state to disk, and you don't want that.
 

Veracity

Developer
Staff member
It is working exactly as it has worked for years. Your observed behavior is Not A (Kolmafia) Bug.
 

AlbinoRhino

Active member
I have noticed before that if there is a sudden power loss (we lose electricity too frequently here), the "active_session.1" file will still be present in the sessions directory. So, starting mafia w/o deleting that file will create "active_session.2" and use the 2nd port number. Easy solution is to close any instances of mafia and then delete any "active_session" files. Then restart to be back on the usual 1st port.
 
Top