Search in sources :

Example 1 with Metrics

use of org.bstats.bungeecord.Metrics in project Plan by plan-player-analytics.

the class BStatsBungee method registerMetrics.

public void registerMetrics() {
    if (metrics == null) {
        int pluginId = 3085;
        metrics = new Metrics(plugin, pluginId);
    }
    registerConfigSettingGraphs();
}
Also used : Metrics(org.bstats.bungeecord.Metrics)

Example 2 with Metrics

use of org.bstats.bungeecord.Metrics in project HuskSync by WiIIiam278.

the class HuskSyncBungeeCord method onEnable.

@Override
public void onEnable() {
    // Plugin startup logic
    synchronisedServers = new HashSet<>();
    // Load config
    ConfigManager.loadConfig();
    // Load settings from config
    ConfigLoader.loadSettings(Objects.requireNonNull(ConfigManager.getConfig()));
    // Load messages
    ConfigManager.loadMessages();
    // Load locales from messages
    ConfigLoader.loadMessageStrings(Objects.requireNonNull(ConfigManager.getMessages()));
    // Do update checker
    if (Settings.automaticUpdateChecks) {
        new BungeeUpdateChecker(getDescription().getVersion()).logToConsole();
    }
    // Setup data manager
    dataManager = new DataManager(getBungeeLogger(), getDataFolder());
    // Ensure the data manager initialized correctly
    if (dataManager.hasFailedInitialization) {
        getBungeeLogger().severe("Failed to initialize the HuskSync database(s).\n" + "HuskSync will now abort loading itself (" + getProxy().getName() + ") v" + getDescription().getVersion());
    }
    // Setup player data cache
    for (Settings.SynchronisationCluster cluster : Settings.clusters) {
        dataManager.playerDataCache.put(cluster, new DataManager.PlayerDataCache());
    }
    // Initialize the redis listener
    redisListener = new BungeeRedisListener();
    // Register listener
    getProxy().getPluginManager().registerListener(this, new BungeeEventListener());
    // Register command
    getProxy().getPluginManager().registerCommand(this, new BungeeCommand());
    // Prepare the migrator for use if needed
    mpdbMigrator = new MPDBMigrator(getBungeeLogger());
    // Initialize bStats metrics
    try {
        new Metrics(this, METRICS_ID);
    } catch (Exception e) {
        getBungeeLogger().info("Skipped metrics initialization");
    }
    // Log to console
    getBungeeLogger().info("Enabled HuskSync (" + getProxy().getName() + ") v" + getDescription().getVersion());
    // Mark as ready for redis message processing
    readyForRedis = true;
}
Also used : BungeeCommand(me.william278.husksync.bungeecord.command.BungeeCommand) BungeeRedisListener(me.william278.husksync.bungeecord.listener.BungeeRedisListener) Metrics(org.bstats.bungeecord.Metrics) MPDBMigrator(me.william278.husksync.migrator.MPDBMigrator) DataManager(me.william278.husksync.proxy.data.DataManager) BungeeUpdateChecker(me.william278.husksync.bungeecord.util.BungeeUpdateChecker) BungeeEventListener(me.william278.husksync.bungeecord.listener.BungeeEventListener) IOException(java.io.IOException)

Example 3 with Metrics

use of org.bstats.bungeecord.Metrics in project HuskChat by WiIIiam278.

the class HuskChatBungee method onEnable.

@Override
public void onEnable() {
    // Load config
    reloadSettings();
    // Load messages
    reloadMessages();
    // Setup player data getter
    Plugin luckPerms = ProxyServer.getInstance().getPluginManager().getPlugin("LuckPerms");
    if (luckPerms != null) {
        playerDataGetter = new LuckPermsDataGetter();
    } else {
        Plugin bungeePerms = ProxyServer.getInstance().getPluginManager().getPlugin("BungeePerms");
        if (bungeePerms != null) {
            playerDataGetter = new BungeePermsDataGetter();
        } else {
            playerDataGetter = new DefaultDataGetter();
        }
    }
    // Register events
    getProxy().getPluginManager().registerListener(this, new BungeeListener());
    // Register commands
    new BungeeCommand(new HuskChatCommand(this));
    new BungeeCommand(new ChannelCommand(this));
    if (Settings.doMessageCommand) {
        new BungeeCommand(new MsgCommand(this));
        new BungeeCommand(new ReplyCommand(this));
    }
    if (Settings.doBroadcastCommand) {
        new BungeeCommand(new BroadcastCommand(this));
    }
    if (Settings.doSocialSpyCommand) {
        new BungeeCommand(new SocialSpyCommand(this));
    }
    if (Settings.doLocalSpyCommand) {
        new BungeeCommand(new LocalSpyCommand(this));
    }
    // Register shortcut commands
    for (Channel channel : Settings.channels) {
        for (String command : channel.shortcutCommands) {
            new BungeeCommand(new ShortcutCommand(command, channel.id, this));
        }
    }
    // Initialise metrics
    new Metrics(this, METRICS_ID);
    // Plugin startup logic
    getLogger().info("Enabled HuskChat version " + getDescription().getVersion());
}
Also used : BungeePermsDataGetter(net.william278.huskchat.getter.BungeePermsDataGetter) Channel(net.william278.huskchat.channel.Channel) DefaultDataGetter(net.william278.huskchat.getter.DefaultDataGetter) LuckPermsDataGetter(net.william278.huskchat.getter.LuckPermsDataGetter) Metrics(org.bstats.bungeecord.Metrics) BungeeListener(net.william278.huskchat.bungeecord.listener.BungeeListener) Plugin(net.md_5.bungee.api.plugin.Plugin)

Example 4 with Metrics

use of org.bstats.bungeecord.Metrics in project BungeecordPartyAndFriends by Simonsator.

the class Main method onEnable.

/**
 * Will be execute on enable
 */
@Override
public void onEnable() {
    instance = (this);
    shuttingDown = false;
    loadConfiguration();
    try {
        initPAFClasses();
        registerCommands();
        registerListeners();
        new Metrics(this, 508);
        if (getConfig().getBoolean("General.CheckForUpdates")) {
            UpdateSearcher searcher = new UpdateSearcher("Party-and-Friends-Free", getDescription().getVersion());
            ProxyServer.getInstance().getConsole().sendMessage(new TextComponent(searcher.checkForUpdate()));
        }
    } catch (SQLException e) {
        if (e.getMessage().contains("Unable to load authentication plugin 'caching_sha2_password'."))
            initError(e, BootErrorType.SHA_ENCRYPTED_PASSWORD);
        else if (e.getMessage().contains("REFERENCES command denied to user"))
            initError(e, BootErrorType.MISSING_PERMISSION_REFERENCE_COMMAND);
        else
            initError(e, BootErrorType.MYSQL_CONNECTION_PROBLEM);
    }
}
Also used : TextComponent(net.md_5.bungee.api.chat.TextComponent) Metrics(org.bstats.bungeecord.Metrics) UpdateSearcher(de.simonsator.updatechecker.UpdateSearcher) SQLException(java.sql.SQLException)

Example 5 with Metrics

use of org.bstats.bungeecord.Metrics in project LibrePremium by kyngs.

the class BungeeCordLibrePremium method initMetrics.

@Override
protected void initMetrics(CustomChart... charts) {
    var metrics = new Metrics(plugin, 14805);
    for (CustomChart chart : charts) {
        metrics.addCustomChart(chart);
    }
    var isVelocity = new SimplePie("using_velocity", () -> "No");
    metrics.addCustomChart(isVelocity);
}
Also used : Metrics(org.bstats.bungeecord.Metrics) SimplePie(org.bstats.charts.SimplePie) CustomChart(org.bstats.charts.CustomChart)

Aggregations

Metrics (org.bstats.bungeecord.Metrics)14 SimplePie (org.bstats.charts.SimplePie)4 BukkitBridge (codecrafter47.bungeetablistplus.bridge.BukkitBridge)1 CommandBungeeTabListPlus (codecrafter47.bungeetablistplus.command.CommandBungeeTabListPlus)1 SortingRuleAliasProcessor (codecrafter47.bungeetablistplus.compat.SortingRuleAliasProcessor)1 PlayersByServerComponentConfiguration (codecrafter47.bungeetablistplus.config.PlayersByServerComponentConfiguration)1 TabListListener (codecrafter47.bungeetablistplus.listener.TabListListener)1 GlobalServerPlaceholderResolver (codecrafter47.bungeetablistplus.placeholder.GlobalServerPlaceholderResolver)1 ServerCountPlaceholderResolver (codecrafter47.bungeetablistplus.placeholder.ServerCountPlaceholderResolver)1 FakePlayerManagerImpl (codecrafter47.bungeetablistplus.player.FakePlayerManagerImpl)1 UpdateChecker (codecrafter47.bungeetablistplus.updater.UpdateChecker)1 UpdateNotifier (codecrafter47.bungeetablistplus.updater.UpdateNotifier)1 ComponentSpec (de.codecrafter47.taboverlay.config.ComponentSpec)1 ConfigTabOverlayManager (de.codecrafter47.taboverlay.config.ConfigTabOverlayManager)1 JoinedPlayerProvider (de.codecrafter47.taboverlay.config.player.JoinedPlayerProvider)1 PlayerProvider (de.codecrafter47.taboverlay.config.player.PlayerProvider)1 SpectatorPassthroughTabOverlayManager (de.codecrafter47.taboverlay.spectator.SpectatorPassthroughTabOverlayManager)1 UpdateSearcher (de.simonsator.updatechecker.UpdateSearcher)1 de.t0biii.joinmusic.bungee.domain.bStatsCustom (de.t0biii.joinmusic.bungee.domain.bStatsCustom)1 PlayerJoin (de.t0biii.joinmusic.bungee.listener.PlayerJoin)1