diff options
| author | mat <git@matdoes.dev> | 2025-03-13 20:13:58 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-03-13 20:13:58 +0000 |
| commit | 7a192acc99358818c2f90cf4e2b8b236f91cfbf7 (patch) | |
| tree | cf632093809a4e06eaf651399c365c137fb6cdd8 /azalea | |
| parent | e9a5df2e875fe845e098781a0bde4b6d8c0786f1 (diff) | |
| download | azalea-drasl-7a192acc99358818c2f90cf4e2b8b236f91cfbf7.tar.xz | |
properly remove from the EntityIdIndex component on despawn
Diffstat (limited to 'azalea')
| -rw-r--r-- | azalea/src/swarm/mod.rs | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index 04bc94dc..c8546c2b 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -698,10 +698,33 @@ impl Swarm { ) { while let Some(event) = rx.recv().await { if rx.len() > 1_000 { - static WARNED: AtomicBool = AtomicBool::new(false); - if !WARNED.swap(true, atomic::Ordering::Relaxed) { + static WARNED_1_000: AtomicBool = AtomicBool::new(false); + if !WARNED_1_000.swap(true, atomic::Ordering::Relaxed) { warn!("the client's Event channel has more than 1000 items!") } + + if rx.len() > 10_000 { + static WARNED_10_000: AtomicBool = AtomicBool::new(false); + if !WARNED_10_000.swap(true, atomic::Ordering::Relaxed) { + warn!("the client's Event channel has more than 10,000 items!!") + } + + if rx.len() > 100_000 { + static WARNED_100_000: AtomicBool = AtomicBool::new(false); + if !WARNED_100_000.swap(true, atomic::Ordering::Relaxed) { + warn!("the client's Event channel has more than 100,000 items!!!") + } + + if rx.len() > 1_000_000 { + static WARNED_1_000_000: AtomicBool = AtomicBool::new(false); + if !WARNED_1_000_000.swap(true, atomic::Ordering::Relaxed) { + warn!( + "the client's Event channel has more than 1,000,000 items!!!! i sincerely hope no one ever sees this warning" + ) + } + } + } + } } // we can't handle events here (since we can't copy the handler), |
