Changed Version Checker URL.

This commit is contained in:
AlgorithmX2
2014-09-12 23:06:09 -05:00
parent 5c5f43a5a9
commit c4b8940c1d
+13 -5
View File
@@ -26,7 +26,8 @@ public class VersionChecker implements Runnable
private long delay = 0; private long delay = 0;
private boolean VersionChecker = true; private boolean VersionChecker = true;
public VersionChecker() { public VersionChecker()
{
long now = (new Date()).getTime(); long now = (new Date()).getTime();
delay = (1000 * 3600 * 5) - (now - AEConfig.instance.latestTimeStamp); delay = (1000 * 3600 * 5) - (now - AEConfig.instance.latestTimeStamp);
if ( delay < 1 ) if ( delay < 1 )
@@ -38,19 +39,21 @@ public class VersionChecker implements Runnable
{ {
try try
{ {
Thread.sleep( delay ); sleep( delay );
} }
catch (InterruptedException e) catch (InterruptedException e)
{ {
// :(
} }
while (true) while (true)
{ {
Thread.yield(); Thread.yield();
try try
{ {
String MCVersion = cpw.mods.fml.common.Loader.instance().getMCVersionString().replace( "Minecraft ", "" ); String MCVersion = cpw.mods.fml.common.Loader.instance().getMCVersionString().replace( "Minecraft ", "" );
URL url = new URL( "http://ae2.ae-mod.info/builds/latest.json?VersionMC=" + MCVersion + "&Channel=" + AEConfig.CHANNEL + "&CurrentVersion=" URL url = new URL( "http://feeds.ae-mod.info/latest.json?VersionMC=" + MCVersion + "&Channel=" + AEConfig.CHANNEL + "&CurrentVersion="
+ AEConfig.VERSION ); + AEConfig.VERSION );
URLConnection yc = url.openConnection(); URLConnection yc = url.openConnection();
@@ -105,13 +108,13 @@ public class VersionChecker implements Runnable
} }
} }
Thread.sleep( 1000 * 3600 * 4 ); sleep( 1000 * 3600 * 4 );
} }
catch (Exception e) catch (Exception e)
{ {
try try
{ {
Thread.sleep( 1000 * 3600 * 4 ); sleep( 1000 * 3600 * 4 );
} }
catch (InterruptedException e1) catch (InterruptedException e1)
{ {
@@ -120,4 +123,9 @@ public class VersionChecker implements Runnable
} }
} }
} }
private void sleep(long i) throws InterruptedException
{
Thread.sleep( i );
}
} }