[BUG] WebSocketBot tries to send different pieces of data simutaneously, causing an error #2804
Open
4 tasks done
Labels
a:bug
Crash or feature not working as expected
Prerequisites
debugmessages=true
in config to diagnose my issueMinecraft Version
1.18.2
Console Client Version
20240906-276
Expected Behavior
The WebSocketBot should use a lock, request queue or something else to prevent
webSocket.SendAsync()
being called before the previous send operation finishes.Actual Behavior
My bot was near a farm filled with mobs, and there were a lot of events being reported. The WebSocket connection constantly dies as the client reports
System.InvalidOperationException: There is already one outstanding 'SendAsync' call for this WebSocket instance. ReceiveAsync and SendAsync can be called simultaneously, but at most one outstanding operation for each of them is allowed at the same time.
Steps to Reproduce the bug
I haven't found a stable way to reproduce the issue but my bot was near a lot of mobs while entity handling was enabled, and I was using MCC.js to control the bot.
Attach screenshot here (If applicable)
No response
Anythings that could help diagnosing the bug
The exception occured here:
Minecraft-Console-Client/MinecraftClient/ChatBots/WebSocketBot.cs
Lines 172 to 174 in 27e6643
Device
Desktop
Operating System
Windows
Server Address (If applicable)
No response
The text was updated successfully, but these errors were encountered: