m0r13 / mclogalyzer

Minecraft Server Log Analyzer
GNU General Public License v3.0
44 stars 20 forks source link

handle_logout not called on certain server shutdowns #13

Closed johnwoltman closed 9 years ago

johnwoltman commented 9 years ago

If a minecraft server is forcibly shutdown, the handle_logout method isn't called, which causes mclogalyzer to report session times were longer than they really were. This is a pretty rare occurrence, but it has happened to me when the minecraft server's watchdog system thought that minecraft should be terminated but never did, so I had to forcibly close it. It would also probably happen if you just power off the computer running the server.

I admit that it's rare, but I modified my fork to call handle_logout when...

  1. The "stopping server" message is found OR...
  2. The watchdog system crashing message is found OR...
  3. The "Minecraft server is starting" message is found.

I didn't make an official pull request because I wasn't sure if my fixes were good. Mclogalyzer reported one of my players was on for 23 hours, because the minecraft server died while he was playing. With my fork, it works correctly for me.

The commit is https://github.com/johnwoltman/mclogalyzer/commit/5ee7fe93b06b5bfcf90d6627b58240a70548b039

barnumbirr commented 9 years ago

:+1: @m0r13 any plans on merging this?

m0r13 commented 9 years ago

Sorry, I'm a bit lazy and busy with other things (also unfortunately I don't have a Minecraft server anymore to use this tool), that's why I completely forgot about this. Of course I can merge this. @johnwoltman your change looks fine. You can create a pull request or I'll merge this manually.