Disallow player name changes when the player is muted

This commit is contained in:
heinrich5991 2020-10-14 01:19:41 +02:00
parent 0689466002
commit 5b4c64005f

View file

@ -2175,6 +2175,12 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
str_copy(aOldName, Server()->ClientName(ClientID), sizeof(aOldName)); str_copy(aOldName, Server()->ClientName(ClientID), sizeof(aOldName));
Server()->SetClientName(ClientID, pMsg->m_pName); Server()->SetClientName(ClientID, pMsg->m_pName);
if(str_comp(aOldName, Server()->ClientName(ClientID)) != 0) if(str_comp(aOldName, Server()->ClientName(ClientID)) != 0)
{
if(ProcessSpamProtection(ClientID))
{
Server()->SetClientName(ClientID, aOldName);
}
else
{ {
char aChatText[256]; char aChatText[256];
str_format(aChatText, sizeof(aChatText), "'%s' changed name to '%s'", aOldName, Server()->ClientName(ClientID)); str_format(aChatText, sizeof(aChatText), "'%s' changed name to '%s'", aOldName, Server()->ClientName(ClientID));
@ -2187,6 +2193,7 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
SixupNeedsUpdate = true; SixupNeedsUpdate = true;
} }
}
if(str_comp(Server()->ClientClan(ClientID), pMsg->m_pClan)) if(str_comp(Server()->ClientClan(ClientID), pMsg->m_pClan))
SixupNeedsUpdate = true; SixupNeedsUpdate = true;