ActivityTracker

ActivityTracker is a plugin I wrote as a stepping stone to an anti-grief plugin I'm working on called Heimdall, which will do hueristic analysis of player activity to automatically detect griefing behavior. ActivityTracker logs all player activities to a single log file (per player) for easy analysis, it's intended use is to be turned on for your "guest" rank so you have a single log of all activity that your guests (often griefers) perform. To accomplish this, it has a permission list and anyone who has those permissions will be tracked, anyone who does not will be ignored by this plugin.

Download v0.5, 3/11/2012

ActivityTracker will hook into LogBlock (if you have it) to determine block owners, and block destruction that is not owned by the player is flagged for easy grep'ing in the logfile:

# grep "NOT BLOCK OWNER" maxx1910.log 
[12/18/11 11:06:53 AM] block broken at {1dot8,x=-1501,y=54,z=1681}, blockType=TORCH, lbOwner=graemejr, blockData=2 ** NOT BLOCK OWNER **
[12/18/11 11:06:59 AM] block broken at {1dot8,x=-1501,y=54,z=1674}, blockType=TORCH, lbOwner=graemejr, blockData=3 ** NOT BLOCK OWNER **

Here is an example of what a log looks like.

With this plugin in place, it's possible to run 'tail -f' on a guest's logfile and watch everything they do from your server command prompt, just as effective as if you were on the server following them invisible. Further, if you do ban them for griefing behavior, you have a single log that tracked everything they did from the moment they logged into your server until they got banned all in one convenient place.

This is NOT a replacement for excellent anti-griefer tools such as LogBlock - in fact this plugin works best when used in conjunction with LogBlock in order to report block owners and easily flag griefing behavior when guests login and start tearing up blocks that don't belong to them.

Installation

  • Download the jar, put it in your plugins directory.
  • Configure the config.yml (copied into place on first run) to your liking.

Performance

Wait, so logging every player action, including movement and block breaks and doing LogBlock lookups for every block?! OMG, that must be SO slow and going to lag!! Wrong. I run this on my own server, which is a humble 4G VPS that maxes out at 20 slots, and I have had no performance impact as a result of running this on my server (full 20 tps with full 20 players). Here's why:

  • This plugin only tracks guests, so it does almost no work for 80% of the server population (usually only 3-5 guests on at a time)
  • Block breaks are stored efficiently in a circular buffer and all heavy lifting is done on another thread, taking advantage of multiple cores and leaving the main Bukkit thread free to run your server.
  • Player movement does NOT hook PLAYER_MOVE. Instead, it runs asynchronously every 5 seconds and records the previous location, tracking and reporting only the difference every 5 seconds.
  • File logging is done using a BufferedWriter so that Java efficiently buffers the writes and doesn't block any threads on file I/O.
  • LogBlock lookups are done in the asynchronous Block thread, but they are further cached in a circular buffer so that multiple lookups on the same block (as happens with ChestAccess logging) does not hit the database more than once.

As you can see, I take the performance of my plugins very seriously, primarily because the humble VPS that my server is hosted on doesn't have a lot of extra power for wasteful processing, so I choose my plugins very carefully and write my plugins with performance in mind from the get-go.


Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files

Bukkit