Permalink
Browse files

Print name on name change

  • Loading branch information...
def- committed Aug 28, 2015
1 parent ed49e32 commit f20a6a49343d3fa3f2b2d58bc11dfae13d646a4f
Showing with 5 additions and 5 deletions.
  1. +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;

0 comments on commit f20a6a4

Please sign in to comment.