@Override
	public void onEnable() {

		log.info(logPrefix + "WebAuction is initializing.");

		initConfig();
		String dbHost = getConfig().getString("MySQL.Host");
		String dbUser = getConfig().getString("MySQL.Username");
		String dbPass = getConfig().getString("MySQL.Password");
		String dbPort = getConfig().getString("MySQL.Port");
		String dbDatabase = getConfig().getString("MySQL.Database");
		long saleAlertFrequency = getConfig().getLong("Updates.SaleAlertFrequency");
		long shoutSignUpdateFrequency = getConfig().getLong("Updates.ShoutSignUpdateFrequency");
		long recentSignUpdateFrequency = getConfig().getLong("Updates.RecentSignUpdateFrequency");
		boolean getMessages = getConfig().getBoolean("Misc.ReportSales");
		useOriginalRecent = getConfig().getBoolean("Misc.UseOriginalRecentSigns");
		showSalesOnJoin = getConfig().getBoolean("Misc.ShowSalesOnJoin");
		boolean useMultithreads = getConfig().getBoolean("Development.UseMultithreads");
		signDelay = getConfig().getInt("Misc.SignDelay");
		useSignLink = getConfig().getBoolean("SignLink.UseSignLink");
		numberOfRecentLink = getConfig().getInt("SignLink.NumberOfLatestAuctionsToTrack");

		getCommand("wa").setExecutor(new WebAuctionCommands(this));

		setupEconomy();
		setupPermissions();

		// Set up DataQueries
		dataQueries = new MySQLDataQueries(this, dbHost, dbPort, dbUser, dbPass, dbDatabase);

		// Init tables
		log.info(logPrefix + "MySQL Initializing.");
		dataQueries.initTables();

		// Build shoutSigns map
		shoutSigns.putAll(dataQueries.getShoutSignLocations());

		// Build recentSigns map
		recentSigns.putAll(dataQueries.getRecentSignLocations());

		// If reporting sales in game, schedule sales alert task
		if (useMultithreads){
			log.info(logPrefix + "Using Multiple Threads.");
			if (getMessages) {
				getServer().getScheduler().scheduleAsyncRepeatingTask(this, new SaleAlertTask(this), saleAlertFrequency, saleAlertFrequency);
			}

			getServer().getScheduler().scheduleAsyncRepeatingTask(this, new ShoutSignTask(this), shoutSignUpdateFrequency, shoutSignUpdateFrequency);
			getServer().getScheduler().scheduleAsyncRepeatingTask(this, new RecentSignTask(this), recentSignUpdateFrequency, recentSignUpdateFrequency);
		}else{
			log.info(logPrefix + "Using Single Thread.");
			if (getMessages) {
				getServer().getScheduler().scheduleSyncRepeatingTask(this, new SaleAlertTask(this), saleAlertFrequency, saleAlertFrequency);
			}

			getServer().getScheduler().scheduleSyncRepeatingTask(this, new ShoutSignTask(this), shoutSignUpdateFrequency, shoutSignUpdateFrequency);
			getServer().getScheduler().scheduleSyncRepeatingTask(this, new RecentSignTask(this), recentSignUpdateFrequency, recentSignUpdateFrequency);	
		}

		PluginManager pm = getServer().getPluginManager();
		pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Priority.Normal, this);
		pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener, Priority.Normal, this);
		pm.registerEvent(Event.Type.PLAYER_QUIT, playerListener, Priority.Normal, this);
		pm.registerEvent(Event.Type.SIGN_CHANGE, blockListener, Priority.Normal, this);
		pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Priority.Normal, this);
		pm.registerEvent(Event.Type.PLUGIN_ENABLE, serverListener, Priority.Monitor, this);
	}