Fix #9243: [Network] For a dedicated server use a fallback client and server name #9245
+24
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.