Minor security fix for player management and timerelated problems

This commit is contained in:
Evenprime 2011-11-16 15:28:34 +01:00
parent 2c621e14c1
commit 5cf84693b9

View File

@ -80,10 +80,14 @@ public class NoCheatPlayerImpl implements NoCheatPlayer {
}
public void setLastUsedTime(long currentTimeInMilliseconds) {
this.lastUsedTime = System.currentTimeMillis();
this.lastUsedTime = currentTimeInMilliseconds;
}
public boolean shouldBeRemoved(long currentTimeInMilliseconds) {
if(lastUsedTime > currentTimeInMilliseconds) {
// Should never happen, but if it does, fix it somewhat
lastUsedTime = currentTimeInMilliseconds;
}
return lastUsedTime + 60000L < currentTimeInMilliseconds;
}