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.
can you update this plugin to 1.4.4 or something that supports it, as this plugin somewhat works but generates exeptions like the inventory and disconnect event... this plugin is a must have on my server that does not make lag , but if it breaks I will find a new plugin or find a forked version of this plugin
I love it. Could you add /monitor and /unmonitor commands to add/remove a single player to/from the list of watched players, reguardless of their rank?
We have a player we strongly suspect of griefing, but he's wiley and behaves whenever we are logged in...this plugin looks like just the ticket. Easy as pie to set up, and it's logging away on him (we created a group called "suspect" for which the logging is enabled, and put him in it). One thing though, it appears to be also logging all ops (probably because they inherit all permissions). Am I overlooking something? We'd just as soon not log ops if possible. Great work on this plugin!
@nite2
Just set the permissions to a permission you want to track, for example:
Then use your permission plugin to assign 'activitytracker.tracked' to any groups you want to track. Be careful, many permissions plugins do automatic inheritance, so if you assign this to your lowest guest group, all groups will pick it up unless you apply a negative permission to them.
Regarding your error, it's most likely because the Spout API changed. The latest version I just uploaded (v0.5) doesn't require Spout at all and still logs inventory events, since Bukkit finally added events for this in the newest versions.
@rythar
No, but this is what my other plugin Heimdall was written for and is exactly what it does (notifies moderators if players break blocks not belonging to them).
Eventually Heimdall will include the ability to tune thresholds so you can auto-ban griefers as well, but for now it is simply an effective tool for doing real-time grief detection and notification to your moderators.
Hi! I tried to use ActivityTracker for my small minecraft server v1.0.1-R1 with IC2. It has only 4-5 players on it. And I want to log all chest activity, not only when players access chests, but also what items they are putting inside or withdrawing.
But I cannot understand how do I change config.yml to log all players, not only guests. When I switch on debug, the ActivityTracker writes to console [FINE] [ActivityTracker] isTracked for player CraftPlayer{name=Player1} = false One more problem. I put a command track Player1 and the plugin starts tracking that player. But when I put or get item from chest, I get an error
2012-02-29 07:42:59 [SEVERE] Could not pass event CUSTOM_EVENT to ActivityTracker java.lang.NullPointerException at org.morganm.activitytracker.listener.MySpoutChestAccessListener.onInventoryClose(MySpoutChestAccessListener.java:64) at org.getspout.spoutapi.event.inventory.InventoryListener.onCustomEvent(InventoryListener.java:51) at org.bukkit.plugin.java.JavaPluginLoader$97.execute(JavaPluginLoader.java:945) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339) at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:280) at net.minecraft.server.Packet101CloseWindow.a(SourceFile:16) at net.minecraft.server.NetworkManager.b(NetworkManager.java:226) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:93) at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:550) at net.minecraft.server.NetworkListenThread.a(SourceFile:108) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:533) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:431) at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
Maybe that's because I don't use LogBlock? I use Spout of course, found latest version for 1.0.1. I don't want to use LogBlock, to deploy MySQL.
anyway for this to announce in game if a guest starts destroying blocks not placed by them?
Hey, this is great. Ill have to try this out. This will pair well with your other plugin, LogOres. You do excellent work.