/** * Reset tick and tick stats to 0 (!). */ public static void reset() { tick = 0; timeLast = 0; for (int i = 0; i < lagMaxTicks; i++) { tickDurations[i] = 0; tickDurationsSq[i] = 0; } for (int i = 0; i < spikeDurations.length; i++) { spikes[i].clear(0); } }
/** * Clear the data of the no pwnage check. */ public synchronized void reset() { captchTries = relogWarnings = 0; captchaVL = 0D; // colorVL <- is spared to avoid problems with spam + captcha success. textVL = 0; final long now = System.currentTimeMillis(); chatFrequency.clear(now); chatShortTermFrequency.clear(now); chatLastTime = relogWarningTime = 0L; captchaGenerated = chatLastMessage = ""; chatLastTime = 0; chatWarningTime = 0; commandsShortTermTick = 0; commandsWeights.clear(now); }
@Override public boolean dataOnRemoveSubCheckData(Collection<CheckType> checkTypes) { for (final CheckType checkType : checkTypes) { switch(checkType) { // TODO: case COMBINED: case COMBINED_IMPROBABLE: improbableVL = 0; improbableCount.clear(System.currentTimeMillis()); // TODO: Document there, which to use. break; case COMBINED_YAWRATE: yawFreq.clear(System.currentTimeMillis()); // TODO: Document there, which to use. break; case COMBINED_BEDLEAVE: bedLeaveVL = 0; wasInBed = false; // wasInBed is probably better kept? break; case COMBINED_MUNCHHAUSEN: munchHausenVL = 0; break; case COMBINED: return true; default: break; } } return false; }
/** * Reset the yawrate data to yaw and time. * @param player * @param yaw * @param time * @param clear If to clear yaws. */ public static final void resetYawRate(final Player player, float yaw, final long time, final boolean clear, final IPlayerData pData) { if (yaw <= -360f) { yaw = -((-yaw) % 360f); } else if (yaw >= 360f) { yaw = yaw % 360f; } final CombinedData data = pData.getGenericInstance(CombinedData.class); data.lastYaw = yaw; data.lastYawTime = time; // TODO: One might set to some past-time to allow any move at first. data.sumYaw = 0; if (clear) { data.yawFreq.clear(time); } }