docs(pterodactyl): added regex examples page

This commit is contained in:
Seaswimmer 2024-03-02 15:11:14 -05:00
parent 030291113b
commit eb5fdfa84e
Signed by: cswimr
GPG key ID: B8953EC01E5C4063
3 changed files with 68 additions and 31 deletions

View file

@ -96,58 +96,29 @@ Default value: `Server started!`
## `regex` ## `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` ### `achievement`
This regex pattern is used to detect advacnements/challenges. The default should work for most Minecraft servers. 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` ### `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. 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` ### `join`
This regex pattern is used to detect whenever a user joins the server. You shouldn't usually need to change this. 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` ### `leave`
This regex pattern is used to detect whenever a user leaves the server. You shouldn't usually need to change this. 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` ### `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. 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` ## `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. This option determines which server's websocket to connect to. See [Getting Started](getting-started.md#getting-server-information) for more information on this.

View file

@ -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)\] (.*)
```

View file

@ -23,6 +23,7 @@ nav:
- pterodactyl/index.md - pterodactyl/index.md
- Getting Started: pterodactyl/getting-started.md - Getting Started: pterodactyl/getting-started.md
- Configuration: pterodactyl/configuration.md - Configuration: pterodactyl/configuration.md
- Regex Examples: pterodactyl/regex.md
plugins: plugins:
- git-authors - git-authors