Feature - Implemented Log when a client session starts and ends

Irrat

Member
This is somewhat niche in use, but currently if a player restarts mafia you have no way to tell if they did so as far as I can tell.

Everything that is written to log seems to be non unique and can be replicated by a command invocation.

The use case for this was kolfix, a script that aims to recover your account when preferences were corrupted.
In that case, I wanted to detect the last logs printed before the client crashed. This is for collecting the preference changes from the start of the day and up to the moment I crashed. I wanted to ignore everything after the crash.

Obviously you need a cutoff so that something like a daily preference isn't inaccurately reset as it had changed when I logged in after the crash. And although you could figure this out from some incidental text... Nothing reliable as far as I can see.

So I was thinking that it could be logged to session logs when the mafia client logs in and out. I don't mean kol log in and out, if you kept mafia running over rollover then it would not log that either. Instead the session log would only note that you never logged in, but you did log out later on.

Another thought on this is simply logging "started writing to session file" and "stopped writing to session file". So if you stayed logged in over rollover, it would both write that to yesterdays file and also to today's file.

Logging when a kol login.php occurs strikes me as somewhat useless. You log in all the time for harmless reasons. From being inactive to trying to get a better ping.
 

fronobulax

Developer
Staff member
I'm not following this. When I run KoLmafia, do things, and am not logged in, nothing about my action is written to a session log. Whenever I log in there is some text written and a human can find a point where everything before that point happened in a different login session from everything after that point. If I change characters then different logs will be involved (which tangentially would make recovering Global preferences interesting).

That said, if you are looking at a two line change that emits a time to the session log during (character) log in and log out then that seems to me pretty non-intrusive and you could just write the PR...
 
Top