Beispiel #1
0
void CServerList::AutoUpdate() 
{
	
	uint8 url_count = theApp->glob_prefs->adresses_list.GetCount();
	
	if (!url_count) {
		AddLogLineC(_("No server list address entry in 'addresses.dat' found. Please paste a valid server list address into this file in order to auto-update your server list"));
		return;
	}
	// Do current URL. Callback function will take care of the others.
	while ( current_url_index < url_count ) {
		wxString URI = theApp->glob_prefs->adresses_list[current_url_index];
		// We use wxURL to validate the URI
		if ( wxURL( URI ).GetError() == wxURL_NOERR ) {
			// Ok, got a valid URI
			m_URLUpdate = URI;
			wxString strTempFilename =
				theApp->ConfigDir + wxT("server_auto.met");
			AddLogLineC(CFormat(
				_("Start downloading server list from %s")) % URI);
			CHTTPDownloadThread *downloader = new CHTTPDownloadThread(
				URI, strTempFilename, theApp->ConfigDir + wxT("server.met"), HTTP_ServerMetAuto, false, false);
			downloader->Create();
			downloader->Run();
		
			return;
		} else {
			AddLogLineC(CFormat(
				_("WARNING: invalid URL specified for auto-updating of servers: %s") ) % URI);
		}
		current_url_index++;
	}
	AddLogLineC(_("No valid server.met auto-download url on addresses.dat"));
}
Beispiel #2
0
	void OnTimer(wxTimerEvent &event)
	{
		const wxString url = m_ipProvider->GetValue();

		if (wxURL(url).GetError() != wxURL_NOERR) {
			SetStatusText(wxT("Nieprawidłowy URL"));
			return;
		}

		CheckIpAsync(url);
	}
Beispiel #3
0
void UpdateChecker::connect(wxEvtHandler* receiver)
{
	wxString address = wxT("http://www.remeresmapeditor.com/update.php");
	address << wxT("?os=") << 
#ifdef __WINDOWS__
	wxT("windows");
#elif __LINUX__
	wxT("linux");
#else
	wxT("unknown");
#endif
	address << wxT("&verid=") << __RME_VERSION_ID__;
#ifdef __EXPERIMENTAL__
	address << wxT("&beta");
#endif
	wxURL* url = newd wxURL(address);
	UpdateConnectionThread* connection = newd UpdateConnectionThread(receiver, url);
	connection->Execute();
}
FbUpdateThread::FbUpdateThread()
{
	wxURL(MyRuLib::HomePage()).GetProtocol();
}
Beispiel #5
0
void TwitterUser::GetProfileImage()
{
	if (GetProfileImageUrl() == _T("")) return;
	HttpClient().GetToFile(wxURL(GetProfileImageUrl()), GetProfileImageFilename());
}