@Override
    public void onEnable() {
		name = getDescription().getName();
		version = getDescription().getVersion();

		task = new OnlineUsersTask();
		task.runTaskTimerAsynchronously(this, 1, 1);

		getServer().getPluginManager().registerEvents(new OnlineUsersPlayerListener(), this);

		File confdir = new File("OnlineUsers"); 
    	if (confdir.exists()) {
    		File newdir = new File(directory);
    		if (!confdir.renameTo(newdir)) {
    			log.severe(name + ": Could not move the OnlineUsers directory to the plugin folder. Please do so and restart your server.");
    			getServer().getPluginManager().disablePlugin(this);
    			return;
    		} else {
    			log.warning("****************************************");
    			log.warning(name + ": The OnlineUsers directory has been moved to plugins/OnlineUsers.");
    			log.warning("****************************************");
    		}
    	}
    	
    	if (!initProps()) {
			log.severe(name + ": Could not initialise " + configFile);
			getServer().getPluginManager().disablePlugin(this);
			return;
		}
		
		if (destination.equalsIgnoreCase("mysql")) {
			ds = new OnlineUsersMySQL();
		} else {
			ds = new OnlineUsersFlatfile();
		}
		
		if (!ds.init()) {
			log.severe(name + ": Could not init the datasource");
			getServer().getPluginManager().disablePlugin(this);
			return;
		}

		ds.setAllOffline();
		initOnlineUsers();
    }