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]
Is there any possibility that you could make it so you can disable any of the checks?
For example, in my case I am only interested in the playtime but not deaths, kills, move distance etc etc.
Could you add a feature to show activity in a certain span? Say I want to know how active player A has been in the in the last week. /playtime sum t:7d playerA or /playtime sum date1 date2 playerA and you get the activity between date1 and date2
Hey, when trying to use this via the console I'm getting a permission error. Any way to fix this?
Edit: It only seems to be on some commands like lastonall but playtime top seems to work.
However trying to do anything like /playtime top place 5 world caused the below error
[WARNING] Unexpected exception while parsing console command org.bukkit.command.CommandException: Unhandled exception executing command 'playtime' in plugin PlaytimeTracker v0.6 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:163) at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:355) at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:351) at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:506) at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374) at net.minecraft.server.ThreadServerApplication.run(SourceFile:417) Caused by: java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Long at moc.PlaytimeTracker.PlaytimeTracker$CustomComparator.compare(PlaytimeTracker.java:164) at moc.PlaytimeTracker.PlaytimeTracker$CustomComparator.compare(PlaytimeTracker.java:1) at java.util.Arrays.mergeSort(Arrays.java:1283) at java.util.Arrays.sort(Arrays.java:1223) at java.util.Collections.sort(Collections.java:176) at moc.PlaytimeTracker.PlaytimeTracker.onCommand(PlaytimeTracker.java:257) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40) ... 7 more
MC: 1.8.1 Bukkit: 1337
Could you just give all permissions to op ?
@Vejnemejnen
I use PermissionsEx. I'm not doing anything all that fancy with permissions at the moment.
What permission system does it use ?
Cool. I will install this and make a web page to display information from it.