Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Print name on name change
  • Loading branch information
def- committed Aug 28, 2015
1 parent ed49e32 commit f20a6a4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/engine/server/server.cpp
Expand Up @@ -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)
Expand All @@ -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;
Expand Down

0 comments on commit f20a6a4

Please sign in to comment.