* Check whether the given client name is deemed valid for use in network games. * An empty name (null or '') is not valid as that is essentially no name at all. * A name starting with white space is not valid for tab completion purposes. * @param client_name The client name to check for validity. * @return True iff the name is valid. */
| 1243 | * @return True iff the name is valid. |
| 1244 | */ |
| 1245 | bool NetworkIsValidClientName(std::string_view client_name) |
| 1246 | { |
| 1247 | if (client_name.empty()) return false; |
| 1248 | if (client_name[0] == ' ') return false; |
| 1249 | return true; |
| 1250 | } |
| 1251 | |
| 1252 | /** |
| 1253 | * Trim the given client name in place, i.e. remove leading and trailing spaces. |
no test coverage detected