Skip to content
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

Return exit codes for specific failures when in non-interactive mode #1120

Merged
merged 1 commit into from Jul 10, 2020

Conversation

grantemsley
Copy link
Contributor

Fixes #1116

When in non-interactive mode (exitonfailure is enabled), returns distinct exit codes for some of the known failures.

This will let users handle them differently in their scripts. For example I have a script that restart the console client if it's killed or crashes. Right now I do something like this:

:start
MinecraftClient.exe
timeout /t 60
goto start

Now I can do this:

:start
MinecraftClient.exe
if '%ERRORLEVEL%'=='4' goto loginfailed
timeout /t 60
goto start

:loginfailed
echo 'Login failure. Stopping.'
pause

Doing this should avoid hammering the authentication servers with a bad password, and prevent getting IP blacklisted as easily.

@ORelio
Copy link
Member

ORelio commented Jul 10, 2020

Seems good to me. Thanks for your contribution!

@ORelio ORelio merged commit 9370064 into MCCTeam:master Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return exit codes on login failure, server disconnect
2 participants