From e295297b541cc5372b65774dd18e8c60e52817ad Mon Sep 17 00:00:00 2001 From: Konicai <71294714+Konicai@users.noreply.github.com> Date: Sun, 15 Aug 2021 20:54:40 -0400 Subject: [PATCH 1/7] add zip file closed --- src/main/resources/tags/errors/zipfileclosed.tag | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/main/resources/tags/errors/zipfileclosed.tag diff --git a/src/main/resources/tags/errors/zipfileclosed.tag b/src/main/resources/tags/errors/zipfileclosed.tag new file mode 100644 index 00000000..84bbf197 --- /dev/null +++ b/src/main/resources/tags/errors/zipfileclosed.tag @@ -0,0 +1,8 @@ +type: issue-only +issues: java.lang.IllegalStateException: zip file closed + +--- + +If Geyser is showing this error, there are two possibilities: +A: You reloaded Geyser or the server, which is unsupported. Please do a full restart instead. +B: Geyser failed to start. Check the start of your server logs for why it failed to start. From 6b2c722f82207c5d7518a47f560b01e6ed676946 Mon Sep 17 00:00:00 2001 From: Konicai <71294714+Konicai@users.noreply.github.com> Date: Sun, 15 Aug 2021 21:09:38 -0400 Subject: [PATCH 2/7] error caused by outdated protocollib --- src/main/resources/tags/errors/protocollibinjector.tag | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/main/resources/tags/errors/protocollibinjector.tag diff --git a/src/main/resources/tags/errors/protocollibinjector.tag b/src/main/resources/tags/errors/protocollibinjector.tag new file mode 100644 index 00000000..0c711fd0 --- /dev/null +++ b/src/main/resources/tags/errors/protocollibinjector.tag @@ -0,0 +1,6 @@ +type: issue-only +issues: com.comphenix.protocol.injector.netty.ProtocolInjector$3 is not a @Sharable handler, so can't be added or removed multiple times. + +--- + +Update ProtocolLib. \ No newline at end of file From 1a93aef383a260bfa47f88dc881549a826a9eff5 Mon Sep 17 00:00:00 2001 From: Konicai <71294714+konicai@users.noreply.github.com> Date: Fri, 29 Oct 2021 12:19:56 -0400 Subject: [PATCH 3/7] improve zip file closed --- src/main/resources/tags/errors/zipfileclosed.tag | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/resources/tags/errors/zipfileclosed.tag b/src/main/resources/tags/errors/zipfileclosed.tag index 84bbf197..cae53997 100644 --- a/src/main/resources/tags/errors/zipfileclosed.tag +++ b/src/main/resources/tags/errors/zipfileclosed.tag @@ -3,6 +3,7 @@ issues: java.lang.IllegalStateException: zip file closed --- -If Geyser is showing this error, there are two possibilities: +If **Geyser** is showing this error, there are are a few likely causes: A: You reloaded Geyser or the server, which is unsupported. Please do a full restart instead. -B: Geyser failed to start. Check the start of your server logs for why it failed to start. +B: Your Geyser jar is corrupted, and you need to re-download it. +B: Geyser failed to start for a different reason. Check the start of your server logs for a different error explaining why it failed to start. From 70c036fa22836c4a2275d60e85e39469983440f7 Mon Sep 17 00:00:00 2001 From: Konicai <71294714+konicai@users.noreply.github.com> Date: Fri, 29 Oct 2021 12:46:26 -0400 Subject: [PATCH 4/7] make it less case sensitive --- .../org/geysermc/discordbot/listeners/ErrorAnalyzer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/geysermc/discordbot/listeners/ErrorAnalyzer.java b/src/main/java/org/geysermc/discordbot/listeners/ErrorAnalyzer.java index 14314105..26b6cf11 100644 --- a/src/main/java/org/geysermc/discordbot/listeners/ErrorAnalyzer.java +++ b/src/main/java/org/geysermc/discordbot/listeners/ErrorAnalyzer.java @@ -108,7 +108,7 @@ public void onMessageReceived(MessageReceivedEvent event) { groups[i] = groups[i] == null ? "" : groups[i]; // Replace nulls with empty strings } - url = String.format(logUrlPatterns.get(regex), groups); + url = String.format(logUrlPatterns.get(regex), groups); // Casting this to Object breaks something, don't do it break; } @@ -147,7 +147,7 @@ private void handleLog(MessageReceivedEvent event, String logContent) { break; } - if (logContent.contains(issue)) { + if (logContent.toLowerCase().contains(issue.toLowerCase())) { String title = BotHelpers.trim(issue, MessageEmbed.TITLE_MAX_LENGTH); if (MessageHelper.similarFieldExists(embedBuilder.getFields(), title)) { @@ -161,7 +161,7 @@ private void handleLog(MessageReceivedEvent event, String logContent) { } // Add any errors from stacktraces - if (exceptions.size() != 0) { + if (!exceptions.isEmpty()) { // Get the github trees for fetching the file paths String branch = "master"; Matcher branchMatcher = BRANCH_PATTERN.matcher(logContent); From 817f855131bde017ee097179a04ec6506baaca1e Mon Sep 17 00:00:00 2001 From: Konicai <71294714+konicai@users.noreply.github.com> Date: Fri, 29 Oct 2021 13:40:29 -0400 Subject: [PATCH 5/7] update tags and modify tag readme --- .../geysermc/discordbot/tags/TagsManager.java | 2 +- src/main/resources/tags/README.md | 27 +++++++++++++++++++ .../tags/errors/unsupportedjavadetected.tag | 9 +++++++ src/main/resources/tags/info/javaversion.tag | 2 +- 4 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/tags/errors/unsupportedjavadetected.tag diff --git a/src/main/java/org/geysermc/discordbot/tags/TagsManager.java b/src/main/java/org/geysermc/discordbot/tags/TagsManager.java index 6a885821..db43f082 100644 --- a/src/main/java/org/geysermc/discordbot/tags/TagsManager.java +++ b/src/main/java/org/geysermc/discordbot/tags/TagsManager.java @@ -106,7 +106,7 @@ private static void loadTags() { switch (lineParts[0]) { // intentional fallthrough case "type", "aliases" -> tagData.put(lineParts[0], lineParts[1].trim().toLowerCase()); case "image" -> tagData.put(lineParts[0], lineParts[1].trim()); - case "issues" -> issueTriggers = lineParts[1].split("\\|\\|"); + case "issues" -> issueTriggers = lineParts[1].split("\\|\\|"); // Issues are delimited by || default -> GeyserBot.LOGGER.warn("Invalid tag option key '" + lineParts[0] + "' for tag '" + tagName + "'!"); } } diff --git a/src/main/resources/tags/README.md b/src/main/resources/tags/README.md index 30dca05e..71035aa7 100644 --- a/src/main/resources/tags/README.md +++ b/src/main/resources/tags/README.md @@ -33,3 +33,30 @@ type: text-raw Test ``` + +## Type: Issue only +The below lays out the `issue-only` tag type. This tag will not be registered as a tag that users can run, and only exists to +register responses for issues. It follows the rules that `Issue responses` below sets out. + +```markdown +type: issue-only +issues: || || ... + +--- + +Text +``` + +## Issue responses +Issue responses work with `text`, `text-raw` and `issue-only` types. Any issues listed are registered to have the content of the tag as the issue response. +Different issues are delimited by `||`, allowing differently worded issues to have the same response. +When a message or log file is shared, it will be scanned to check if it contains any known issues. Responses to the issues found will be sent in a single embed. +`text` and `text-raw` types with issues listed can still be called with the tag command; they do not lose their functionality. +```markdown +type: text +issues: || || ... + +--- + +Text +``` diff --git a/src/main/resources/tags/errors/unsupportedjavadetected.tag b/src/main/resources/tags/errors/unsupportedjavadetected.tag new file mode 100644 index 00000000..7ab59683 --- /dev/null +++ b/src/main/resources/tags/errors/unsupportedjavadetected.tag @@ -0,0 +1,9 @@ +type: issue-only +issues: Unsupported Java detected (60.0) + +--- + +Old server versions do not support Java 16, which Geyser requires. Paper 1.15.2 and higher can be forced to use Java 16 by adding `-DPaper.IgnoreJavaVersion=true` +to the JVM startup flags. +Servers on 1.8.8 can use Java 16 if `use-native-transport` is set to `false` in `server.properties`, although Geyser +does not support versions below 1.12.2 \ No newline at end of file diff --git a/src/main/resources/tags/info/javaversion.tag b/src/main/resources/tags/info/javaversion.tag index 13631561..1761ae18 100644 --- a/src/main/resources/tags/info/javaversion.tag +++ b/src/main/resources/tags/info/javaversion.tag @@ -3,4 +3,4 @@ issues: java.lang.UnsupportedClassVersionError --- -Geyser and Floodgate currently require Java 16 or higher. Information about how you can update to this is [here](https://paper.readthedocs.io/en/latest/java-update/index.html). \ No newline at end of file +Geyser currently requires Java 16 or higher. Information about how you can update to this is [here](https://paper.readthedocs.io/en/latest/java-update/index.html). \ No newline at end of file From 36adf989ddd7f22a4209f4561a635eba12c17025 Mon Sep 17 00:00:00 2001 From: Konicai <71294714+Konicai@users.noreply.github.com> Date: Tue, 2 Nov 2021 22:22:47 -0400 Subject: [PATCH 6/7] Update zipfileclosed.tag --- src/main/resources/tags/errors/zipfileclosed.tag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/tags/errors/zipfileclosed.tag b/src/main/resources/tags/errors/zipfileclosed.tag index cae53997..bef37e84 100644 --- a/src/main/resources/tags/errors/zipfileclosed.tag +++ b/src/main/resources/tags/errors/zipfileclosed.tag @@ -6,4 +6,4 @@ issues: java.lang.IllegalStateException: zip file closed If **Geyser** is showing this error, there are are a few likely causes: A: You reloaded Geyser or the server, which is unsupported. Please do a full restart instead. B: Your Geyser jar is corrupted, and you need to re-download it. -B: Geyser failed to start for a different reason. Check the start of your server logs for a different error explaining why it failed to start. +C: Geyser failed to start for a different reason. Check the start of your server logs for a different error explaining why it failed to start. From 9c329b738ac8737da85d6eafdd6963f20f5624d7 Mon Sep 17 00:00:00 2001 From: Konicai <71294714+Konicai@users.noreply.github.com> Date: Sun, 7 Nov 2021 14:26:28 -0500 Subject: [PATCH 7/7] cast to object array --- .../java/org/geysermc/discordbot/listeners/ErrorAnalyzer.java | 2 +- src/main/resources/tags/errors/protocollibinjector.tag | 2 +- src/main/resources/tags/errors/unsupportedjavadetected.tag | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/geysermc/discordbot/listeners/ErrorAnalyzer.java b/src/main/java/org/geysermc/discordbot/listeners/ErrorAnalyzer.java index 26b6cf11..5440f68a 100644 --- a/src/main/java/org/geysermc/discordbot/listeners/ErrorAnalyzer.java +++ b/src/main/java/org/geysermc/discordbot/listeners/ErrorAnalyzer.java @@ -108,7 +108,7 @@ public void onMessageReceived(MessageReceivedEvent event) { groups[i] = groups[i] == null ? "" : groups[i]; // Replace nulls with empty strings } - url = String.format(logUrlPatterns.get(regex), groups); // Casting this to Object breaks something, don't do it + url = String.format(logUrlPatterns.get(regex), (Object[]) groups); break; } diff --git a/src/main/resources/tags/errors/protocollibinjector.tag b/src/main/resources/tags/errors/protocollibinjector.tag index 0c711fd0..29a7da9f 100644 --- a/src/main/resources/tags/errors/protocollibinjector.tag +++ b/src/main/resources/tags/errors/protocollibinjector.tag @@ -3,4 +3,4 @@ issues: com.comphenix.protocol.injector.netty.ProtocolInjector$3 is not a @Shara --- -Update ProtocolLib. \ No newline at end of file +Update ProtocolLib. diff --git a/src/main/resources/tags/errors/unsupportedjavadetected.tag b/src/main/resources/tags/errors/unsupportedjavadetected.tag index 7ab59683..a55b5b3f 100644 --- a/src/main/resources/tags/errors/unsupportedjavadetected.tag +++ b/src/main/resources/tags/errors/unsupportedjavadetected.tag @@ -6,4 +6,4 @@ issues: Unsupported Java detected (60.0) Old server versions do not support Java 16, which Geyser requires. Paper 1.15.2 and higher can be forced to use Java 16 by adding `-DPaper.IgnoreJavaVersion=true` to the JVM startup flags. Servers on 1.8.8 can use Java 16 if `use-native-transport` is set to `false` in `server.properties`, although Geyser -does not support versions below 1.12.2 \ No newline at end of file +does not support versions below 1.12.2