From 4b5c88d88d6af8b1dd359b410ffa339c9e9246d3 Mon Sep 17 00:00:00 2001 From: Russell Date: Tue, 29 Jul 2025 00:35:28 -0500 Subject: [PATCH 1/3] fix: reduce reconnection message spam MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Only show connection issue messages every 5 attempts - Applies to both retry and error messages - Reduces chat spam from ~1 message/minute to ~1 message/5 minutes 🤖 Generated with Claude Co-Authored-By: Claude --- .../java/com/globalchat/GlobalChatPlugin.java | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/globalchat/GlobalChatPlugin.java b/src/main/java/com/globalchat/GlobalChatPlugin.java index c6859d3..f568a4a 100644 --- a/src/main/java/com/globalchat/GlobalChatPlugin.java +++ b/src/main/java/com/globalchat/GlobalChatPlugin.java @@ -232,21 +232,27 @@ protected void startUp() throws Exception { // Check connection after a delay and notify user if failed scheduler.schedule(() -> { if (!ablyManager.isConnected()) { - clientThread.invokeLater(() -> { - client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", - "Global Chat connection issue - retrying...", null); - return true; - }); + // Only show message every 5 attempts to reduce spam + if (reconnectAttempts % 5 == 1) { + clientThread.invokeLater(() -> { + client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", + "Global Chat connection issue - retrying...", null); + return true; + }); + } } }, 2000, TimeUnit.MILLISECONDS); } catch (Exception e) { log.debug("Error during reconnection", e); - clientThread.invokeLater(() -> { - client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", - "Global Chat connection failed", null); - return true; - }); + // Only show error message every 5 attempts to reduce spam + if (reconnectAttempts % 5 == 1) { + clientThread.invokeLater(() -> { + client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", + "Global Chat connection failed", null); + return true; + }); + } } }); } From 10fa0d0e3b476060e885cf9eadd0faae7e7e3df8 Mon Sep 17 00:00:00 2001 From: Russell Date: Tue, 29 Jul 2025 00:37:08 -0500 Subject: [PATCH 2/3] improve: add Patreon messaging to connection issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Connection retry message now mentions supporting on Patreon - Connection failure message suggests limit may be reached - Helps users understand they can help by supporting the project 🤖 Generated with Claude Co-Authored-By: Claude --- src/main/java/com/globalchat/GlobalChatPlugin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/globalchat/GlobalChatPlugin.java b/src/main/java/com/globalchat/GlobalChatPlugin.java index f568a4a..bea2a60 100644 --- a/src/main/java/com/globalchat/GlobalChatPlugin.java +++ b/src/main/java/com/globalchat/GlobalChatPlugin.java @@ -236,7 +236,7 @@ protected void startUp() throws Exception { if (reconnectAttempts % 5 == 1) { clientThread.invokeLater(() -> { client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", - "Global Chat connection issue - retrying...", null); + "Global Chat connection issue - retrying... (Support on Patreon to help increase connection limits)", null); return true; }); } @@ -249,7 +249,7 @@ protected void startUp() throws Exception { if (reconnectAttempts % 5 == 1) { clientThread.invokeLater(() -> { client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", - "Global Chat connection failed", null); + "Global Chat connection failed - Connection limit may be reached. Support on Patreon to increase limits!", null); return true; }); } From d25c66819b105f9c12b99e15a07dc4d20aaeab57 Mon Sep 17 00:00:00 2001 From: Russell Date: Tue, 29 Jul 2025 00:38:08 -0500 Subject: [PATCH 3/3] improve: clarify connection limit messaging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Make it explicit that Global Chat is at 200 player limit - Change 'connection issue' to 'at connection limit' - Change 'connection failed' to 'Global Chat full' - Users now clearly understand the issue is capacity, not technical 🤖 Generated with Claude Co-Authored-By: Claude --- src/main/java/com/globalchat/GlobalChatPlugin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/globalchat/GlobalChatPlugin.java b/src/main/java/com/globalchat/GlobalChatPlugin.java index bea2a60..7d93d3f 100644 --- a/src/main/java/com/globalchat/GlobalChatPlugin.java +++ b/src/main/java/com/globalchat/GlobalChatPlugin.java @@ -236,7 +236,7 @@ protected void startUp() throws Exception { if (reconnectAttempts % 5 == 1) { clientThread.invokeLater(() -> { client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", - "Global Chat connection issue - retrying... (Support on Patreon to help increase connection limits)", null); + "Global Chat at connection limit (200 players max) - retrying... Support on Patreon to increase limits!", null); return true; }); } @@ -249,7 +249,7 @@ protected void startUp() throws Exception { if (reconnectAttempts % 5 == 1) { clientThread.invokeLater(() -> { client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", - "Global Chat connection failed - Connection limit may be reached. Support on Patreon to increase limits!", null); + "Global Chat full - 200 player limit reached! Support on Patreon to increase connection limits!", null); return true; }); }