PlayTime

Logo

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.

http://1ro.co/resources/playtime/main_on.pnghttp://1ro.co/resources/playtime/configuration_off.pnghttp://1ro.co/resources/playtime/commands_off.pnghttp://1ro.co/resources/playtime/permissions_off.pnghttp://1ro.co/resources/playtime/development_off.png

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

  1. Download the jar file and put it in your plugin folder
  2. Start your server
  3. PlayTime has generated a config.yml in your plugins folder, customize it so it can connect to your database
  4. 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:

http://mcstats.org/signature/playtime.png

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

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of kwilson7770 kwilson7770 Jun 19, 2015 at 23:50 UTC - 0 likes

    So this plugin keeps track of players time as expected, which I love. Something that is annoying is that the events does not work :/

    Some of the events work without issue. This is at-login and online type of events. However, the most important one for me is the playtime event. This is what my events.yml is set to:

    events:
      beingonlinefortwohourperiods:
        type: onlinetime
        time: 120
        at-login: false
        repeat: true
        commands:
        - 'msg %u Here''s some food for being online so much!'
        - 'give %u 354 2'
      loginmessage:
        type: playtime
        time: 0
        at-login: true
        repeat: false
        commands:
        - 'msg %u You have played for %t'
      promoteateighthours:
        type: playtime
        time: 480
        at-login: false
        repeat: false
        commands:
        - 'pex user %u group set Level1'
        - 'broadcast Congrats on the promotion %u!'
      promoteattwentfourhours:
        type: playtime
        time: 1440
        at-login: false
        repeat: false
        commands:
        - 'pex user %u group set Level2'
        - 'broadcast Congrats on the promotion %u!'
      promoteatthirtysixhours:
        type: playtime
        time: 2160
        at-login: false
        repeat: false
        commands:
        - 'pex user %u group set Level3'
        - 'broadcast Congrats on the promotion %u!'
      promoteatfourtyeighthours:
        type: playtime
        time: 2880
        at-login: false
        repeat: false
        commands:
        - 'pex user %u group set Level4'
        - 'broadcast Congrats on the promotion %u!'
      promoteatsixtyhours:
        type: playtime
        time: 3600
        at-login: false
        repeat: false
        commands:
        - 'pex user %u group set Level5'
        - 'broadcast Congrats on the promotion %u!'
    

    It is rather simple, after a set period of time people will be promoted using PEX and a broadcast will be displayed.

    This is my config:

    general:
      debug-level: 0
    update:
      check: true
      download: true
    language:
      use-github: true
      locale: en_US
    check:
      death-time: true
      online-time: true
    afk:
      enabled: true
      interval: 60
      timeout: 900
      check-chat: false
    events:
      enabled: true
      interval: 10
    data:
      manager: sqlite
    managers:
      mysql:
        host: *******
        port: *******
        database: *******
        username: ******
        password: *****
    

    I left this alone for the most part and for some reason it still doesn't work :/

    Please help or fix whatever is causing the events to not fire off.

  • Avatar of ZizzyDizzyMC ZizzyDizzyMC Apr 10, 2015 at 02:10 UTC - 0 likes

    Events no longer work for me, I didn't change anything they just don't work now. playtime:null

  • Avatar of TheTree2015 TheTree2015 Apr 09, 2015 at 22:27 UTC - 0 likes

    The Plugin is not work for me. The Playtime does not increase.

    [19:19:45 INFO]: [PlayTime] SQL Query for update:\nINSERT INTO `playTime` (`username`) VALUES ('xxxx'), ('xxxxxx'), ('xxxxxx') ON DUPLICATE KEY UPDATE `p laytime`=`playtime`+1, `deathtime`=`deathtime`+1, `onlinetime`=`onlinetime`+1 [19:19:45 INFO]: [PlayTime] Open MySQL connections: 1 [19:19:45 ERROR]: [PlayTime] null [19:19:45 INFO]: [PlayTime] Open MySQL connections: 0

    Plugin-Version: The Version is the github version. Server-Version: CraftBukkit version git-Spigot-8a983f9-e81edfc (MC: 1.8) (Implementing API version 1.8-R0.1-SNAPSHOT)

    A week ago, there were no errors...

  • Avatar of mitchgib mitchgib Apr 08, 2015 at 12:06 UTC - 0 likes

    If i set the AFK to false, does that mean it won't count AFK Time? @1Rogue

    Config: afk: enabled: false interval: 60 timeout: 900 check-chat: true

    Thanks, Olley

    Last edited Apr 08, 2015 by mitchgib: I wanted to Change it...

    http://topg.org/image/180515/40182.gif

  • Avatar of ZizzyDizzyMC ZizzyDizzyMC Apr 05, 2015 at 10:59 UTC - 0 likes

    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]: [New] ZizzyDizzyMC: chat [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.)

    Last edited Apr 05, 2015 by ZizzyDizzyMC
  • Avatar of ZizzyDizzyMC ZizzyDizzyMC Apr 04, 2015 at 23:03 UTC - 0 likes

    @CiyscoMisco: Go

    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.

  • Avatar of gpotter2 gpotter2 Mar 24, 2015 at 12:17 UTC - 0 likes

    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 :)

    Code is code, it is not pizza...

    MY PLUGINS

    ZBDHce8fa6626dc8fdf73e4afa75004d47a1

  • Avatar of CiyscoMisco CiyscoMisco Mar 23, 2015 at 20:07 UTC - 1 like
    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 ;)

    Last edited Mar 23, 2015 by CiyscoMisco
  • Avatar of 1Rogue 1Rogue Mar 16, 2015 at 21:01 UTC - 0 likes

    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.

    @MuricaGaming: Go

    I'd love a copy of the report!

  • Avatar of MuricaGaming MuricaGaming Feb 07, 2015 at 19:26 UTC - 0 likes

    This plugin caused my server's Java instance to crash. No, it didn't crash the server, it crashed Java.

    Don't let anyone look down on you because you are young, but set an example for the believers in speech, in life, in love, in faith, and in purity.
    - 1 Timothy 4:12

    The Murica Gaming Network: muricagaming.com (not completely done; completed parts are open to the public)

    http://i.imgur.com/TclrVjQ.png

Facts

Date created
Aug 10, 2012
Categories
Last update
Jan 21, 2014
Development stage
Release
Language
  • enUS
License
GNU General Public License version 3 (GPLv3)
Curse link
PlayTime
Downloads
19,196
Recent files

Authors