Codechange: [Network] Introduce function to validate the client name

This commit is contained in:
rubidium42
2021-04-22 07:01:46 +02:00
committed by rubidium42
parent dc0efd5f2e
commit b14f412117
4 changed files with 17 additions and 3 deletions

View File

@@ -946,7 +946,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_JOIN(Packet *p)
}
/* We need a valid name.. make it Player */
if (StrEmpty(name)) strecpy(name, "Player", lastof(name));
if (!NetworkIsValidClientName(name)) strecpy(name, "Player", lastof(name));
if (!NetworkFindName(name, lastof(name))) { // Change name if duplicate
/* We could not create a name for this client */