mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Mute may not affect chat commands (like /pause)
This commit is contained in:
parent
718d697707
commit
806a1babc1
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue