promotional bannermobile promotional banner

WorldTimeTracker

Track Players time in each world

Description

Tracks the time a player spends in each world into an SQL database, useful for giving people different rewards or ranking them up, etc...

WorldTimeTracker is designed to be extremely simple, it stores only what it needs to store, items stored are:

  • Player Name
  • World Name
  • Total Time spent in world

The plugin tracks the total time spent based on a variety of factors, when the player logs onto the server, an in-memory object is set up that matches the table structure, except instead of total time, it merely tracks when they logged on in that particular world.

When the player disconnects, it takes the difference between their connection in that world and their disconnection from that world and adds that to their record in the SQL database.

When the player changes to another world, it goes through the same motions as a disconnection, and then the same motions as a connection but using the new world information.

There should be extremely minimal impact from this plugin, since it only ever updates the SQL database when the player changes worlds or disconnects.

Configuration

config.yml

  • MySQLServer: localhost
  • MySQLPort: '3306'
  • MySQLUsername: <username for db>
  • MySQLPassword: <password for db>
  • MySQLDatabase: <database to use>
  • MySQLTable: <table to use>
  • showDebug: true|false

As per my other plugins that utilise SQL, this plugin will automatically create the table if it doesn't exist, and any table changes that occur in future releases will auto-update the existing table.

Example Usage

Depending on what you want to do, because of how the information is stored, retrieving specific information is very easy, and retrieving total information for a player is also very easy.

One Player - One World

SELECT * FROM WorldTimeTracker WHERE player_name="fred" AND world_name="world"

One Player - All Worlds

SELECT SUM(total_time) FROM WorldTimeTracker WHERE player_name="fred"

Times are all stored as integers, standard PHP date and time functions should be able to turn the integers into meaningful information.

The WorldTimeTracker Team

profile avatar
  • 5
    Projects
  • 35.5K
    Downloads

More from RayHerringView all

  • OnlinePlayersSQL project image

    OnlinePlayersSQL

    • 16.1K
    • Bukkit Plugins

    Keep track of online users for your website

    • 16.1K
    • June 14, 2014
    • Bukkit Plugins
    • +1
  • SlimeChunkDisabler project image

    SlimeChunkDisabler

    • 6.3K
    • Bukkit Plugins

    Disable a slime chunk so that slimes can't spawn in it.

    • 6.3K
    • August 25, 2012
    • Bukkit Plugins
  • Slime Chunk Detector project image

    Slime Chunk Detector

    • 11.0K
    • Bukkit Plugins

    Find out which blocks belong to a slime chunk

    • 11.0K
    • August 25, 2012
    • Bukkit Plugins
    • +2
  • ChatKKiller project image

    ChatKKiller

    • 1.0K
    • Bukkit Plugins

    Stops people from using the &k feature of the chat that creates the scrolling text

    • 1.0K
    • April 15, 2012
    • Bukkit Plugins
    • +1
  • OnlinePlayersSQL project image

    OnlinePlayersSQL

    • 16.1K
    • Bukkit Plugins

    Keep track of online users for your website

    • 16.1K
    • June 14, 2014
    • Bukkit Plugins
    • +1
  • SlimeChunkDisabler project image

    SlimeChunkDisabler

    • 6.3K
    • Bukkit Plugins

    Disable a slime chunk so that slimes can't spawn in it.

    • 6.3K
    • August 25, 2012
    • Bukkit Plugins
  • Slime Chunk Detector project image

    Slime Chunk Detector

    • 11.0K
    • Bukkit Plugins

    Find out which blocks belong to a slime chunk

    • 11.0K
    • August 25, 2012
    • Bukkit Plugins
    • +2
  • ChatKKiller project image

    ChatKKiller

    • 1.0K
    • Bukkit Plugins

    Stops people from using the &k feature of the chat that creates the scrolling text

    • 1.0K
    • April 15, 2012
    • Bukkit Plugins
    • +1