Mute may not affect chat commands (like /pause)

This commit is contained in:
Romain Labolle 2011-02-13 09:27:00 +01:00 committed by GreYFoXGTi
parent 718d697707
commit 806a1babc1

View file

@ -720,21 +720,24 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientID)
if (m_aMutes[z].m_IP[0] && str_comp(aIP, m_aMutes[z].m_IP) == 0 && (MuteTicks = m_aMutes[z].m_Expire - Server()->Tick()) <= 0)
m_aMutes[z].m_IP[0] = 0;
if (MuteTicks > 0)
if(pMsg->m_pMessage[0]!='/')
{
char aBuf[128];
str_format(aBuf, sizeof aBuf, "You are not permitted to talk for the next %d seconds.", MuteTicks / Server()->TickSpeed());
SendChatTarget(ClientID, aBuf);
return;
}
if (MuteTicks > 0)
{
char aBuf[128];
str_format(aBuf, sizeof aBuf, "You are not permitted to talk for the next %d seconds.", MuteTicks / Server()->TickSpeed());
SendChatTarget(ClientID, aBuf);
return;
}
if ((p->m_ChatScore += g_Config.m_SvChatPenalty) > g_Config.m_SvChatThreshold)
{
char aIP[16];
Server()->GetClientIP(ClientID, aIP, sizeof aIP);
Mute(aIP, g_Config.m_SvSpamMuteDuration, Server()->ClientName(ClientID));
p->m_ChatScore = 0;
return;
if ((p->m_ChatScore += g_Config.m_SvChatPenalty) > g_Config.m_SvChatThreshold)
{
char aIP[16];
Server()->GetClientIP(ClientID, aIP, sizeof aIP);
Mute(aIP, g_Config.m_SvSpamMuteDuration, Server()->ClientName(ClientID));
p->m_ChatScore = 0;
return;
}
}
// check for invalid chars
@ -1620,4 +1623,4 @@ void CGameContext::SendRecord(int ClientID) {
RecordsMsg.m_PlayerTimeBest = Score()->PlayerData(ClientID)->m_BestTime * 100.0f;//
RecordsMsg.m_ServerTimeBest = m_pController->m_CurrentRecord * 100.0f;//TODO: finish this
Server()->SendPackMsg(&RecordsMsg, MSGFLAG_VITAL, ClientID);
}
}