Include user's displayName in server joined regex.

This commit is contained in:
Daniel Scalzi 2020-08-25 17:11:40 -04:00
parent 46853157ec
commit bd19b16530
No known key found for this signature in database
GPG Key ID: D18EA3FB4B142A57
3 changed files with 22 additions and 20 deletions

View File

@ -466,7 +466,6 @@ let proc
let hasRPC = false let hasRPC = false
// Joined server regex // Joined server regex
// Change this if your server uses something different. // Change this if your server uses something different.
const SERVER_JOINED_REGEX = /\[.+\]: \[CHAT\] [a-zA-Z0-9_]{1,16} joined the game/
const GAME_JOINED_REGEX = /\[.+\]: Sound engine started/ const GAME_JOINED_REGEX = /\[.+\]: Sound engine started/
const GAME_LAUNCH_REGEX = /^\[.+\]: (?:MinecraftForge .+ Initialized|ModLauncher .+ starting: .+)$/ const GAME_LAUNCH_REGEX = /^\[.+\]: (?:MinecraftForge .+ Initialized|ModLauncher .+ starting: .+)$/
const MIN_LINGER = 5000 const MIN_LINGER = 5000
@ -649,6 +648,9 @@ function dlAsync(login = true){
let pb = new ProcessBuilder(serv, versionData, forgeData, authUser, remote.app.getVersion()) let pb = new ProcessBuilder(serv, versionData, forgeData, authUser, remote.app.getVersion())
setLaunchDetails('Launching game..') setLaunchDetails('Launching game..')
// const SERVER_JOINED_REGEX = /\[.+\]: \[CHAT\] [a-zA-Z0-9_]{1,16} joined the game/
const SERVER_JOINED_REGEX = new RegExp(`\\[.+\\]: \\[CHAT\\] ${authUser.displayName} joined the game`)
const onLoadComplete = () => { const onLoadComplete = () => {
toggleLaunchArea(false) toggleLaunchArea(false)
if(hasRPC){ if(hasRPC){

32
package-lock.json generated
View File

@ -959,9 +959,9 @@
} }
}, },
"ejs": { "ejs": {
"version": "3.1.3", "version": "3.1.5",
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.3.tgz", "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.5.tgz",
"integrity": "sha512-wmtrUGyfSC23GC/B1SMv2ogAUgbQEtDmTIhfqielrG5ExIM9TP4UoYdi90jLF1aTcsWCJNEO0UrgKzP0y3nTSg==", "integrity": "sha512-dldq3ZfFtgVTJMLjOe+/3sROTzALlL9E34V4/sDtUd/KlBSS0s6U1/+WPE1B4sj9CXHJpL1M6rhNJnc9Wbal9w==",
"requires": { "requires": {
"jake": "^10.6.1" "jake": "^10.6.1"
} }
@ -976,9 +976,9 @@
} }
}, },
"electron": { "electron": {
"version": "9.2.0", "version": "9.2.1",
"resolved": "https://registry.npmjs.org/electron/-/electron-9.2.0.tgz", "resolved": "https://registry.npmjs.org/electron/-/electron-9.2.1.tgz",
"integrity": "sha512-4ecZ3rcGg//Gk4fAK3Jo61T+uh36JhU6HHR/PTujQqQiBw1g4tNPd4R2hGGth2d+7FkRIs5GdRNef7h64fQEMw==", "integrity": "sha512-ZsetaQjXB8+9/EFW1FnfK4ukpkwXCxMEaiKiUZhZ0ZLFlLnFCpe0Bg4vdDf7e4boWGcnlgN1jAJpBw7w0eXuqA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@electron/get": "^1.0.1", "@electron/get": "^1.0.1",
@ -1205,9 +1205,9 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
}, },
"eslint": { "eslint": {
"version": "7.6.0", "version": "7.7.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.6.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.7.0.tgz",
"integrity": "sha512-QlAManNtqr7sozWm5TF4wIH9gmUm2hE3vNRUvyoYAa4y1l5/jxD/PQStEjBMQtCqZmSep8UxrcecI60hOpe61w==", "integrity": "sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.0.0", "@babel/code-frame": "^7.0.0",
@ -1347,12 +1347,12 @@
"dev": true "dev": true
}, },
"espree": { "espree": {
"version": "7.2.0", "version": "7.3.0",
"resolved": "https://registry.npmjs.org/espree/-/espree-7.2.0.tgz", "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.0.tgz",
"integrity": "sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==", "integrity": "sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw==",
"dev": true, "dev": true,
"requires": { "requires": {
"acorn": "^7.3.1", "acorn": "^7.4.0",
"acorn-jsx": "^5.2.0", "acorn-jsx": "^5.2.0",
"eslint-visitor-keys": "^1.3.0" "eslint-visitor-keys": "^1.3.0"
} }
@ -1372,9 +1372,9 @@
}, },
"dependencies": { "dependencies": {
"estraverse": { "estraverse": {
"version": "5.1.0", "version": "5.2.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
"integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
"dev": true "dev": true
} }
} }

View File

@ -28,7 +28,7 @@
"adm-zip": "^0.4.16", "adm-zip": "^0.4.16",
"async": "^3.2.0", "async": "^3.2.0",
"discord-rpc": "^3.1.3", "discord-rpc": "^3.1.3",
"ejs": "^3.1.3", "ejs": "^3.1.5",
"ejs-electron": "^2.1.1", "ejs-electron": "^2.1.1",
"electron-updater": "^4.3.4", "electron-updater": "^4.3.4",
"fs-extra": "^9.0.1", "fs-extra": "^9.0.1",
@ -41,9 +41,9 @@
}, },
"devDependencies": { "devDependencies": {
"cross-env": "^7.0.2", "cross-env": "^7.0.2",
"electron": "^9.2.0", "electron": "^9.2.1",
"electron-builder": "^22.8.0", "electron-builder": "^22.8.0",
"eslint": "^7.6.0" "eslint": "^7.7.0"
}, },
"repository": { "repository": {
"type": "git", "type": "git",