From 664ea28ba64ffd8b40f4ceed420478b83a3887ee Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 30 Jul 2021 00:41:19 +0200 Subject: [PATCH 1/7] Hotfix IngameChatListener --- .../steamwar/bungeecore/bot/listeners/IngameChatListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java index ae39213..5cd1aa8 100644 --- a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java +++ b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java @@ -44,7 +44,7 @@ public class IngameChatListener extends BasicDiscordListener { if (steamwarUser == null) { event.getMessage().delete().complete(); } else { - ChatListener.discordChat(steamwarUser, event.getMessage().getContentRaw()); + ChatListener.discordChat(steamwarUser, event.getMessage().getContentRaw().replaceAll("\\$[a-f0-9]", "")); } } From 4390de1739bbdcc62207a121e4fca03faae5ffe6 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 30 Jul 2021 00:41:58 +0200 Subject: [PATCH 2/7] Hotfix IngameChatListener --- .../steamwar/bungeecore/bot/listeners/IngameChatListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java index 5cd1aa8..f3a47ca 100644 --- a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java +++ b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java @@ -44,7 +44,7 @@ public class IngameChatListener extends BasicDiscordListener { if (steamwarUser == null) { event.getMessage().delete().complete(); } else { - ChatListener.discordChat(steamwarUser, event.getMessage().getContentRaw().replaceAll("\\$[a-f0-9]", "")); + ChatListener.discordChat(steamwarUser, event.getMessage().getContentRaw().replaceAll("§[a-f0-9]", "")); } } From a452ee6faf197c1a023808e7222840aa07b75a81 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 30 Jul 2021 00:42:55 +0200 Subject: [PATCH 3/7] Hotfix ChatListener --- src/de/steamwar/bungeecore/listeners/ChatListener.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/listeners/ChatListener.java b/src/de/steamwar/bungeecore/listeners/ChatListener.java index 25c5474..8d86737 100644 --- a/src/de/steamwar/bungeecore/listeners/ChatListener.java +++ b/src/de/steamwar/bungeecore/listeners/ChatListener.java @@ -173,7 +173,10 @@ public class ChatListener extends BasicListener { } public static void discordChat(SteamwarUser user, String message){ - String name = user.getUserGroup().getColorCode() + user.getUserGroup().name() + " " + user.getUserName() + "§r"; + String name = "§r" + user.getUserGroup().name() + " " + user.getUserName() + "§r"; + if (user.getUserGroup() != UserGroup.Member) { + name = user.getUserGroup().getColorCode() + user.getUserGroup().name() + " " + user.getUserName() + "§r"; + } String chatcolor = user.getUserGroup().getChatColorCode(); if(user.getUserGroup() != UserGroup.Member || user.getTeam() == 12 || user.getTeam() == 285 || user.getTeam() == 54) From fd45a9873e7e5873f551676d6891bf17bd8bec62 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 30 Jul 2021 00:47:20 +0200 Subject: [PATCH 4/7] Hotfix IngameChatListener --- .../steamwar/bungeecore/bot/listeners/IngameChatListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java index f3a47ca..92882ba 100644 --- a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java +++ b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java @@ -41,7 +41,7 @@ public class IngameChatListener extends BasicDiscordListener { } Member member = event.getMember(); SteamwarUser steamwarUser = SteamwarUser.get(member.getIdLong()); - if (steamwarUser == null) { + if (steamwarUser == null || event.getMessage().getContentRaw().length() > 250) { event.getMessage().delete().complete(); } else { ChatListener.discordChat(steamwarUser, event.getMessage().getContentRaw().replaceAll("§[a-f0-9]", "")); From d13e6a56a6c0189a67856356482a62ef08c2a4b0 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 30 Jul 2021 00:51:32 +0200 Subject: [PATCH 5/7] Hotfix IngameChatListener --- .../steamwar/bungeecore/bot/listeners/IngameChatListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java index 92882ba..e848308 100644 --- a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java +++ b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java @@ -44,7 +44,7 @@ public class IngameChatListener extends BasicDiscordListener { if (steamwarUser == null || event.getMessage().getContentRaw().length() > 250) { event.getMessage().delete().complete(); } else { - ChatListener.discordChat(steamwarUser, event.getMessage().getContentRaw().replaceAll("§[a-f0-9]", "")); + ChatListener.discordChat(steamwarUser, event.getMessage().getContentRaw().replaceAll("(§[a-f0-9])|(\n)", "")); } } From 8d6f40601c045193e540dc7ae5b8c424f8e2109d Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 30 Jul 2021 00:52:14 +0200 Subject: [PATCH 6/7] Hotfix IngameChatListener --- .../steamwar/bungeecore/bot/listeners/IngameChatListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java index e848308..def05af 100644 --- a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java +++ b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java @@ -44,7 +44,7 @@ public class IngameChatListener extends BasicDiscordListener { if (steamwarUser == null || event.getMessage().getContentRaw().length() > 250) { event.getMessage().delete().complete(); } else { - ChatListener.discordChat(steamwarUser, event.getMessage().getContentRaw().replaceAll("(§[a-f0-9])|(\n)", "")); + ChatListener.discordChat(steamwarUser, event.getMessage().getContentRaw().replaceAll("§[a-f0-9]", "").replace('\n', ' ')); } } From 4f83b67cabcdcc3080651c7d6eccc1fe31bf60a0 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 30 Jul 2021 00:55:56 +0200 Subject: [PATCH 7/7] Hotfix at mentions in Discord --- .../steamwar/bungeecore/bot/listeners/IngameChatListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java index def05af..42116e6 100644 --- a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java +++ b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java @@ -44,7 +44,7 @@ public class IngameChatListener extends BasicDiscordListener { if (steamwarUser == null || event.getMessage().getContentRaw().length() > 250) { event.getMessage().delete().complete(); } else { - ChatListener.discordChat(steamwarUser, event.getMessage().getContentRaw().replaceAll("§[a-f0-9]", "").replace('\n', ' ')); + ChatListener.discordChat(steamwarUser, event.getMessage().getContentDisplay().replaceAll("§[a-f0-9]", "").replace('\n', ' ')); } }