-
Notifications
You must be signed in to change notification settings - Fork 448
[BUG] BasicIO still uses Console.KeyAvailable #2873
Copy link
Copy link
Open
Labels
a:bugCrash or feature not working as expectedCrash or feature not working as expected
Description
Prerequisites
- I made sure I am running the latest development build
- I tried to look for similar issues before opening a new one
- I have set
debugmessages=truein config to diagnose my issue - I have redacted session tokens and passwords before attaching screenshots
Minecraft Version
1.16.5
Console Client Version
Latest
Expected Behavior
BasicIO mode should never throw
MCC] Unhandled exception. System.InvalidOperationException: Cannot see if a key has been pressed when either application does not have a console or when console input has been redirected from a file. Try Console.In.Peek.
Actual Behavior
BasicIO is supposed to set to interative mode, yet subprocess breaks.
Following is the offending line
public static void HandleFailure(string? errorMessage = null, bool versionError = false, ChatBots.AutoRelog.DisconnectReason? disconnectReason = null)
{
if (!String.IsNullOrEmpty(errorMessage))
{
ConsoleIO.Reset();
HERE>>>>
while (Console.KeyAvailable)
Console.ReadKey(true);
ConsoleIO.WriteLine(errorMessage);
HandleFailure is called in multiple places but doesn't check for BasicIO.
Steps to Reproduce the bug
- Run MCC Client using python subprocess
- Reach any situation which calls HandleFailure (eg single dash arguments or server offline)
- Code tries to use Console.KeyAvailable and gives error
Attach screenshot here (If applicable)
No response
Anythings that could help diagnosing the bug
Device
None
Operating System
None
Server Address (If applicable)
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a:bugCrash or feature not working as expectedCrash or feature not working as expected