Search in sources :

Example 1 with PurgeService

use of fr.xephi.authme.task.purge.PurgeService in project AuthMeReloaded by AuthMe.

the class AuthMe method onEnable.

/**
     * Method called when the server enables the plugin.
     */
@Override
public void onEnable() {
    // Load the plugin version data from the plugin description file
    loadPluginInfo(getDescription().getVersion());
    // Initialize the plugin
    try {
        initialize();
    } catch (Throwable th) {
        ConsoleLogger.logException("Aborting initialization of AuthMe:", th);
        stopOrUnload();
        return;
    }
    // Show settings warnings
    showSettingsWarnings();
    // If server is using PermissionsBukkit, print a warning that some features may not be supported
    if (PermissionsSystemType.PERMISSIONS_BUKKIT.equals(permsMan.getPermissionSystem())) {
        ConsoleLogger.warning("Warning! This server uses PermissionsBukkit for permissions. Some permissions " + "features may not be supported!");
    }
    // Do a backup on start
    backupService.doBackup(BackupService.BackupCause.START);
    // Set up Metrics
    OnStartupTasks.sendMetrics(this, settings);
    // Sponsor messages
    ConsoleLogger.info("Development builds are available on our jenkins, thanks to f14stelt.");
    ConsoleLogger.info("Do you want a good game server? Look at our sponsor GameHosting.it leader " + "in Italy as Game Server Provider!");
    // Successful message
    ConsoleLogger.info("AuthMe " + getPluginVersion() + " build n." + getPluginBuildNumber() + " correctly enabled!");
    // Purge on start if enabled
    PurgeService purgeService = injector.getSingleton(PurgeService.class);
    purgeService.runAutoPurge();
    // Schedule clean up task
    CleanupTask cleanupTask = injector.getSingleton(CleanupTask.class);
    cleanupTask.runTaskTimerAsynchronously(this, CLEANUP_INTERVAL, CLEANUP_INTERVAL);
}
Also used : PurgeService(fr.xephi.authme.task.purge.PurgeService) CleanupTask(fr.xephi.authme.task.CleanupTask)

Aggregations

CleanupTask (fr.xephi.authme.task.CleanupTask)1 PurgeService (fr.xephi.authme.task.purge.PurgeService)1