プレイヤーのオンライン時間とプレイ時間を集計するプラグイン
- BungeeCord
- Spigot (AFK連携を使用する場合)
- 連携プラグイン (オプション)
- AFKPlus (AFK判定の連携)
- ConnectorPlugin (ブリッジ通信)
- BungeeTabListPlus (プレースホルダ連携)
コマンド / 別名 | サブコマンド | 権限 | 許可※1 |
---|---|---|---|
/playtime [player] /pt 実行者のプレイ時間 |
bungeeplaytime.command.playtime | YES | |
/playtimetop /pttop, /pt top プレイ時間ランキング |
bungeeplaytime.command.playtimetop | OPのみ | |
/onlinetime [player] /ot 実行者のオンライン時間 |
bungeeplaytime.command.onlinetime | YES | |
/onlinetimetop /ottop, /ot top オンライン時間ランキング |
bungeeplaytime.command.onlinetimetop | OPのみ | |
/afkplayers ※1 AFKプレイヤー一覧 |
bungeeplaytime.command.afkplayers | ||
/bungeeplaytime ※1 /bpt 管理者用プラグインコマンド |
info [player/uuid] プレイヤーの情報を表示 |
bungeeplaytime.command.bungeeplaytime | |
〃 | reload 設定の再読み込み |
〃 | |
※1 BungeeCordコマンドのみ |
BungeeCord config.yml | Bukkit config.yml
### BungeeCord config.yml ###
players:
played-in-unknown-state: false
afk-minutes: 5
db-type: mysql
# available: mysql, sqlite
database:
mysql:
username: root
password: "password"
address: localhost:3306
database: "bungeeplaytime"
options:
autoReconnect: true
sqlite:
address: database.db
options:
# Use ConnectorPlugin in API communication
enable-connector-plugin-support: true
Note
データベースに MySQL か SQLite を使用できますが、デフォルトは MySQL になっています。
必要に応じて変更してください。db-type: mysql
- Bungee/Bukkit 共通メソッド - common/IPlayTimeAPI.java
- Bukkit - bukkit/PlayTimeAPI.java
- Bungee - bungee/PlayTimeAPI.java
Player player = Bukkit.getPlayer("Necnion8"); if (Bukkit.getPluginManager().isPluginEnabled("BungeePlayTime")) { PlayTimeAPI api = BungeePlayTime.getAPI(); api.lookupTimeRanking(player.getUniqueId(), new LookupTimeOptions().server("game")) .thenAccept(ret -> { if (ret.isPresent()) { getLogger().info("Player " + player.getName() + "'s rank " + ret.getAsInt()); } else { getLogger().info("No data player"); } }); }