(svn r20934) -Codechange: move NetworkGetClientName to the server's socket

This commit is contained in:
rubidium
2010-10-15 19:35:08 +00:00
parent f555e6d72e
commit bda26d03b5
4 changed files with 24 additions and 20 deletions

View File

@@ -137,19 +137,6 @@ NetworkClientSocket *NetworkFindClientStateFromClientID(ClientID client_id)
return NULL;
}
/* NetworkGetClientName is a server-safe function to get the name of the client
* if the user did not send it yet, Client #<no> is used. */
void NetworkGetClientName(char *client_name, size_t size, const NetworkClientSocket *cs)
{
const NetworkClientInfo *ci = cs->GetInfo();
if (StrEmpty(ci->client_name)) {
snprintf(client_name, size, "Client #%4d", cs->client_id);
} else {
ttd_strlcpy(client_name, ci->client_name, size);
}
}
byte NetworkSpectatorCount()
{
const NetworkClientInfo *ci;