public static bool UpdateCheck()
{
try {
using ( WebClient client = new WebClient() ) {
using ( Stream stream = client.OpenRead( "http://au70.net/public/update.txt" ) ) {
stream.ReadTimeout = 1000;
using ( StreamReader reader = new StreamReader( stream ) ) {
string s = reader.ReadLine();
if ( !int.TryParse( s.Replace( ".", "" ), out WebVersion ) ) {
Logger.Log( LogType.Warning, "Could not parse version value in updater ({0})", s );
return false;
}
WebVersionFullString = reader.ReadLine();
DownloadLocation = reader.ReadLine();
UpdaterLocation = reader.ReadLine();
Changelog = reader.ReadToEnd();
}
}
if ( WebVersion != 0 && DownloadLocation != null && UpdaterLocation != null ) {
if ( WebVersion > Updater.CurrentRelease.Version ) {
Logger.Log( LogType.Warning, "An update of 800Craft is available, you can get it at: " + DownloadLocation );
return true;
}
}
}
return false;
} catch ( Exception e ) {
Logger.Log( LogType.SystemActivity, "Failed: " + e );
return false;
}
}