MOC Playtime Tracker
Description:
The Minds of Chimera (MOC) Playtime Tracker tracks time players have been online (total time as well as last time on), as well as useful stats of their activity, in a MySQL or SQLite db. Gives top X reports as well (like top 5 players in time spent playing).
NOTE: Other plugins do this but they either are discontinued, buggy or use flat files. They've done a great job but didn't fit our needs so Playtime Tracker was created to fill our, and hopefully some other people's needs.
Part of the Minds of Chimera Project (dev)
MOCPlaytimeTracker | MOCDBLib | RegenBlock | MOCGoodEats | MOC3DImporter | MOCKiosk | MOCChemistry
See development versions in action on our server: isue-server.eecs.ucf.edu
Features:
- Log time players have been online.
- Report time online as a sum or as the last time they were on.
- Log player activities such as killing mobs and players, placing/destroying blocks, movement, etc.
- Report different player activities.
- Report top X charts of player activities and time online.
- Store data in a database: SQLite or MySQL.
- Uses a caching system to minimize database read/writes and avoid server blocking (darn single threads).
Media:
Demonstration video.
As of version 0.3, it logs player events per world. Here is what the output of: "/playtimetracker user cwingrav world" displays, where the user is "cwingrav" and the world name is "world".
It also lists the top performers in a category.
Commands:
/playtime - Prints amount of time you have played.
/playtime sum - Prints amount of time you have played.
/playtime sum [player] - Prints stats about time spent playing.
/playtime sumall - Prints stats about time spent playing for all players ever logged in.
/playtime laston - Lists last login times of self.
/playtime laston [player] - Lists last login times of the given player.
/playtime lastonall - Lists last login times of all players.
/playtime full - for the player, list their sum and laston
/playtime full [player] - for the given player, list their sum and laston
/playtime stats (player) (world) - prints user states about their activities in the world
/playtime debugon - spews debugging information
/playtime debugoff - stops spewing debugging information
/playtime recountall - forces the database to recount all player entries. Use if something is screwed up for 'sum'.
/playtime help|? - lists help
/playtime top [criteria] [# to print] [world] - Prints the top 5 in the categories this is tracking. Default is top 5 online time.
[criteria] currently include: online, place, destroy, die, moved, pk, hk, fk
pk=player kills, hk=hostile kills, fk=friendly kills (like cows, pigs, etc).
Permissions:
- PlaytimeTracker.admin:
- description: Access to debug and clear the log.
- default: op
- PlaytimeTracker.self:
- description: Gives access to discover the amount of time the player is online.
- default: true
- PlaytimeTracker.player:
- description: Gives access to discover the amount of time a player is online or last on.
- default: false
- PlaytimeTracker.all:
- description: Gives access to discover the amount of time all players are online or last on.
- PlaytimeTracker.top:
- description: Lets people list the top X for a given value.
Installation (and Configuration):
- add the PlaytimeTracker.jar file to your plugins directory.
- add the MOCDBLib.jar file to your plugins directory.
- follow the configuration instructions below if you connect to a MySQL database.
- create the plugins/PlaytimeTracker/DBLib.properties file (running the server once will create this)
- configure these options for your setup. This uses MOCDBLib for this so see its page for further details.
MySQL=false host=localhost database=playtimetracker username=root password=pass port=3306
Troubleshooting
- A common error is to skip the installation of the MOCDBLib.jar plugin.
- Check the server.log file for a list of errors. I try to be descriptive if it fails.
- When reporting a bug, please list a lot message error and information about your database configuration (i.e. MySQL or SQLite).
- /playtime recountall - This is useful if something gets mixed up with the online time counting.
- I'll do my best to help. Cheers.
Feature Requests
- Properties file for setting the names of the databases this is using. This will allow multiple servers to run off the same MySQL server.
- /afk support (interesting, might do but I will have to make a lot of changes to support this and to make sure it doesn't impact the server)
- Log sumall to the server file.
- Track per-world time online. so, /playtime <player> [world]
@R1mP3x
Small updates to craftbukkit rarely break plugins. We're running R2.0 just fine. R3.0 probably won't break anything either.
Will this be updated? I know the update was only today. but i was just curious. I would love to use this
It would be cool if you could make a user could receive a prize for being x from the top.
For example:
At the top
> Prize-> Diamond 2nd> Prize> Gold 3rd> Prize> IronBut these are all custom so you could have prizes for the top 10 people for example.
EDIT: The prize part isn't meant to be crossed out xD
@deltadevil360
Ouch. Thanks for the catch. Issue with the new event system. Corrected in ver .8. ... currently submitted to this site but waiting for moderator approval I guess.
@weja93
Can you give some context to the error? Is it happening continuously? I've only seen that when a player gets disconnected incorrectly and it sends the error once.
[SEVERE] Could not load 'plugins/MOCPlaytimeTracker.jar' in folder 'plugins' org.bukkit.plugin.UnknownDependencyException: MOCDBLib at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:195) at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:207) at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:183) at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:53) at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:156) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:422) at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)
Trololoo I did not read clearly enough :)
You should add that MOCDBlib with the plugin or something, everyone skips that part I guess :P
Getting this error with libraries now, everything is working smoothly though :)
2012-05-13 18:23:34 [SEVERE] Could not pass event PlayerQuitEvent to MOCPlaytimeTracker org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:303) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:459) at net.minecraft.server.ServerConfigurationManager.disconnect(ServerConfigurationManager.java:179) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:698) at net.minecraft.server.NetworkManager.b(NetworkManager.java:234) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:113) at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:169) at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:78) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:551) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:449) at net.minecraft.server.ThreadServerApplication.run(SourceFile:492) Caused by: java.lang.NullPointerException at moc.PlaytimeTracker.PlaytimeTracker.logoutPlayer(PlaytimeTracker.java:678) at moc.PlaytimeTracker.PlaytimeTrackerPlayerListener.onPlayerQuit(PlaytimeTrackerPlayerListener.java:75) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) ... 11 more
Hey! Could you please add prefix-support for the database-tables?
EDIT: Another thing; the posts in the database should have a unique ID-number. Would be nice to keep track of each login with a unique number.
nice!
There's an error in this plugin, regarding mysql, it keeps the player login times but does not seem to keep anything else like blocks kills etc, please help.
@Jungalist81
Hope it helps and glad you are finding it useful. We have a few more interesting plugins out from some of my students.
Also, I corrected those links. THANK YOU for the feedback. Cheers!
I have been looking for a separate plugin that logs how long a player has been on my server. After a week I stumbled across this. Thanks for making this plugin man! Also, thumbs up on the organized project page. Most plugin pages are covered with random big text saying, "NOTE: PLZ READ THIS K BAI!!!!!" Everything you need to know about this plugin is well written here.
Edit: The link you provided on this page to download MOCDBLib isnt working. It sends me to another page with another dl link which is broken. I managed to find the current download here: https://sites.google.com/a/cwingrav.com/moc-plugins/plugins/mocdblib/MOCDBLib.jar?attredirects=0&d=1
Ok, for v 1.2. Sry for delay but our server requires Multiverse and it isn't released for 1.2 yet.
@mcapplbee: hmm... maybe I can get a student on it... lots of things to fix that issue... I just haven't done it. I store raw data for our research so I never bothered to optimize it.
This was a fantastic plugin... but I just looked at the database... Mine has 118,000 entries in the PT_timelog table
Is there any way you could add a flatten command? Or automatically flatten the database routinely?
It would lag the server until it crashed as it tried to compute the top playtime.
Still working on update. Difficult as many plugin authors are in same boat as me so if I get this working on 1.2, I still can't use it on my server to test it. :(
I hope this will be updated as my whole server is based around this plugin.
I'm wondering if anyone knows of a similar plugin that works with the newest recommended build released with 1.2. I set up statistician but cannot figure out how to link it to a webpage either, does this project have a chance of revival or has another plugin with in-game interface surfaced?
thanks, -mini
@mcapplbee
Yup, it isn't optimized for that stuff. One of those cases where it works on our server, and being successful, others need it but they are using it under different constraints. When I get time or a free student, I'll apply some manpower to it.
Project still works on our server under 1.1 R3.
Officially this is inactive, but supposedly it will be updated... /playtime top causes complete CPU saturation and will kick everyone offline.
I think I may have too many players in the database...?
Also, it doesn't care about permissions, pex, whatever. I removed the nodes from the proper ranks and someone without permission typed /playtime top and crashed the server.
This crashes both my home i7 quad core server and my remote minecraft server
Looking forward to this :)
Project is not inactive. Just lots going on. Look for activity soon.