Skip to content

Commit

Permalink
patch drop noslow
Browse files Browse the repository at this point in the history
  • Loading branch information
ManInMyVan committed Jan 25, 2025
1 parent 098399f commit 0d84b4e
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,18 @@ else if (event.getPacketType() == PacketType.Play.Server.SET_SLOT) {
player.latencyUtils.addRealTimeTask(player.lastTransactionSent.get(), () -> {
if (slot.getSlot() - 36 == player.packetStateData.lastSlotSelected) {
player.packetStateData.setSlowedByUsingItem(false);
if (player.isMitigateDesyncNoSlow()) {
player.resetBukkitItemUsage();
}
}
});

player.latencyUtils.addRealTimeTask(player.lastTransactionSent.get() + 1, () -> {
if (slot.getSlot() - 36 == player.packetStateData.lastSlotSelected) {
player.packetStateData.setSlowedByUsingItem(false);
if (player.isMitigateDesyncNoSlow()) {
player.resetBukkitItemUsage();
}
}
});
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/ac/grim/grimac/player/GrimPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ public void runNettyTaskInMs(Runnable runnable, int ms) {
@Getter private boolean cancelDuplicatePacket = true;
@Getter @Setter private boolean exemptElytra = false;
@Getter private boolean mitigateAutoblock;
@Getter private boolean mitigateDesyncNoSlow;

@Override
public void reload(ConfigManager config) {
Expand All @@ -841,7 +842,8 @@ public void reload(ConfigManager config) {
maxTransactionTime = GrimMath.clamp(config.getIntElse("max-transaction-time", 60), 1, 180);
ignoreDuplicatePacketRotation = config.getBooleanElse("ignore-duplicate-packet-rotation", false);
cancelDuplicatePacket = config.getBooleanElse("cancel-duplicate-packet", true);
mitigateAutoblock = config.getBooleanElse("mitigate-autoblock", false);
mitigateAutoblock = config.getBooleanElse("mitigate-autoblock", true);
mitigateDesyncNoSlow = config.getBooleanElse("mitigate-desync-noslow", true);
// reload all checks
for (AbstractCheck value : checkManager.allChecks.values()) value.reload();
// reload punishment manager
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ debug-pipeline-on-join: false
# Aktiviert experimentelle Prüfungen
experimental-checks: false

mitigate-autoblock: false
mitigate-autoblock: true
mitigate-desync-noslow: true

# Grim bricht manchmal illegale Pakete ab, z.B. mit Timer, nachdem X Pakete in einer Sekunde abgebrochen wurden, wann sollte
# wir den Spieler einfach kicken? Dies ist erforderlich, da einige Paketbegrenzer die von Grim abgebrochenen Pakete nicht zählen.
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ debug-pipeline-on-join: false
# Enables experimental checks
experimental-checks: false

mitigate-autoblock: false
mitigate-autoblock: true
mitigate-desync-noslow: true

# Grim sometimes cancels illegal packets such as with timer, after X packets in a second cancelled, when should
# we simply kick the player? This is required as some packet limiters don't count packets cancelled by grim.
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ debug-pipeline-on-join: false
# Habilitar comprobaciones experimentales
experimental-checks: false

mitigate-autoblock: false
mitigate-autoblock: true
mitigate-desync-noslow: true

# Grim a veces cancela paquetes ilegal como los de Timer. Después de X paquetes en un solo segundo cancelados,
# cuando deberíamos simplemente expulsar al jugador? Esto es obligatorio ya que algunos limitadores de paquetes
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ debug-pipeline-on-join: false
# Active les vérifications expérimentales
experimental-checks: false

mitigate-autoblock: false
mitigate-autoblock: true
mitigate-desync-noslow: true

# Grim annule parfois des paquets illégaux, comme ceux liés au chronomètre, après avoir annulé X paquets en une seconde,
# à partir de combien de paquets annulés devrions-nous simplement expulser le joueur ?
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ debug-pipeline-on-join: false
# Enables experimental checks
experimental-checks: false

mitigate-autoblock: false
mitigate-autoblock: true
mitigate-desync-noslow: true

# Grim sometimes cancels illegal packets such as with timer, after X packets in a second cancelled, when should
# we simply kick the player? This is required as some packet limiters don't count packets cancelled by grim.
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ debug-pipeline-on-join: false
# 実験的なチェックを有効にします
experimental-checks: false

mitigate-autoblock: false
mitigate-autoblock: true
mitigate-desync-noslow: true

# Grimは "Timer" のような違反パケットをキャンセルすることがありますが、1秒間にキャンセルされたパケット数がXを超えた場合、
# プレイヤーを強制的にキックしますか?これは、いくつかのパケットリミッターがGrimによってキャンセルされたパケットをカウントしないためです。
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ debug-pipeline-on-join: false
# Experimentele controles inschakelen
experimental-checks: false

mitigate-autoblock: false
mitigate-autoblock: true
mitigate-desync-noslow: true

# Grim annuleert soms illegale pakketten zoals met timer, na X pakketten in een seconde geannuleerd, wanneer moeten
# we de speler gewoon schoppen? Dit is nodig omdat sommige pakket-begrenzers pakketten die door grim worden geannuleerd niet tellen
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config/pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ debug-pipeline-on-join: false
# Habilita verificações experimentais.
experimental-checks: false

mitigate-autoblock: false
mitigate-autoblock: true
mitigate-desync-noslow: true

# Grim às vezes cancela pacotes ilegais como com o timer, depois de X pacotes em um segundo que foram cancelados, quando
# deve-se simplesmente expulsar o jogador? Isso é requirido já que alguns limitadores de pacotes não contam pacotes
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ debug-pipeline-on-join: false
# Включает экспериментальные проверки
experimental-checks: false

mitigate-autoblock: false
mitigate-autoblock: true
mitigate-desync-noslow: true

# Грим иногда отменяет незаконные пакеты, например, с таймером, после X пакетов в секунду отмененных, когда следует
# нам просто кикнуть игрока? Это необходимо, так как некоторые ограничители пакетов не учитывают пакеты, отмененные Гримом.
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config/tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ debug-pipeline-on-join: false
# Deneysel kontrolleri etkinleştir
experimental-checks: false

mitigate-autoblock: false
mitigate-autoblock: true
mitigate-desync-noslow: true

# Grim bazen timer gibi yasa dışı paketleri iptal eder; bir saniyede X paket iptal edildikten sonra, ne zaman
# oyuncuyu basitçe atmalıyız? Bu, bazı paket sınırlayıcılarının Grim tarafından iptal edilen paketleri saymaması gerektiğindendir.
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ debug-pipeline-on-join: false
# 启用实验性检查
experimental-checks: false

mitigate-autoblock: false
mitigate-autoblock: true
mitigate-desync-noslow: true

# Grim有时会取消非法的数据包,比如用timer,在一秒钟内取消了数个数据包后,我们应该踢掉这个玩家?
# 我们认为是应该的,因为有些数据包限制器并不计算被Grim取消的数据包。
Expand Down

0 comments on commit 0d84b4e

Please sign in to comment.