From eb5fdfa84e0ec6fef28643d0d828f02c965c48e7 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Sat, 2 Mar 2024 15:11:14 -0500 Subject: [PATCH] docs(pterodactyl): added regex examples page --- .docs/pterodactyl/configuration.md | 33 +-------------- .docs/pterodactyl/regex.md | 65 ++++++++++++++++++++++++++++++ mkdocs.yml | 1 + 3 files changed, 68 insertions(+), 31 deletions(-) create mode 100644 .docs/pterodactyl/regex.md diff --git a/.docs/pterodactyl/configuration.md b/.docs/pterodactyl/configuration.md index f148869..360b5e5 100644 --- a/.docs/pterodactyl/configuration.md +++ b/.docs/pterodactyl/configuration.md @@ -96,58 +96,29 @@ Default value: `Server started!` ## `regex` -If you're not running on recent versions of Paper, which this cog was developed against, or you're otherwise changing for format of chat messages, you'll need to add custom regex through the `[p]pterodactyl config regex` command. Same thing applies if any other type of message isn't being detected. I recomend using ChatGPT or something similar for this, or if you need help, you can join my [Discord server](https://discord.gg/eMUMe77Yb8). +If you're not running on recent versions of Paper, which this cog was developed against, or you're otherwise changing for format of chat messages, you'll need to add custom regex through the `[p]pterodactyl config regex` command. Same thing applies if any other type of message isn't being detected. I recomend using ChatGPT or something similar for this, or if you need help, you can join my [Discord server](https://discord.gg/eMUMe77Yb8). +See [Regex Examples](regex.md) for default values. ### `achievement` This regex pattern is used to detect advacnements/challenges. The default should work for most Minecraft servers. -Default value: - -```re -^\[\d{2}:\d{2}:\d{2} INFO\]: (.*) has (made the advancement|completed the challenge) \[(.*)\]$ -``` - ### `chat` This regex pattern is used to detect chat messages. You will probably have to change this if you're using any plugins or mods that use custom chat formatting, like EssentialsX Chat or Styled Chat. -Default value: - -```re -\[(\d{2}:\d{2}:\d{2})\sINFO\]:\s<(\w+)>\s(.*) -``` - ### `join` This regex pattern is used to detect whenever a user joins the server. You shouldn't usually need to change this. -Default value: - -```re -^\[\d{2}:\d{2}:\d{2} INFO\]: ([^<\n]+) joined the game$ -``` - ### `leave` This regex pattern is used to detect whenever a user leaves the server. You shouldn't usually need to change this. -Default value: - -```re -^\[\d{2}:\d{2}:\d{2} INFO\]: ([^<\n]+) left the game$ -``` - ### `server` This regex pattern is used to detect whenever a server message is sent. You will have to change this if you aren't running on Paper, most likely. -Default value: - -```re -^\[\d{2}:\d{2}:\d{2} INFO\]:(?: \[Not Secure\])? \[(?:Server|Rcon)\] (.*) -``` - ## `serverid` This option determines which server's websocket to connect to. See [Getting Started](getting-started.md#getting-server-information) for more information on this. diff --git a/.docs/pterodactyl/regex.md b/.docs/pterodactyl/regex.md new file mode 100644 index 0000000..41cdded --- /dev/null +++ b/.docs/pterodactyl/regex.md @@ -0,0 +1,65 @@ +# Regex Examples + +## 1.20.4 - Paper (Default) + +### Achievements + +```re +^\[\d{2}:\d{2}:\d{2} INFO\]: (.*) has (made the advancement|completed the challenge) \[(.*)\]$ +``` + +### Chat + +```re +\[\d{2}:\d{2}:\d{2}\sINFO\]: <(\w+)>\s(.*) +``` + +### Join + +```re +^\[\d{2}:\d{2}:\d{2} INFO\]: ([^<\n]+) joined the game$ +``` + +### Leave + +```re +^\[\d{2}:\d{2}:\d{2} INFO\]: ([^<\n]+) left the game$ +``` + +### Server + +```re +^\[\d{2}:\d{2}:\d{2} INFO\]:(?: \[Not Secure\])? \[(?:Server|Rcon)\] (.*) +``` + +## 1.20.1 - Forge + +### Achievements + +```re +^\[\d{2}:\d{2}:\d{2}\] \[Server thread\/INFO\] \[minecraft\/MinecraftServer\]: (.*) has (made the advancement|completed the challenge) \[(.*)\]$ +``` + +### Chat + +```re +^\[\d{2}:\d{2}:\d{2}\] \[Server thread\/INFO\] \[minecraft\/MinecraftServer\]: <(\w+)>\s(.*) +``` + +### Join + +```re +^\[\d{2}:\d{2}:\d{2}\] \[Server thread\/INFO\] \[minecraft\/MinecraftServer\]: ([^<\n]+) joined the game$ +``` + +### Leave + +```re +^\[\d{2}:\d{2}:\d{2}\] \[Server thread\/INFO\] \[minecraft\/MinecraftServer\]: ([^<\n]+) left the game$ +``` + +### Server + +```re +^\[\d{2}:\d{2}:\d{2}\] \[Server thread\/INFO\] \[minecraft\/MinecraftServer\]: \[(?:Server|Rcon)\] (.*) +``` diff --git a/mkdocs.yml b/mkdocs.yml index 6b78dd0..03d27f7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -23,6 +23,7 @@ nav: - pterodactyl/index.md - Getting Started: pterodactyl/getting-started.md - Configuration: pterodactyl/configuration.md + - Regex Examples: pterodactyl/regex.md plugins: - git-authors