PlayTime
Playtime is a plugin for tracking numerous times for particular players. Currently within its release stage, it can track the time that a player has been online, been alive for, and how long they have played on the server in total. It currently supports three forms of data management, which are MySQL, SQLite, and flat file storage using yaml files. There is also tracking of AFK players (if you wish to enable it), and I try to keep everything within this plugin as configurable as possible. Please, if you have any type of feedback at all, don't hesitate to leave a comment! I usually try to add new ideas within a week of requesting it if I deem that it is appropriate for the plugin.
News: Playtime-2.0.0!
There are plans for an upcoming re-write of the Playtime plugin in its entirety! You can view the notes on this update at the link below:
http://dev.bukkit.org/bukkit-plugins/playtime/pages/development/#w-upcoming-features
This will add some major overhauls, including an incredible re-write of the event system, finally fixing the event system to allow for player-defined events after a certain time period.
Have questions on the update, or need help with the plugin in general? Leave a comment below or feel free to talk to me direct via IRC: #codelanx
Updating to Playtime 1.4.1+
Note that v1.4.0 introduces an event system with a few example events placed in. If you would not like any events to be used at all, simply remove everything in the events.yml file and save it as blank.
Installation
- Download the jar file and put it in your plugin folder
- Start your server
- PlayTime has generated a config.yml in your plugins folder, customize it so it can connect to your database
- Restart your server
Requirements
Java 6 or higher
Features
- Logs PlayTime for users currently online, updates it every minute
- Logs the PlayTime in a MySQL database
- Looking up your own play time with a command
- Look up up someone elses play time with a command
- See how long since your last death
- See how long since someone else's death
- Stop tracking the time of AFK players
- Flatfile support (yml files) - Deprecated, will return in the future
- SQLite support
- Dynamic configuration updating
- Asynchronous data management
- Time spent online since login
- Other languages - Currently supported: en_US (English), de_DE (German)
- Firing Console commands when a time is reached
- Add top for total time played
- Add command to switch between data managers
- Automatic updating and version checking. This is possible to disable under the "update" section of the config. For more information, read the Configuration page
For a full list of upcoming features, feel free to look here: http://dev.bukkit.org/server-mods/playtime/pages/development/
Metrics Stats
Playtime uses metrics, which keeps track of information such as OS, player count, java version, and other specific information in an anonymous fashion. You can view the collected information by clicking the graph below, and it is used for any potential future development for specific groups that develop within statistics:
This can be disabled in the Metrics configuration for all plugins, under plugins/PluginMetrics/config.yml , and set "opt-out" to true. Keep in mind this will make your server not report any information, and I love stats almost as much as cats </3
For now, the plugin is 50% broken. It defaults to SQLite even though It was set to flatfile in config, (by default) then when it goes to fire an event,
06:54:22] [pool-5-thread-1/INFO]: [PlayTime] AFK check initiated [06:54:22] [pool-5-thread-1/INFO]: [PlayTime] Updating location for ZizzyDizzyMC! [06:54:23] [pool-5-thread-4/INFO]: [PlayTime] Open SQLite connections: 1 [06:54:23] [pool-5-thread-4/INFO]: [PlayTime] Open SQLite connections: 0 [06:54:23] [pool-5-thread-3/INFO]: [PlayTime] SQL Query for update:\nINSERT OR IGNORE INTO `playTime` SELECT NULL AS 'column1', 'ZizzyDizzyMC' AS 'column2', 0 AS 'column3', 0 AS 'column4', 0 AS 'column5' [06:54:23] [pool-5-thread-3/INFO]: [PlayTime] SQL Query for update:\nUPDATE `playTime` SET `playtime`=`playtime`+1, `deathtime`=`deathtime`+1, `onlinetime`=`onlinetime`+1 WHERE `username` IN ('ZizzyDizzyMC') [06:54:23] [pool-5-thread-3/INFO]: [PlayTime] Open SQLite connections: 1 [06:54:23] [pool-5-thread-3/INFO]: [PlayTime] Updating values for {0}! [06:54:23] [pool-5-thread-3/INFO]: [PlayTime] Open SQLite connections: 0 [06:54:35] [Server thread/INFO]: ZizzyDizzyMC issued server command: /playtime [06:54:35] [Server thread/INFO]: [PlayTime] Open SQLite connections: 1 [06:54:35] [Server thread/INFO]: [PlayTime] Open SQLite connections: 0 [06:55:10] [Server thread/INFO]: [m[New] ZizzyDizzyMC[m: chat[m [06:55:22] [pool-5-thread-5/INFO]: [PlayTime] AFK check initiated [06:55:22] [pool-5-thread-5/INFO]: [PlayTime] Updating location for ZizzyDizzyMC! [06:55:23] [pool-5-thread-2/INFO]: [PlayTime] Open SQLite connections: 1 [06:55:23] [pool-5-thread-2/ERROR]: [PlayTime] java.sql.SQLException: no such column: 'playtime' [06:55:23] [pool-5-thread-2/INFO]: [PlayTime] Open SQLite connections: 0 [06:55:23] [pool-5-thread-6/INFO]: [PlayTime] SQL Query for update:\nINSERT OR IGNORE INTO `playTime` SELECT NULL AS 'column1', 'ZizzyDizzyMC' AS 'column2', 0 AS 'column3', 0 AS 'column4', 0 AS 'column5' [06:55:23] [pool-5-thread-6/INFO]: [PlayTime] SQL Query for update:\nUPDATE `playTime` SET `playtime`=`playtime`+1, `deathtime`=`deathtime`+1, `onlinetime`=`onlinetime`+1 WHERE `username` IN ('ZizzyDizzyMC') [06:55:23] [pool-5-thread-6/INFO]: [PlayTime] Open SQLite connections: 1 [06:55:23] [pool-5-thread-6/INFO]: [PlayTime] Updating values for {0}! [06:55:23] [pool-5-thread-6/INFO]: [PlayTime] Open SQLite connections: 0
like, come on. Really? Defaulting to SQLite even when I told it flat file? I don't have the time to set up another server besides the MC one. So I guess I'll have to go without this plugin.
EDIT: Dear god, please remove the default 'Flatfile' from config if it's not supported lmao. I hooked it up to my website's mysql server and it works fine. Events do NOT work with sqlite. You WILL need a MySQL server for events to work. Sadly this is the only plugin capable of performing complex commands based on player playtime. (So I have no choice but to use it.)
@Ciysco
What he could do possibly is just make it check a permission before it fires x command. Look at MrCookieSlime's CommandOveride plugin. It's a beast of a plugin but so simple to config.
Another suggestion
Maybe some developpers would be happy to help you to post 2.0, so if you are working on it, may you post your current code on github, so anyone can help to develop the project quicker?
Thanks :)
A Suggestion
I would love it if i could give permissions to different ranks to receive different events. E.g. - everyone gets 100 coins for every hour of playtime. But those who already have over 40 h of playtime will recieve 250 coins for every additional hour. How you could implement this is add custom permissions, like playtime.event.perHour and the group/player with that permission will receive rewards from the event called "perHour".
To achieve what I've put in the example above, one would set up their permission groups like so: Default:
- playtime.event.perHour (to receive rewards per hour played)
- playtime.event.getTrusted (to receive Trusted rank after 40h, according to event called "getTrusted")
Trusted:
- -playtime.event.perHour (to remove previous rewards from event "perHour")
- playtime.event.perHour2 (to receive another amount per hour).
Of course, this could be used for many other things, not just cash per hour for different ranks. I'd love to see this feature in v2.0.0, and hope you take this suggestion into consideration ;)
I suppose some people are curious about what happened to this project, I just wanted to post now that I'm going to do a 2.0.0 release soon (I am transferring servers of work, I'll be working at Hypixel come April). This new version will be using CodelanxLib so it won't take long to push out.
@LeeTheENTP
I'd love a copy of the report!
This plugin caused my server's Java instance to crash. No, it didn't crash the server, it crashed Java.
UUID support is a must.
Is this going to be updated for UUIDs?
Also can anyone provide me with a Web UI?
v2.0 coming?
Is there a way to edit a player's time? I installed this plugin and everything works fine, however it obviously has only been tracking player times since it was installed. If possible I would like to be able to edit the playtime of the players on my server since some of them have played over 500 hours before this plugin was installed.
I think there is no support anymore for this :(
Is there still support for this plugin? I would still like to know how to stop it from freezing. My server restarts twice a day and yet it always freezes around 11 hours of running.
How to make that stats will be continuing after server restart ? I would like to control other Moderators how much time they spend on server.
After 24hours the playtime stops...
For example: i do /playtime NoHoPeLess >> 1 hour after 10-15 Minutes i do : /playtime NoHoPeLess result in: 1 hour ...?
When i reload the plugin (after 24h) it works normal... dont know why
Hey there :P Possible Feature?
Do you think it will be possible to add a feature or a file where you can view a list or the whole database at once of a certain group of players like e.g. Mods, and the data associated with it?
This would help a lot to manage one's staff on a server.
@1Rogue
Feature request for a future update. Could you add an option to NOT use the scoreboard for displaying information? Partly because I have a lot of minigames that use the scoreboard, but also because the scoreboard itself is buggy with spigot and sometimes doesn't work. Whispers, in-game screen display or console display would be fine, but an option for a text file output to the plugin directory would be ideal.
Also, I would prefer to keep the totals private since I really don't want people to get competitive about who spends the most time on the server. I don't want a server full of afkers just trying to get the most time in.
Other info that might be useful would be tracking of what times of day players are on the most (individually and as an aggregate.) What percentage of players are logging in for the first time, play for less than say 10 minutes and are never seen again (i.e. bounce rate) Any ability to output this to a graphable format would be even more help (everyone loves graphs and pie charts, no?) Website integration would probably be asking too much, but hey, I figured i would put it out there :)
Keep up the good work, thanks for the consideration and good luck with the next build.
@CloudeLecaw
For 2.0.0 I plan to implement a library I've been developing for a while now (Shaded, so it won't be required for a server). With the lang system there, I will no longer be maintaining multiple languages, but users will be able to change every aspect of the plugin's output to players.
When you see the "[Playtime] null", it sounds like Playtime is suppressing a non-specified error (which debug level 3 would show the full output of).
Events are completely broken, and are disabled as of Playtime 1.5.0. You can expect them to make a better return in 2.0.0 which should help with fixing all of the bugs currently withstanding.
1.5.0 is almost finished, but will require a bit of time to update the database (since it has to fetch all the UUIDs from mojang that it can't find locally).
Expect Playtime release 1.5.0 sometime this week with UUID support, and soon after 2.0.0 should be following up with events (and a lot of other stuff) fixed!
when can we expect an update because I'd really like my events to work
@TJM4
I believe that is already integrated through playtime "events".