From c44498eade4f4ccea266a773f9b37ae7a85fb786 Mon Sep 17 00:00:00 2001 From: Joud Kandeel Date: Fri, 6 Mar 2026 20:01:45 +0100 Subject: [PATCH] added getQueueSize() to help not flooding the event system --- Minecraft-Community-Edition/Core/QEventBus.cpp | 4 ++++ Minecraft-Community-Edition/Core/QEventBus.hpp | 1 + 2 files changed, 5 insertions(+) diff --git a/Minecraft-Community-Edition/Core/QEventBus.cpp b/Minecraft-Community-Edition/Core/QEventBus.cpp index 8c6d584..4e0116f 100644 --- a/Minecraft-Community-Edition/Core/QEventBus.cpp +++ b/Minecraft-Community-Edition/Core/QEventBus.cpp @@ -39,6 +39,10 @@ namespace mce { if (QEventBus::thread.joinable()) QEventBus::thread.join(); } + size_t QEventBus::getQueueSize() const { + return QEventBus::queue.size(); + } + QEventBus::~QEventBus() { QEventBus::stop(); } diff --git a/Minecraft-Community-Edition/Core/QEventBus.hpp b/Minecraft-Community-Edition/Core/QEventBus.hpp index 4123ca8..d91a682 100644 --- a/Minecraft-Community-Edition/Core/QEventBus.hpp +++ b/Minecraft-Community-Edition/Core/QEventBus.hpp @@ -123,6 +123,7 @@ namespace mce { */ void stop(); + size_t getQueueSize() const; /** * @brief Destructor. *