bool CServerList::Init()
{
	// auto update the list by using an url
	if (thePrefs.GetAutoUpdateServerList())
		AutoUpdate();
	
	// Load Metfile
	CString strPath;
	strPath.Format(_T("%s") SERVER_MET_FILENAME, thePrefs.GetMuleDirectory(EMULE_CONFIGDIR));
	bool bRes = AddServerMetToList(strPath, false);
	if (thePrefs.GetAutoUpdateServerList())
	{
		strPath.Format(_T("%sserver_met.download"), thePrefs.GetMuleDirectory(EMULE_CONFIGDIR));
		bool bRes2 = AddServerMetToList(strPath, true);
		if (!bRes && bRes2)
			bRes = true;
	}

	// insert static servers from textfile
	strPath.Format(_T("%sstaticservers.dat"), thePrefs.GetMuleDirectory(EMULE_CONFIGDIR));
	AddServersFromTextFile(strPath);

    CGlobalVariable::serverlist->GiveServersForTraceRoute();
    
	m_bHasInit = true;
    return bRes;
}
bool CServerList::Init()
{
	// auto update the list by using an url
	if (thePrefs.GetAutoUpdateServerList())
	{
		if(theApp.IsSplash()) theApp.DestroySplash(); //Xman new slpash-screen arrangement
		AutoUpdate();
	} //Xman

	// Load Metfile
	CString strPath;
	strPath.Format(_T("%s") SERVER_MET_FILENAME, thePrefs.GetMuleDirectory(EMULE_CONFIGDIR));
	bool bRes = AddServerMetToList(strPath, false);
	if (thePrefs.GetAutoUpdateServerList())
	{
		strPath.Format(_T("%sserver_met.download"), thePrefs.GetMuleDirectory(EMULE_CONFIGDIR));
		bool bRes2 = AddServerMetToList(strPath, true);
		if (!bRes && bRes2)
			bRes = true;
	}

	// insert static servers from textfile
	strPath.Format(_T("%sstaticservers.dat"), thePrefs.GetMuleDirectory(EMULE_CONFIGDIR));
	AddServersFromTextFile(strPath);

	//Xman auto update IPFilter
	if(thePrefs.AutoUpdateIPFilter())
	{
		bool update=false;
		if (thePrefs.m_last_ipfilter_check!=0) {
			CTime last(thePrefs.m_last_ipfilter_check);
			struct tm tmTemp;
			time_t tLast=safe_mktime(last.GetLocalTm(&tmTemp));
			time_t tNow=safe_mktime(CTime::GetCurrentTime().GetLocalTm(&tmTemp));
			if ( (difftime(tNow,tLast) / 86400)>=thePrefs.GetUpdateDays() )
			{
				update=true;
			}
		}
		else
			update=true;
		if(update)
		{
			if(theApp.IsSplash()) theApp.DestroySplash(); //Xman new slpash-screen arrangement
			theApp.ipfilter->UpdateIPFilterURL();
		}
	}
	//Xman end

	//X-Ray :: Fincan Hash Detection :: Start
	if(thePrefs.GetAntiLeecherFincan())
		theApp.dlp->LoadFincanHashes(thePrefs.m_antileecherFincanURL, true);
	//X-Ray :: Fincan Hash Detection :: End	

    theApp.serverlist->GiveServersForTraceRoute();
    
    return bRes;
}
bool CServerList::Init()
{
	// auto update the list by using an url
	if (thePrefs.GetAutoUpdateServerList())
		AutoUpdate();
	
	// Load Metfile
	CString strPath;
	strPath.Format(_T("%s") SERVER_MET_FILENAME, thePrefs.GetConfigDir());
	bool bRes = AddServerMetToList(strPath, false);
	if (thePrefs.GetAutoUpdateServerList())
	{
		strPath.Format(_T("%sserver_met.download"), thePrefs.GetConfigDir());
		bool bRes2 = AddServerMetToList(strPath, true);
		if (!bRes && bRes2)
			bRes = true;
	}

	// insert static servers from textfile
	strPath.Format(_T("%sstaticservers.dat"), thePrefs.GetConfigDir());
	AddServersFromTextFile(strPath);
        //Ip to Country
	//Commander - Added: IP2Country auto-updating - Start
	if (thePrefs.IsAutoUPdateIP2CountryEnabled())
	theApp.ip2country->UpdateIP2CountryURL();
	//Commander - Added: IP2Country auto-updating - End
	//Ip to Country
 //MORPH START added by Yun.SF3: Ipfilter.dat update
	if (thePrefs.IsAutoUPdateIPFilterEnabled())
	theApp.ipfilter->UpdateIPFilterURL();
	//MORPH END added by Yun.SF3: Ipfilter.dat update
//MORPH START - Added by milobac, FakeCheck, FakeReport, Auto-updating
	if (thePrefs.IsUpdateFakeStartupEnabled())
	theApp.FakeCheck->DownloadFakeList();
//MORPH END - Added by milobac, FakeCheck, FakeReport, Auto-updating 
    theApp.serverlist->GiveServersForTraceRoute();
    
    return bRes;
}