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();
}
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;
}
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());
}
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);
}
}
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);
}
Aggregations