mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Don't print name change message when trying to change to banned name
Introduced in https://github.com/ddnet/ddnet/pull/3095/files?w=1
This commit is contained in:
parent
5fa2e04c97
commit
7260dec878
|
@ -370,26 +370,23 @@ bool CServer::SetClientNameImpl(int ClientID, const char *pNameRequest, bool Set
|
|||
if(m_aClients[ClientID].m_State < CClient::STATE_READY)
|
||||
return false;
|
||||
|
||||
if(Set)
|
||||
CNameBan *pBanned = IsNameBanned(pNameRequest, m_aNameBans.base_ptr(), m_aNameBans.size());
|
||||
if(pBanned)
|
||||
{
|
||||
CNameBan *pBanned = IsNameBanned(pNameRequest, m_aNameBans.base_ptr(), m_aNameBans.size());
|
||||
if(pBanned)
|
||||
if(m_aClients[ClientID].m_State == CClient::STATE_READY && Set)
|
||||
{
|
||||
if(m_aClients[ClientID].m_State == CClient::STATE_READY)
|
||||
char aBuf[256];
|
||||
if(pBanned->m_aReason[0])
|
||||
{
|
||||
char aBuf[256];
|
||||
if(pBanned->m_aReason[0])
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "Kicked (your name is banned: %s)", pBanned->m_aReason);
|
||||
}
|
||||
else
|
||||
{
|
||||
str_copy(aBuf, "Kicked (your name is banned)", sizeof(aBuf));
|
||||
}
|
||||
Kick(ClientID, aBuf);
|
||||
str_format(aBuf, sizeof(aBuf), "Kicked (your name is banned: %s)", pBanned->m_aReason);
|
||||
}
|
||||
return true;
|
||||
else
|
||||
{
|
||||
str_copy(aBuf, "Kicked (your name is banned)", sizeof(aBuf));
|
||||
}
|
||||
Kick(ClientID, aBuf);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// trim the name
|
||||
|
|
Loading…
Reference in a new issue