me.armar.plugins.autorank.playtimes
Class Playtimes
java.lang.Object
me.armar.plugins.autorank.playtimes.Playtimes
public class Playtimes
- extends java.lang.Object
|
Method Summary |
int |
archive(int minimum)
Archive old records. |
int |
getGlobalTime(java.lang.String name)
Returns total playtime across all servers
(Multiple servers write to 1 database and get the total playtime from
there) |
java.util.Set<java.lang.String> |
getKeys()
|
int |
getLocalTime(java.lang.String name)
Returns playtime on this particular server
It reads from the local data.yml |
void |
importData()
|
boolean |
isMySQLEnabled()
|
void |
modifyGlobalTime(java.lang.String name,
int timeDifference)
|
void |
modifyLocalTime(java.lang.String name,
int timeDifference)
|
void |
save()
|
void |
setGlobalTime(java.lang.String name,
int time)
|
void |
setLocalTime(java.lang.String name,
int time)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INTERVAL_MINUTES
public static int INTERVAL_MINUTES
data
private SimpleYamlConfiguration data
save
private PlaytimesSave save
update
private PlaytimesUpdate update
plugin
private Autorank plugin
Playtimes
public Playtimes(Autorank plugin)
getLocalTime
public int getLocalTime(java.lang.String name)
- Returns playtime on this particular server
It reads from the local data.yml
- Parameters:
name - Player to check for
- Returns:
- Local server playtime
getGlobalTime
public int getGlobalTime(java.lang.String name)
- Returns total playtime across all servers
(Multiple servers write to 1 database and get the total playtime from
there)
- Parameters:
name - Player to check for
- Returns:
- Global playtime across all servers or -1 if no time was found
importData
public void importData()
setLocalTime
public void setLocalTime(java.lang.String name,
int time)
setGlobalTime
public void setGlobalTime(java.lang.String name,
int time)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
modifyLocalTime
public void modifyLocalTime(java.lang.String name,
int timeDifference)
throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
modifyGlobalTime
public void modifyGlobalTime(java.lang.String name,
int timeDifference)
throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
isMySQLEnabled
public boolean isMySQLEnabled()
getKeys
public java.util.Set<java.lang.String> getKeys()
save
public void save()
archive
public int archive(int minimum)
- Archive old records. Records below the minimum will be removed because
they are 'inactive'.
- Parameters:
minimum - Lowest threshold to check for
- Returns:
- Amount of records removed