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

Fix #9243: [Network] For a dedicated server use a fallback client and server name #9245

Merged
merged 1 commit into from May 11, 2021

Conversation

rubidium42
Copy link
Contributor

Motivation / Problem

Closes #9243. For dedicated servers client name would not be set.

Description

Check whether the client and server name have been set, and if not set them with some default value. Furthermore warn the user about this with pointer on how to resolve the issue. Next to that also complain when that default value is used as name.
It is not necessary for the non-dedicated server as the GUI already checks the client name, and the server name will also have some default.

Limitations

The server can still set its client name to be invalid with some effort, though that is then to be considered their problem for now. When/once the validation of string settings can be done, the issue of the previous line including setting bad/invalid server names can be solved once and for all, as it would just reject the new value before writing instead of writing the value and then running a post-change callback that has no way to revert the value to the old (correct) one.
The fallback is "Unnamed Client" and "Unnamed Server". This capitalization has been chosen as the server variant is the one currently used, so it would also warn on the current "unset" server names.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

…ent and server name

Also warn when the client or server name has not been set and provide pointers on how to set them
@rubidium42 rubidium42 merged commit 0968d00 into OpenTTD:master May 11, 2021
@rubidium42 rubidium42 deleted the nameless_server branch May 11, 2021 17:09
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.

Cannot join server which has no playername
2 participants