neromir/AfkBooter — pull request #1 by morganm (2011-12-18 06:26:04+00:00)
Title: AfkBooter PLAYER_MOVE performance improvement

I've been on a mission to eliminate all PLAYER_MOVE plugins and since I've dumped most of them, on my humble little VPS server I've gained about an additional 25% player headroom due to performance gains.

I noticed from the AfkBooter config that it was probably hooking PLAYER_MOVE directly and so I finally peeled open the source to check. I had written a Movement tracker class for another plugin, so I dropped that in and was able to disable PLAYER_MOVE in AfkBooter and still achieve the same effect. This is a large performance boost since instead of having to update the hash every time a player moves even a tiny bit (possibly multiple times per second per player), it just updates it on a regular cycle and even that on a separate async thread, so main thread performance is not impacted at all.

Additionally, I fixed a problem players have been reporting forever on my server, which is if they are just standing in one spot chatting, they still get booted. This is because I use HeroChat and it turns out HeroChat sets cancel to true on the CHAT event (not sure why..). So I removed the isCancelled() check and now people aren't getting kicked just for chatting.

Running it on my server now, it works great with these changes. Pushing it upstream in case you want to incorporate it and share it with your other users. Probably be nice to have an update for RB #1597 anyway so it doesn't get set inactive.

Thanks for the plugin, good, clean, well-documented code.