-
-
Notifications
You must be signed in to change notification settings - Fork 978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bot completely freezes on chat message #902
Comments
Ah so apparently removing the checkForChatPatterns function fixes this, but the problem is I need that to check for certain messages. Ok I just added a if statement to check if it at least includes some of the patterns I would want, not fully a solution but fixes this for me. |
Well this is a bug. Seems like regexp dos. |
@gamer745 Can you run your bot with |
This appears to be due to mineflayer/lib/plugins/chat.js Line 8 in 030930d
the username detection regex looks unnecessarily complex. |
@extremeheat actually, there's a reason to that. We're matching many possible chat patterns at once. |
Would be good to have unit tests for these patterns.
So we can improve them without breaking what they parse
…On Mon, Jan 18, 2021, 10:17 Kasper Seweryn ***@***.***> wrote:
@extremeheat <https://github.com/extremeheat> actually, there's a reason
to that. We're matching many possible chat patterns at once.
Though I guess it could be replaced with
(?:\\([^)]+\\)|\\[.[^\]]+\\]|.)*?(\\w+) to be more strict.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#902 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR437QNNGPDYCAA4XXM43LS2P4DZANCNFSM4KLORIOQ>
.
|
Is there any way to fix this? |
Can confirm, still happens. Bot goes and crashes randomly (probably a unsupported string) process hangs forever, and it just doesnt respond anymore. |
This lag should have been fixed in #2350 Not a great regex but not really relevant anymore in 1.19+ since chat is now formatted on the client. We don't need regex anymore. Kind of surprised chat event wasn't updated in 1.19 update, but should be an easy fix to listen to mineflayer/lib/plugins/chat.js Line 199 in 5c71edf
|
Versions
mineflayer: 2.9.6
server: paperSpigot 1.8.8
node: 12.14.0
I came across this chat message (Im not sure what about it) but it completely hangs the entire nodejs app, and I have to restart it. This could be with minecraft protocol or chat messages with that, but im not sure.
Since im not sure what about it hangs the bot, its on the server manacube.net, on /server factions
and the command "/f who royal"
It seems to work with any other faction on there. I do nothing with the output, it just runs the command and then the process stops. It could be too big of a message possibly? I do need a fix for this in that case or at least to return an error.
Message:
The text was updated successfully, but these errors were encountered: