* Trim the given server name in place, i.e. remove leading and trailing spaces. * After the trim check whether the server name is not empty. * When the server name is empty a GUI error message is shown telling the * user to set the servername and this function returns false. * * @param server_name The server name to validate. It will be trimmed of leading * and trailing sp
| 857 | * @return True iff the server name is valid. |
| 858 | */ |
| 859 | bool NetworkValidateServerName(std::string &server_name) |
| 860 | { |
| 861 | StrTrimInPlace(server_name); |
| 862 | if (!server_name.empty()) return true; |
| 863 | |
| 864 | ShowErrorMessage(GetEncodedString(STR_NETWORK_ERROR_BAD_SERVER_NAME), {}, WL_ERROR); |
| 865 | return false; |
| 866 | } |
| 867 | |
| 868 | /** |
| 869 | * Check whether the client and server name are set, for a dedicated server and if not set them to some default |
no test coverage detected