From c4578b716f0cc78e836b2d4c9b75e55c90d8c5f7 Mon Sep 17 00:00:00 2001 From: IceDynamix <22303902+IceDynamix@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:50:49 +0200 Subject: [PATCH] increase invalid packet count before displaying message --- Cargo.lock | 2 ++ src/main.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fb89d51..60ed38a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -569,6 +569,7 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reliquary" version = "5.0.0" +source = "git+https://github.com/IceDynamix/reliquary?tag=v5.0.0#6eb51e0310bfefdcb9124221ceb9e0f7c058110b" dependencies = [ "base64", "etherparse", @@ -601,6 +602,7 @@ dependencies = [ [[package]] name = "reliquary-proc-macro" version = "0.1.0" +source = "git+https://github.com/IceDynamix/reliquary?tag=v5.0.0#6eb51e0310bfefdcb9124221ceb9e0f7c058110b" dependencies = [ "quote", "syn", diff --git a/src/main.rs b/src/main.rs index 4c04cef..6dbafbb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -204,7 +204,7 @@ where if commands.is_empty() { invalid += 1; - if invalid >= 50 && !warning_sent { + if invalid >= 100 && !warning_sent { error!( "received a large number of packets that could not be parsed" ); @@ -215,7 +215,7 @@ where warning_sent = true; } } else { - invalid -= 10; + invalid = 0.max(invalid - 1); for command in commands { if command.command_id == PlayerLoginScRsp {