-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Don't frame as error when player is disconnected using core.disconnect_player
#16814
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
base: master
Are you sure you want to change the base?
Conversation
| error_title = fgettext("An error occurred in a Lua script:") | ||
| else | ||
| error_title = fgettext("An error occurred:") | ||
| error_title = fgettext("The server has denied access:") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now we get the inverse bug: if some kind of error occurs, the dialog says "The server has denied access", which is a lie.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is that needed in general, since the other text (which allows for a reason) already kinda says what's up...
|
why is that needed in general, since the other text (which allows for a reason) already kinda says what's up... |
|
I agree with sfan5, the old text for actual server errors should not be removed. The server can disconnect you both with a normal function call (disconnect, ban, kick, etc.) but also on a server error. This message field should not make incorrect claims, i.e. say that an error occured when none occured, or that you were disconnected when actually an error occured (which would be technically true but it would be missing the point). Does Luanti have any technical distinction of the type of disconnect reason (like: mod error, server error, disconnected by function call, etc.) or is it currently all just strings? |
Yes, see enum AccessDeniedCode : u8 {
SERVER_ACCESSDENIED_WRONG_PASSWORD,
SERVER_ACCESSDENIED_UNEXPECTED_DATA,
SERVER_ACCESSDENIED_SINGLEPLAYER,
SERVER_ACCESSDENIED_WRONG_VERSION,
SERVER_ACCESSDENIED_WRONG_CHARS_IN_NAME,
SERVER_ACCESSDENIED_WRONG_NAME,
SERVER_ACCESSDENIED_TOO_MANY_USERS,
SERVER_ACCESSDENIED_EMPTY_PASSWORD,
SERVER_ACCESSDENIED_ALREADY_CONNECTED,
SERVER_ACCESSDENIED_SERVER_FAIL,
SERVER_ACCESSDENIED_CUSTOM_STRING,
SERVER_ACCESSDENIED_SHUTDOWN,
SERVER_ACCESSDENIED_CRASH,
SERVER_ACCESSDENIED_MAX,
};
The problem is that this is eventually thrown away when going through the abstractions, only the string is preserved by |
From my understanding, the Lua side only recieves |
|
Could replicate the same hack and add "AuthError" to such errors so they can be detected in the main menu. |
that doesn't sound like a good long-term solution. though it would work for certain errors previously mentioned here:
like wrong password, wrong chars in name, empty password, etc, it would introduce more misleading messages when maybe Luanti could expose the actual |
|
Check out Do you have a C++ language server like clangd set up? Otherwise this could be a bit tedious; it would involve a lot of manual |


Fixes #14986
Simply changes the form when a player is disconnected using
core.disconnect_playerto say "The server has denied access" rather than the misleading "An error occurred"To do
idk
How to test
/lua core.disconnect_player(me:get_player_name(), "some reason text")