Пример #1
0
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;
}
Пример #2
0
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;
}
Пример #3
0
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;
}
Пример #4
0
bool xApp::OnInit()
{
    SetAppName(AppName);
    if (!InitResources())
    {
        return false; // Something went wrong with resources loading
    }

    wxToolTip::Enable(true); // Enable tooltips globally
    wxToolTip::SetDelay(500);

    wxBitmap SplashScreenImage(SplashScreen_xpm);
    if (SplashScreenImage.Ok())
    {
        wxSplashScreen* Splash = new wxSplashScreen(SplashScreenImage, wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT, 3000, NULL, wxID_ANY);
    }
    MainFrame = new xMainFrame(); // Create the main frame
    SetTopWindow(MainFrame);
    MainFrame->Show();
    AddServerMetToList(wxT("server.met"));

    // Everything is alright and we are ready-to-go :)
    return true;
}