=Extras=

== 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 defiend 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