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 public class VersionChecker implements Runnable
{ {
private long delay = 0; private final long delay;
public VersionChecker() public VersionChecker()
{ {
long now = (new Date()).getTime(); final int fiveHours = 1000 * 3600 * 5;
delay = (1000 * 3600 * 5) - (now - AEConfig.instance.latestTimeStamp); final long now = new Date().getTime();
if ( delay < 1 ) final long timeDiff = now - AEConfig.instance.latestTimeStamp;
delay = 1;
this.delay = Math.max( 1, fiveHours - timeDiff);
} }
@Override @Override