Finalize version checker delay
This commit is contained in:
parent
1015214dea
commit
6d45cecbf2
1 changed files with 6 additions and 5 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue