=Extras=

== Multi-Server Universe Support ==
For MC universes that expand across multiple servers, it is possible to share one MySQL database between these severs, such that there is only one record of play time regardless of the server a player is using.  **This function REQUIRES the use of MySQL data storage option.**\\
\\
Setting this up is very simple.  In the /ontime/config.yml file there is one parameter that needs to be set for each server.\\
===== from config.yml ======
{{{
# Set 'true' if running OnTime in a single-server MC environment, or if this is designated the 'primary' server in 
# a multi-server MC environment where servers are sharing one MySQL database.  In the multi-server environment there
# should be only ONE of the servers designated as 'primary'
primaryServer: true
}}}

The OnTime plugin must be installed on all of the servers, and the /ontime/config.yml files should be (for the most part) identical on each, but the above parameter must be set properly on each.  As stated above, one of the universe's servers needs to be designated the //primaryServer// (set to true) and the rest of the servers not (set false).  This will make sure that only one of the servers is updating the rollover to a new day, generating reports, etc.\\
\\
For more standard, single server universes, this parameter should be set to **true**.
\\

== Data Import ==
It is possible to create a //total OnTime// data file from another plugin, database, or hand edited file.  Currently //OnTime// supports import from a .yml file, and from the [[http://dev.bukkit.org/server-mods/logblock/|//logblock//]] plugin.  

=== Import from .YML ===
To use the .yml file import, an admin must first get the source data into the format see on the [[http://dev.bukkit.org/server-mods/ontime/pages/import-yml/|import.yml]] page.

The general format is a data pair of 'playername, time', where 'playername' is the players login ID, and 'time' is the //total OnTime// to be set for that player.  'time' can be in either units of seconds or milliseconds, and this choice is set within the .yml file.

This file can have any name but should have a .yml extension, and it must be placed in the /plugin/OnTime directory.

When imported, a player's 'last login' will be set to the time of the import.  If players already exist in the OnTime data files, their //total OnTime// and last login will not change unless the administrator specifies 'replace' in the import command.
\\
=== Import from the //logblock// plugin. ===
It is also possible to import from the MYSQL database created by the[[http://dev.bukkit.org/server-mods/logblock/| 'logblock' plugin]].  To perform this import the MYSQL database must first be **enabled** and defined via the ontime/config.yml.  \\

=====from config.yml=====
>~# MySQL - This must be enabled and properly set up if MySQL is to be used for data storage and/or\\
>~#		  data import is to be done from another plugin MySQL table.  (currently support for LogBlock is provided)\\
>MySQL:\\
>>  enable: true\\
>>  host: localhost\\
>>  port: 3306\\
>>  user: root\\
>>  password: password\\
>>  database: minecraft\\
\\
Once defined the import is simply an execution of the command:\\
> **/ontime import logblock**\\
\\
OnTime records will be created in memory for all players included in the MYSQL [[http://dev.bukkit.org/server-mods/logblock/|//logblock//]] 'lb-players' table, and the data imported includes both the total playtime, and time of their last login.  If players already exist in the OnTime data, their //total OnTime// and last login will not change unless the administrator specifies 'replace' in the import command. (**/ontime import logblock replace**)
\\
\\
For both the YML and [[http://dev.bukkit.org/server-mods/logblock/| logblock]] imports the data only resides in memory after the import is executed, therefore it is recommended that the administrator also execute the command **'/ontime save'**, to insure the data is also saved to disk.
\\
\\
== Data Export ==
The data export function's main purpose is to allow administrators to move from one storage method to another within OnTime.  Its also possible that this could be used to allow access to the OnTime data from other plugins.  To make a conversion from one storage method to another the steps are as follows:
> Example: moving from DAT to MYSQL
# In the /ontime/config.yml file set the parameter: "dataStorage: DAT"
# In the /ontime/config.yml file set the parameter: "MySQL.enable: true"
# In the /ontime/config.yml file set the MYSQL parameters per definition of your MYSQL database.
# Start the server
# From the console or in game execute: "/ontime export mysql".  This will create the ontime table and populate it with date pulled from the original .dat files.
# In the /ontime/config.yml file set the parameter: "dataStorage: MYSQL"
# Restart the server
\\

== Away From Keyboard ==
//OnTime// can be configured to track a player's 'Away From Keyboard or AFK' time.  If a player takes no actions or makes no movement for a configured amount of time, //OnTime// will consider the player to be AFK.  When 'AFK', the player's playtime will be rolled back to the time of their last activity or the time they last received an //OnTime reward//. (Rollback to the last reward will prevent a player from receiving the same reward twice.)  While 'AFK' the player will not receive any rewards, if rewards are configured.  
\\
\\
== Configurable Output ==
The file 'output.yml' pretty much holds all of the instructions needed to take advantage of the configurable output.  This YML file defines the message that should be sent to the player for each different reward they receive. It also defines the content displayed to a player when they use the 'ontime' and 'ontime <playerID>' commands.  Now the administrator can change just how much OnTime information a player is exposed to.
\\
\\
The configurable output also lets the admin setup the header and colors used in the "Top xx" displays.  And there are a few other configurable options in there.
\\
\\
If you like the default messages that come with the plugin there is no reason to ever have to edit this file, but if you do, remember it is a YML file and it is very context sensitive.  Which means always remember to use 'spaces' and not 'TABs' in this document.
\\
\\
== Log File: ==
It is possible to enable a logging function which will save OnTime-based information in a file found at /plugin/ontime.  There are three levels of logging messages defined within the plugin providing some configuration to the detail logged.  The level used on your server is defined in the plugin //config.yml//. 
\\
\\
 The information provided This file will contain:
\\
>Level 3 (High Level)
>* Rewards Issued: player name, reward, reward time
>* 'set', 'add', and 'remove' commands executed
>* Error Messages: varies
\\
>Level 2 (Medium Level) (Will also include Level 3 messages)
>* Defined reward levels loaded at plugin startup: reward, reward time
>* Player data purged due to player inactivity on the server.
>* Player data purged due to too short of a total OnTime period
\\
>Level 1 (Low Level) (Will also include Level 2 and 3 messages)
>* Player login events: Timestamp, user name
>* 'Test' player login event: Name
>* Player quit events: Timestamp, user name, total OnTime
>* 'Test' player logout event: Name, total OnTime
>* Player kick events: Timestamp, user name, total OnTime
>* OnTime Rewards configured at server start: reward time, reward value
>* OnTime Rewards scheduled on player login: player name, reward value, reward issue time, reward delta time
\\
\\
== MCStats ==
Support of [[http://mcstats.org/|MCStats ]] allows us (me really) to collect statistics on the usage of the OnTime plugin.  Currently it is only collecting number of servers, number of players, OnTime Versions in use, and similar high level statistics.  The way this system works is that your server will be sending anonymous data to the MCStats collection, where you and I can see just how popular OnTime has become!  Later I would like to expand the data collected so I know what parts of OnTime are used and not used to help me know where to improve, and possibly remove (unloved) features.\\
\\
If you are uncomfortable with participating in this data collection activity it is simple to turn it off.  But I would greatly appreciate it if you let this data be collected as a small "thank you" for all the time and effort I have put into this plugin.\\
\\
To disable MCStats edit the \plugins\PluginMetrics\config.yml file, and set "opt-out:true".\\
\\
