Finalize version checker delay

This commit is contained in:
thatsIch 2014-11-04 00:44:50 +01:00
parent 1015214dea
commit 6d45cecbf2

View file

@ -20,14 +20,15 @@ import cpw.mods.fml.common.event.FMLInterModComms;
public class VersionChecker implements Runnable
{
private long delay = 0;
private final long delay;
public VersionChecker()
{
long now = (new Date()).getTime();
delay = (1000 * 3600 * 5) - (now - AEConfig.instance.latestTimeStamp);
if ( delay < 1 )
delay = 1;
final int fiveHours = 1000 * 3600 * 5;
final long now = new Date().getTime();
final long timeDiff = now - AEConfig.instance.latestTimeStamp;
this.delay = Math.max( 1, fiveHours - timeDiff);
}
@Override