Introduction
BungeeTimeTrack offers a simple way to track the playing time of all players on a network. The special thing here is that the plugin only needs to be on the proxy and not on every sub-server. The play time is stored in a MySQL database and can be retrieved for example on a lobby server using the built-in API. It is very easy to set up, very performant and is 100% configurable via a config.
Features
• Easy to set up
• Fully customizable
• DeveloperAPI
• Supports BungeeCord
• Very performant and stable
Setup
1. Put the plugin inside your Bungeecord plugins folder and enter your MySQL data in the config
2. Upload the plugin to the servers where you want to read the play times from the database, for example a lobby server, and enter the MySQL data in the configuration here as well
3. Follow the API tutorial below to retrieve data and display it for example on the scoreboard
Quick API tutorial
Code (Text):
Gets the playing time of a player in seconds:
TimeTrack.getAPI().getDatabaseManager().getPlayedSeconds(playerName)
Set played seconds of a player:
TimeTrack.getAPI().getDatabaseManager().setPlayedSeconds(uuid, playedSeconds);
Format the seconds:
ShortInteger.getFormatTime(seconds)
Example
Code (Java):
@Override
public List
<String
> getBoardLines
(
final Player player
)
{
final List
<String
> lines
=
new ArrayList
<String
>
(
)
;
lines.
add
(
" "
)
;
lines.
add
(
"§aplayed time formatted"
)
;
lines.
add
(ChatColor.
GRAY
+ ShortInteger.
getFormatTime
(TimeTrack.
getAPI
(
).
getDatabaseManager
(
).
getPlayedSeconds
(player.
getName
(
)
)
)
)
;
lines.
add
(
" "
)
;
lines.
add
(
"§aplayed time in seconds"
)
;
lines.
add
(ChatColor.
GRAY
+
String.
valueOf
(TimeTrack.
getAPI
(
).
getDatabaseManager
(
).
getPlayedSeconds
(player.
getName
(
)
)
)
+
"s"
)
;
lines.
add
(
" "
)
;
return lines
;
}
![[IMG]](/proxy/image?url=https%3A%2F%2Fi.imgur.com%2FKO3cSPc.png)