From 8983af809bfe25e2cc1e4e91cdde73e1e07daeaf Mon Sep 17 00:00:00 2001 From: Martin Graversen Date: Wed, 27 Sep 2023 18:40:36 +0200 Subject: [PATCH] :bug: OxidePluginEventParser picked up team chat payloads --- .../rust/rcon/event/oxide/OxidePluginEventParser.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/graversen/rust/rcon/event/oxide/OxidePluginEventParser.java b/src/main/java/io/graversen/rust/rcon/event/oxide/OxidePluginEventParser.java index a916721..7e80c8e 100644 --- a/src/main/java/io/graversen/rust/rcon/event/oxide/OxidePluginEventParser.java +++ b/src/main/java/io/graversen/rust/rcon/event/oxide/OxidePluginEventParser.java @@ -11,6 +11,7 @@ public class OxidePluginEventParser extends BaseRustEventParser> eventParser() { @Override public boolean supports(@NonNull RustRconResponse payload) { final var message = payload.getMessage(); + + if (message.isBlank()) { + return false; + } + if (message.matches(EVENT_PATTERN)) { final var prefix = message.substring(message.indexOf('['), message.indexOf(']') + 1); - return !prefix.equals(NATIVE_EVENT_PREFIX) && !prefix.equals(CHAT_EVENT_PREFIX) && !prefix.equals(ENTITY_COMMAND_EVENT_PREFIX); + return !prefix.equals(NATIVE_EVENT_PREFIX) + && !prefix.equals(CHAT_EVENT_PREFIX) + && !prefix.equals(TEAM_CHAT_EVENT_PREFIX) + && !prefix.equals(ENTITY_COMMAND_EVENT_PREFIX); } return false;