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]
@cwingrav
Do your plugin suppot the color code. Become it do not read the color code. I use EssentialsChat.
Here what it look like:
and I have error of null. Here the link of the errors.
http://pastie.org/4662314 and http://pastie.org/4662321
I use the MySQL.
Thank to read it.
@bjornleijdstrom
There is some error @ bootup. It might not be spewing an error, but there is one someplace. I'll do some stuff tonight and see if I can get a better instrumented version to you to test.
Hmm, are you using MySQL or SQLite?
Can you at least copy and paste the boot messages for MOCDBLib and MOCPlaytimeTracker? That would help me out.
Thanks for all the help with this one.
@cwingrav
Sorry about that; using the recountall-command gives me this: http://pastebin.com/f7LWBStG
No error on bootup.
@bjornleijdstrom
Hmm, not giving me much to work with. Are there any errors in the log file on bootup? Can you run any of the playtime commands (i.e. it did load)? Can you try running the /playtime recountall? Did you update the MOCDBLib?
Seems like 1 of my players doesnt get tracked anymore; he is online almost every day, but I cant find a record of him in the database for the last 30 days. All other players seem to work fine though. No errors :/
Correction; now i realized none of the users is updated since I updated the plugin 4 days ago to latest version.
@weja93
The permissions allow you to turn off "top" and checking on players other than yourself but they are on by default. I'll mess with permissions somewhat. Also, I too have seen that null command since releasing it. I'll check on that too. Looks like v10 is not too far away.
Ty for feedback.
Getting this error with the newest build, also have library updated:
2012-08-30 19:00:16 [SEVERE] null
org.bukkit.command.CommandException: Unhandled exception executing command 'playtime' in plugin MOCPlaytimeTracker v0.9
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168)
at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:492)
at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:878)
at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:825)
at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:807)
at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:44)
at net.minecraft.server.NetworkManager.b(NetworkManager.java:276)
at net.minecraft.server.NetServerHandler.d(NetServerHandler.java:109)
at net.minecraft.server.ServerConnection.b(SourceFile:35)
at net.minecraft.server.DedicatedServerConnection.b(SourceFile:30)
at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:581)
at net.minecraft.server.DedicatedServer.q(DedicatedServer.java:212)
at net.minecraft.server.MinecraftServer.p(MinecraftServer.java:474)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:406)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
Caused by: java.lang.NullPointerException
at moc.PlaytimeTracker.PlaytimeTracker.getPlayerIfExists(PlaytimeTracker.java:1136)
at moc.PlaytimeTracker.PlaytimeTracker.onCommand(PlaytimeTracker.java:377)
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40)
... 15 more
I also have a suggestion. Remove every other feature than playtime. Why? People will find this plugin only if they search playtime. They probably do not want any other features, and the features will just increase the load for the server. This is what happened to me.
Or make them configurable, so you can disable them :P
Ok, testing 1.3 version on my server now. Many behind the scenes changes. Anyone want to try a dev version? Current version works ok for me on 1.3. Also, will have to update the MOCDBLib for this to work.
@Geekin_It_Up
Please clarify.
@cwingrav I am using version 0.8 and been using it all time, started using it at that version :)
It does not work in 1.3.1/.2. so could u update??
@weja93
It does "self-heal", but much of that was in the most recent version. What version are you using? (i.e. unzip the jar and look at the plugin.yml file).
I hope that the plugin would detect "bugged" players somehow and probably reset their time.
It's quite frustrating to see that top 5 players have been server once and then left, and finding the names from mySQL databases is pretty much pain, though possible.
Thanks for replying, I like this plugin alot, and waiting few more days/weeks will be worth it :)
@weja93
Thanks for the feedback. RL keeping me busy and my server hasn't been upgraded so I haven't tested on 1.3 yet.
@lme999
Yup. Read the installation instructions again and look especially at step 2. Also, see the troubleshooting steps. Barring this, send me the full error logs.
Downloaded the plugin. put it into my plugins folder then started the server to create config file. File was never created and this is what appeared in the console/server logs.
[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:222) at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:198) at net.minecraft.server.ServerConfigurationManagerAbstract.<init>(ServerConfigurationManagerAbstract.java:50) at net.minecraft.server.ServerConfigurationManager.<init>(SourceFile:11) at net.minecraft.server.DedicatedServer.init(DedicatedServer.java:105) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:378) at net.minecraft.server.ThreadServerApplication.run(SourceFile:539) 2012-08-21 01:47:41 [SEVERE] ebean.properties not found 2012-08-21 01:47:41
Any ideas how to fix it?
Yes it works with 1.3.2
I am getting now daily bugs when the playtime doesn't stop when people go offline.
"/playtime top" shows only some bugged players who have visited server once and left.
Time keeps counting even if they aren't online.
does the most recent update work for minecraft 1.3.1/1.3.2?
Waiting for the update for "/playtime" for one month, and other suggestions :/
Awesome. Thanks for checking on 2 servers. I'll look into the materials. Sounds just like what I was expecting. - cheers