improve regex

This commit is contained in:
hippoz 2022-02-15 17:07:03 +02:00
parent d6a302ecee
commit 13ff55efe0
No known key found for this signature in database
GPG key ID: 7C52899193467641

View file

@ -22,9 +22,9 @@ const messageTypes = {
EVENT: 3 EVENT: 3
}; };
const chatMessageRegex = /^\[(?:.*?)\]: \<(?<username>.*)\> (?<message>.*)/; const chatMessageRegex = /^\[(?:.*?)\]: \<(?<username>[a-zA-Z0-9]+)\> (?<message>.*)/;
const joinNotificationRegex = /^\[(?:.*?)\]: (?<username>.*) joined the game/; const joinNotificationRegex = /^\[(?:.*?)\]: (?<username>[a-zA-Z0-9]+) joined the game/;
const leaveNotificationRegex = /^\[(?:.*?)\]: (?<username>.*) left the game/; const leaveNotificationRegex = /^\[(?:.*?)\]: (?<username>[a-zA-Z0-9]+) left the game/;
const rconConnection = new Rcon("localhost", "25575", process.env.RCON_PASSWORD); const rconConnection = new Rcon("localhost", "25575", process.env.RCON_PASSWORD);
export default class GatewayClient { export default class GatewayClient {