Skip to content

AFK時間と非AFK時間の統計を取るプラグイン for Bungee

Notifications You must be signed in to change notification settings

Necnion8/BungeePlayTime

Repository files navigation

BungeePlayTime

プレイヤーのオンライン時間とプレイ時間を集計するプラグイン

前提

  • BungeeCord
  • Spigot (AFK連携を使用する場合)
  • 連携プラグイン (オプション)

コマンドと権限

コマンド / 別名 サブコマンド 権限 許可※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

API

例: プレイ時間ランクの取得

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");
      }
    });
}

About

AFK時間と非AFK時間の統計を取るプラグイン for Bungee

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages