Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Print name on name change
- Loading branch information
Showing
with
5 additions
and
5 deletions.
-
+5
−5
src/engine/server/server.cpp
|
@@ -332,11 +332,6 @@ int CServer::TrySetClientName(int ClientID, const char *pName) |
|
|
if(!aTrimmedName[0]) |
|
|
return -1; |
|
|
|
|
|
char aBuf[256]; |
|
|
str_format(aBuf, sizeof(aBuf), "'%s' -> '%s'", pName, aTrimmedName); |
|
|
Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "server", aBuf); |
|
|
pName = aTrimmedName; |
|
|
|
|
|
// make sure that two clients doesn't have the same name |
|
|
for(int i = 0; i < MAX_CLIENTS; i++) |
|
|
if(i != ClientID && m_aClients[i].m_State >= CClient::STATE_READY) |
|
@@ -345,6 +340,11 @@ int CServer::TrySetClientName(int ClientID, const char *pName) |
|
|
return -1; |
|
|
} |
|
|
|
|
|
char aBuf[256]; |
|
|
str_format(aBuf, sizeof(aBuf), "'%s' -> '%s'", pName, aTrimmedName); |
|
|
Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "server", aBuf); |
|
|
pName = aTrimmedName; |
|
|
|
|
|
// set the client name |
|
|
str_copy(m_aClients[ClientID].m_aName, pName, MAX_NAME_LENGTH); |
|
|
return 0; |
|
|