P3.3 (revue) nuker annule tout l'excedent du tick ; P3.1 auto-cristal
Revue de securite du nuker : - Une fois le tick signale, les casses suivantes du meme tick renvoyaient 0 sans verdict, donc n'etaient pas annulables en ENFORCE. - La comptabilite reste separee (un tick suspect compte une fois dans la serie). Moteur.nukerAnnulerCasse decide l'annulation de chaque casse : vrai pour toute casse au-dela du plafond du tick si ce tick a donne une sanction >= SETBACK applicable, ou si le controle est en ENFORCE et le VL nuker deja au palier SETBACK. Jamais en OBSERVE. - Tests : rafale de 30 casses par tick en ENFORCE (une infraction comptee, 27 casses annulees) ; OBSERVE n'annule rien. Nouveau controle auto-cristal (OBSERVE par defaut) : - Age du cristal de l'End (ticks serveur depuis EntityJoinLevelEvent, jamais un cristal recharge depuis le disque) au moment du coup. Age < cristalDelaiMinTicks (2) = suspect ; points en serie seulement (cristalSerieMin 6 sur les 10 derniers coups, 60 s). Age inconnu ou > 40 ticks : non mesure. - Exemptions COMBAT, TPS bas, gel serveur. Chaque coup est evalue (pas de "signale une fois") ; en ENFORCE au palier SETBACK le coup est annule par le chemin existant d'onAttaque. - Risque de faux positif eleve (PvP cristal rapide) : longue observation. - Tests : AutoCristalP3Test (5). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Cette révision appartient à :
1 Parent
bb1867f07d
révision
f52587ae62
11 fichiers modifiés
+237
-4
Aucun fichier ne correspond à votre recherche
@@ -491,7 +491,7 @@ public final class Garde {
|
||||
appliquerSanctionMouvement(p, sn, vn);
|
||||
return true;
|
||||
}
|
||||
annulerNuker = Cablage.sanctionDeMouvement(sn);
|
||||
annulerNuker = Cablage.sanctionDeMouvement(sn) || MOTEUR.nukerAnnulerCasse(p.getUUID(), tick * 50L, tick);
|
||||
}
|
||||
if (CONFIG.mode(Controle.FAST_BREAK) == Mode.OFF) return annulerNuker;
|
||||
double progression = state.getDestroyProgress(p, p.level(), pos);
|
||||
@@ -502,6 +502,26 @@ public final class Garde {
|
||||
return annulerNuker || Cablage.sanctionDeMouvement(s);
|
||||
}
|
||||
|
||||
// 0.5 (P3.1) : tick d'apparition des cristaux de l'End récents (id d'entité -> tick serveur). Thread serveur seulement.
|
||||
private static final java.util.Map<Integer, Integer> CRISTAUX = new java.util.HashMap<>();
|
||||
|
||||
/** 0.5 (P3.1) : un cristal de l'End vient d'apparaître (posé, pas rechargé). */
|
||||
public static void noterCristal(net.minecraft.world.entity.Entity c, int tick) {
|
||||
if (c.getServer() != null && !c.getServer().isSameThread()) return;
|
||||
if (CONFIG.mode(Controle.AUTO_CRISTAL) == Mode.OFF) return;
|
||||
if (CRISTAUX.size() > 256) {
|
||||
CRISTAUX.values().removeIf(t -> tick - t > com.gastinelgarde.core.AutoCristal.AGE_MAX_MESURE);
|
||||
}
|
||||
CRISTAUX.put(c.getId(), tick);
|
||||
}
|
||||
|
||||
/** 0.5 (P3.1) : âge (ticks) d'un cristal frappé, -1 si son apparition n'a pas été vue. */
|
||||
public static int ageCristal(net.minecraft.world.entity.Entity c, int tick) {
|
||||
Integer t = CRISTAUX.remove(c.getId());
|
||||
if (t == null || tick < t) return -1;
|
||||
return tick - t;
|
||||
}
|
||||
|
||||
/** 0.5 (P2.4) : bloc posé par ce joueur. Vrai si la pose doit être annulée (ENFORCE, palier SETBACK ou plus). */
|
||||
public static boolean noterPose(ServerPlayer p) {
|
||||
if (!surThreadServeur(p)) return false;
|
||||
|
||||
@@ -108,6 +108,11 @@ public final class GardeEvents {
|
||||
visible ? null : "non-visible"));
|
||||
}
|
||||
|
||||
// 0.5 (P3.1) : cristal de l'End frappé (auto-cristal), âge vu à son apparition.
|
||||
if (cible instanceof net.minecraft.world.entity.boss.enderdragon.EndCrystal) {
|
||||
verdicts.addAll(Garde.moteur().frappeCristal(p.getUUID(), tick * 50L, etat, Garde.ageCristal(cible, tick)));
|
||||
}
|
||||
|
||||
Sanction s = Garde.traiter(p, verdicts);
|
||||
// portée / hitbox ENFORCE ; le « retour en arrière » d'un coup (sanction ≥ SETBACK) : il est simplement annulé
|
||||
if (Cablage.annulerCoup(Garde.moteur().coupsBloques(p.getUUID(), tick * 50L), s)) event.setCanceled(true);
|
||||
@@ -217,6 +222,15 @@ public final class GardeEvents {
|
||||
}
|
||||
}
|
||||
|
||||
/** 0.5 (P3.1) : apparition d'un cristal de l'End (pas un rechargement depuis le disque) : début de son âge. */
|
||||
@SubscribeEvent
|
||||
public static void onCristal(net.neoforged.neoforge.event.entity.EntityJoinLevelEvent event) {
|
||||
if (event.getLevel().isClientSide() || event.loadedFromDisk()) return;
|
||||
if (event.getEntity() instanceof net.minecraft.world.entity.boss.enderdragon.EndCrystal c && c.getServer() != null) {
|
||||
Garde.noterCristal(c, c.getServer().getTickCount());
|
||||
}
|
||||
}
|
||||
|
||||
/** Totem éclaté : début de la mesure du délai de remise (auto-totem). */
|
||||
@SubscribeEvent
|
||||
public static void onTotem(net.neoforged.neoforge.event.entity.living.LivingUseTotemEvent event) {
|
||||
|
||||
@@ -38,7 +38,7 @@ public final class GardeSpec {
|
||||
private static final ModConfigSpec.DoubleValue FAST_PLACE_REGULARITE, INTER_MARGE;
|
||||
private static final ModConfigSpec.IntValue INTER_SERIE, TOTEM_ECHANT, TOTEM_ECART, TOTEM_REG_MAX;
|
||||
// 0.5 (P3)
|
||||
private static final ModConfigSpec.IntValue NUKER_MAX, NUKER_SERIE;
|
||||
private static final ModConfigSpec.IntValue NUKER_MAX, NUKER_SERIE, CRISTAL_DELAI, CRISTAL_SERIE;
|
||||
|
||||
private static final ModConfigSpec.DoubleValue ANGLE_MAX;
|
||||
private static final ModConfigSpec.IntValue CIBLES_MAX;
|
||||
@@ -328,6 +328,12 @@ public final class GardeSpec {
|
||||
.defineInRange("nukerBlocsParTickMax", 3, 1, 64);
|
||||
NUKER_SERIE = b.comment("Nuker : ticks suspects parmi les 20 derniers ticks de casse (60 s) avant de compter.")
|
||||
.defineInRange("nukerSerieMin", 3, 1, 20);
|
||||
CRISTAL_DELAI = b.comment("0.5 (P3.1) auto-cristal : âge (ticks serveur) d'un cristal de l'End frappé sous lequel le coup est suspect.",
|
||||
"2 = frappé dans le tick de sa pose ou le suivant. Cristaux d'âge inconnu (rechargés, posés avant) non mesurés.",
|
||||
"Risque de faux positif élevé (PvP cristal rapide, paquets groupés) : longue observation avant tout ENFORCE.")
|
||||
.defineInRange("cristalDelaiMinTicks", 2, 1, 10);
|
||||
CRISTAL_SERIE = b.comment("Auto-cristal : coups suspects parmi les 10 derniers coups sur un cristal récent (60 s) avant de compter.")
|
||||
.defineInRange("cristalSerieMin", 6, 1, 10);
|
||||
b.pop();
|
||||
|
||||
b.comment("0.5 (P2.10) x-ray statistique : alerte seulement, jamais de setback ni d'expulsion (même en ENFORCE).").push("xray");
|
||||
@@ -533,6 +539,8 @@ public final class GardeSpec {
|
||||
c.autoTotemRegulierMaxMs = TOTEM_REG_MAX.get();
|
||||
c.nukerBlocsParTickMax = NUKER_MAX.get();
|
||||
c.nukerSerieMin = NUKER_SERIE.get();
|
||||
c.cristalDelaiMinTicks = CRISTAL_DELAI.get();
|
||||
c.cristalSerieMin = CRISTAL_SERIE.get();
|
||||
c.graceApresExpulsionTicks = GRACE_APRES_EXPULSION.get();
|
||||
c.setbackSolSiPasDePosition = SETBACK_SOL.get();
|
||||
c.graceReculTicks = GRACE_RECUL.get();
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.gastinelgarde.core;
|
||||
|
||||
/**
|
||||
* 0.5 (P3.1) : AutoCrystal / CrystalAura. Le module pose un cristal de l'End et le frappe aussitôt, souvent dans le
|
||||
* même tick serveur. Un joueur humain enchaîne « clic droit, clic gauche » en au moins un ou deux ticks ; la gigue
|
||||
* réseau peut toutefois regrouper ses deux paquets. Signal : âge du cristal (ticks serveur depuis son apparition, vue à
|
||||
* {@code EntityJoinLevelEvent}, jamais pour un cristal rechargé depuis le disque) au moment du coup. Âge inférieur à
|
||||
* {@link GardeConfig#cristalDelaiMinTicks} = coup suspect ; points seulement en série
|
||||
* ({@link GardeConfig#cristalSerieMin} sur les {@link #SERIE} derniers coups sur un cristal récent, 60 s). Cristaux
|
||||
* d'âge inconnu (posés avant, rechargés, autre mod) : non mesurés. Risque de faux positif élevé selon le rapport de
|
||||
* recherche (PvP cristal rapide) : OBSERVE par défaut, plafond « faible » du score.
|
||||
*/
|
||||
public final class AutoCristal {
|
||||
|
||||
public static final int SERIE = 10;
|
||||
public static final long FENETRE_MS = 60_000;
|
||||
/** Au-delà de cet âge (ticks), le coup n'est pas mesuré (cristal ancien : rien à dire). */
|
||||
public static final int AGE_MAX_MESURE = 40;
|
||||
|
||||
private final SerieFenetre serie = new SerieFenetre(SERIE, FENETRE_MS);
|
||||
private int dernierCompte;
|
||||
|
||||
/** @param ageTicks âge du cristal frappé, négatif si inconnu. @return points d'infraction */
|
||||
public double frappe(long nowMs, int ageTicks, GardeConfig cfg) {
|
||||
if (ageTicks < 0 || ageTicks > AGE_MAX_MESURE) return 0;
|
||||
boolean suspect = ageTicks < Math.max(1, cfg.cristalDelaiMinTicks);
|
||||
dernierCompte = serie.ajouter(nowMs, suspect);
|
||||
if (!suspect || dernierCompte < Math.max(1, cfg.cristalSerieMin)) return 0;
|
||||
return 2.0;
|
||||
}
|
||||
|
||||
public int dernierCompte() {
|
||||
return dernierCompte;
|
||||
}
|
||||
|
||||
public void vider() {
|
||||
serie.vider();
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,9 @@ public enum Controle {
|
||||
/** 0.5 (P2.10) : part anormale de minerais rares non exposés (X-Ray) ; alerte seulement, jamais de sanction. */
|
||||
XRAY("xray"),
|
||||
/** 0.5 (P3.3) : plusieurs blocs cassés dans le même tick serveur, en série (Nuker). */
|
||||
NUKER("nuker");
|
||||
NUKER("nuker"),
|
||||
/** 0.5 (P3.1) : cristaux de l'End frappés en série dès leur apparition (AutoCrystal / CrystalAura). */
|
||||
AUTO_CRISTAL("auto-cristal");
|
||||
|
||||
private final String id;
|
||||
|
||||
@@ -77,7 +79,7 @@ public enum Controle {
|
||||
// 0.5 : nouveaux contrôles P1 au plafond « faible » tant qu'ils n'ont pas été validés en jeu.
|
||||
case TIMER, ROTATION, ATTAQUE_IMPOSSIBLE, VEHICULE_VITESSE, VEHICULE_VOL, ELYTRES, VELOCITE, STEP, CRITICALS, ANTI_FAIM,
|
||||
NO_SLOW, FAST_BREAK, FAST_PLACE, INTERACTION_BLOC, AUTO_TOTEM_REGULIER,
|
||||
JESUS, OMNISPRINT, XRAY, NUKER -> 2; // 0.5 (P2) : idem
|
||||
JESUS, OMNISPRINT, XRAY, NUKER, AUTO_CRISTAL -> 2; // 0.5 (P2) : idem
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -230,6 +230,10 @@ public final class GardeConfig {
|
||||
public int nukerBlocsParTickMax = 3;
|
||||
/** Nuker : ticks suspects parmi les 20 derniers ticks de casse (60 s) avant de compter. */
|
||||
public int nukerSerieMin = 3;
|
||||
/** Auto-cristal : âge (ticks serveur) d'un cristal de l'End frappé sous lequel le coup est suspect (2 : même tick ou suivant). */
|
||||
public int cristalDelaiMinTicks = 2;
|
||||
/** Auto-cristal : coups suspects parmi les 10 derniers coups sur un cristal récent (60 s) avant de compter. */
|
||||
public int cristalSerieMin = 6;
|
||||
|
||||
// --- 0.5 (P1.13, section [diagnostic]) : journal seulement, jamais de sanction ---
|
||||
/** Journaliser les ABORT de casse de bloc sans START correspondant (« Mismatch in destroy block pos »). */
|
||||
|
||||
@@ -548,6 +548,41 @@ public final class Moteur {
|
||||
ajouter(v, s, Controle.NUKER, pts, nowMs, ex, String.format(Locale.ROOT,
|
||||
"%d blocs casses dans le meme tick (max %d), %d ticks suspects sur %d", s.nuker.casses(),
|
||||
cfg.nukerBlocsParTickMax, s.nuker.dernierCompte(), Nuker.SERIE));
|
||||
for (Verdict x : v) {
|
||||
if (x.applicable().ordinal() >= Sanction.SETBACK.ordinal()) s.nuker.marquerAnnulation();
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
/**
|
||||
* 0.5 (P3.3, revue de sécurité) : la casse qui vient d'être mesurée par {@link #casseNuker} doit-elle être annulée ?
|
||||
* Vrai pour chaque casse excédentaire du tick (pas seulement la première) quand ce tick a donné une sanction
|
||||
* ≥ SETBACK applicable, ou quand le contrôle est en ENFORCE et que le VL nuker est déjà au palier SETBACK. Jamais
|
||||
* en OBSERVE.
|
||||
*/
|
||||
public boolean nukerAnnulerCasse(UUID joueur, long nowMs, long tick) {
|
||||
if (cfg.mode(Controle.NUKER) != Mode.ENFORCE) return false;
|
||||
Suivi s = suivis.get(joueur);
|
||||
if (s == null || !s.nuker.excedent(tick, cfg)) return false;
|
||||
if (s.nuker.annulerTick()) return true;
|
||||
Sanction palier = Paliers.palier(s.vl.valeur(Controle.NUKER, nowMs), cfg, Controle.NUKER);
|
||||
return Paliers.applicable(palier, Mode.ENFORCE).ordinal() >= Sanction.SETBACK.ordinal();
|
||||
}
|
||||
|
||||
/**
|
||||
* 0.5 (P3.1) : coup sur un cristal de l'End d'âge connu ({@code ageTicks} négatif = inconnu, non mesuré).
|
||||
* Exemptions de la famille COMBAT ; TPS bas : pas de mesure (paquets groupés).
|
||||
*/
|
||||
public List<Verdict> frappeCristal(UUID joueur, long nowMs, EtatJoueur etat, int ageTicks) {
|
||||
if (expulses.contains(joueur) || cfg.mode(Controle.AUTO_CRISTAL) == Mode.OFF) return List.of();
|
||||
Suivi s = suivi(joueur);
|
||||
Exemptions.Resultat ex = Exemptions.evaluer(etat, cfg, Exemptions.Famille.COMBAT);
|
||||
if (ex.exempt() || etat.tps() < cfg.tpsLag || etat.ticksDepuisGel() <= cfg.graceGelTicks) return List.of();
|
||||
double pts = s.autoCristal.frappe(nowMs, ageTicks, cfg);
|
||||
List<Verdict> v = new ArrayList<>(1);
|
||||
ajouter(v, s, Controle.AUTO_CRISTAL, pts, nowMs, ex, String.format(Locale.ROOT,
|
||||
"cristal frappe a %d tick(s) de son apparition (min %d), %d coups suspects sur %d", ageTicks,
|
||||
cfg.cristalDelaiMinTicks, s.autoCristal.dernierCompte(), AutoCristal.SERIE));
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ public final class Nuker {
|
||||
private int casses;
|
||||
private boolean signale;
|
||||
private int dernierCompte;
|
||||
/** Le tick courant a donné une sanction ≥ SETBACK applicable : toutes ses casses excédentaires sont annulées. */
|
||||
private boolean annulerTick;
|
||||
|
||||
/** Un bloc cassé au tick serveur donné. @return points d'infraction */
|
||||
public double casse(long nowMs, long tick, GardeConfig cfg) {
|
||||
@@ -29,9 +31,12 @@ public final class Nuker {
|
||||
tickCourant = tick;
|
||||
casses = 0;
|
||||
signale = false;
|
||||
annulerTick = false;
|
||||
dernierCompte = serie.ajouter(nowMs, false); // un tick de casse ordinaire
|
||||
}
|
||||
casses++;
|
||||
// Comptabilité seulement : un tick suspect compte une fois dans la série. L'annulation des casses excédentaires
|
||||
// suivantes du même tick est décidée à part (excedent / annulerTick, revue de sécurité P3).
|
||||
if (signale || casses <= Math.max(1, cfg.nukerBlocsParTickMax)) return 0;
|
||||
signale = true; // un tick suspect compté une fois
|
||||
dernierCompte = serie.ajouter(nowMs, true);
|
||||
@@ -39,6 +44,19 @@ public final class Nuker {
|
||||
return 2.0;
|
||||
}
|
||||
|
||||
/** La casse courante dépasse le plafond du tick (première excédentaire comprise). */
|
||||
public boolean excedent(long tick, GardeConfig cfg) {
|
||||
return tick == tickCourant && casses > Math.max(1, cfg.nukerBlocsParTickMax);
|
||||
}
|
||||
|
||||
public void marquerAnnulation() {
|
||||
annulerTick = true;
|
||||
}
|
||||
|
||||
public boolean annulerTick() {
|
||||
return annulerTick;
|
||||
}
|
||||
|
||||
public int casses() {
|
||||
return casses;
|
||||
}
|
||||
@@ -52,5 +70,6 @@ public final class Nuker {
|
||||
tickCourant = Long.MIN_VALUE;
|
||||
casses = 0;
|
||||
signale = false;
|
||||
annulerTick = false;
|
||||
}
|
||||
}
|
||||
@@ -83,6 +83,8 @@ public final class Suivi {
|
||||
public final XrayStats xray = new XrayStats();
|
||||
/** 0.5 (P3.3) : nuker. */
|
||||
public final Nuker nuker = new Nuker();
|
||||
/** 0.5 (P3.1) : auto-cristal. */
|
||||
public final AutoCristal autoCristal = new AutoCristal();
|
||||
/** 0.5 (P1.6) : déploiements d'élytres répétés. */
|
||||
public final DeploiementsElytres deploiements = new DeploiementsElytres();
|
||||
/** 0.5 (P1.13) : diagnostic des actions de casse de bloc. */
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.gastinelgarde.core;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.UUID;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/** 0.5, P3.1 : auto-cristal (âge du cristal de l'End au moment du coup). */
|
||||
class AutoCristalP3Test {
|
||||
|
||||
private final GardeConfig cfg = new GardeConfig();
|
||||
private final UUID joueur = UUID.randomUUID();
|
||||
|
||||
/** Un coup par seconde, âges donnés. */
|
||||
private double frapper(Moteur m, EtatJoueur etat, int... ages) {
|
||||
double pts = 0;
|
||||
for (int i = 0; i < ages.length; i++) {
|
||||
for (Verdict v : m.frappeCristal(joueur, 10_000L + i * 1000L, etat, ages[i])) {
|
||||
if (v.controle() == Controle.AUTO_CRISTAL) pts += v.points();
|
||||
}
|
||||
}
|
||||
return pts;
|
||||
}
|
||||
|
||||
@Test
|
||||
void observeParDefaut() {
|
||||
assertEquals(Mode.OBSERVE, cfg.mode(Controle.AUTO_CRISTAL));
|
||||
assertEquals(Controle.AUTO_CRISTAL, Controle.parse("auto-cristal"));
|
||||
assertEquals(2, Controle.AUTO_CRISTAL.fiabilite());
|
||||
}
|
||||
|
||||
@Test
|
||||
void cristauxFrappesAuTickDePoseVus() {
|
||||
assertTrue(frapper(new Moteur(cfg), EtatJoueur.normal(), 0, 0, 0, 0, 0, 0, 0, 0) > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
void pvpHumainRapideJamaisVu() {
|
||||
// Deux à cinq ticks entre la pose et le coup, et de temps en temps un tick (paquets groupés).
|
||||
int[] a = new int[60];
|
||||
for (int i = 0; i < a.length; i++) a[i] = i % 4 == 0 ? 1 : 2 + i % 4;
|
||||
assertEquals(0, frapper(new Moteur(cfg), EtatJoueur.normal(), a), 1e-9);
|
||||
}
|
||||
|
||||
@Test
|
||||
void ageInconnuOuAncienNonMesure() {
|
||||
assertEquals(0, frapper(new Moteur(cfg), EtatJoueur.normal(), -1, -1, -1, -1, -1, -1, -1, -1, -1, -1), 1e-9);
|
||||
assertEquals(0, frapper(new Moteur(cfg), EtatJoueur.normal(), 500, 500, 500, 500, 500, 500, 500), 1e-9);
|
||||
}
|
||||
|
||||
@Test
|
||||
void exemptionsEtLag() {
|
||||
for (EtatJoueur e : new EtatJoueur[] {EtatJoueur.builder().creatif(true).build(),
|
||||
EtatJoueur.builder().spectateur(true).build(), EtatJoueur.builder().tps(12).build(),
|
||||
EtatJoueur.builder().ticksDepuisGel(3).build()}) {
|
||||
assertEquals(0, frapper(new Moteur(cfg), e, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 1e-9, e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,6 +67,36 @@ class NukerP3Test {
|
||||
}
|
||||
}
|
||||
|
||||
/** Rafale de n casses au tick t : [points comptés, casses annulées]. */
|
||||
private double[] rafale(Moteur m, long t, int n) {
|
||||
double pts = 0;
|
||||
int annulees = 0;
|
||||
for (int k = 0; k < n; k++) {
|
||||
for (Verdict v : m.casseNuker(joueur, t * 50L, t, EtatJoueur.normal())) pts += v.points();
|
||||
if (m.nukerAnnulerCasse(joueur, t * 50L, t)) annulees++;
|
||||
}
|
||||
return new double[] {pts, annulees};
|
||||
}
|
||||
|
||||
@Test
|
||||
void enforceAnnuleToutesLesCassesExcedentairesDuTick() {
|
||||
cfg.mode(Controle.NUKER, Mode.ENFORCE);
|
||||
Moteur m = new Moteur(cfg);
|
||||
double[] r = null;
|
||||
// Rafales de 30 casses par tick jusqu'au palier SETBACK (10 de VL, 2 points par tick suspect en série).
|
||||
for (int i = 0; i < 12; i++) r = rafale(m, 100 + i * 5L, 30);
|
||||
assertEquals(2.0, r[0], 1e-9, "une seule infraction comptée par tick");
|
||||
assertEquals(30 - cfg.nukerBlocsParTickMax, r[1], 1e-9, "toutes les casses excédentaires annulées");
|
||||
}
|
||||
|
||||
@Test
|
||||
void observeNAnnuleRien() {
|
||||
Moteur m = new Moteur(cfg);
|
||||
double annulees = 0;
|
||||
for (int i = 0; i < 12; i++) annulees += rafale(m, 100 + i * 5L, 30)[1];
|
||||
assertEquals(0, annulees, 1e-9);
|
||||
}
|
||||
|
||||
@Test
|
||||
void desactive() {
|
||||
cfg.mode(Controle.NUKER, Mode.OFF);
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur