Skip to content

Commit f20a6a4

Browse files
committed
Print name on name change
1 parent ed49e32 commit f20a6a4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/engine/server/server.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,6 @@ int CServer::TrySetClientName(int ClientID, const char *pName)
332332
if(!aTrimmedName[0])
333333
return -1;
334334

335-
char aBuf[256];
336-
str_format(aBuf, sizeof(aBuf), "'%s' -> '%s'", pName, aTrimmedName);
337-
Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "server", aBuf);
338-
pName = aTrimmedName;
339-
340335
// make sure that two clients doesn't have the same name
341336
for(int i = 0; i < MAX_CLIENTS; i++)
342337
if(i != ClientID && m_aClients[i].m_State >= CClient::STATE_READY)
@@ -345,6 +340,11 @@ int CServer::TrySetClientName(int ClientID, const char *pName)
345340
return -1;
346341
}
347342

343+
char aBuf[256];
344+
str_format(aBuf, sizeof(aBuf), "'%s' -> '%s'", pName, aTrimmedName);
345+
Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "server", aBuf);
346+
pName = aTrimmedName;
347+
348348
// set the client name
349349
str_copy(m_aClients[ClientID].m_aName, pName, MAX_NAME_LENGTH);
350350
return 0;

0 commit comments

Comments
 (0)