mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
Merge #3693
3693: Rank not sending r=def- a=houseme-kyle - Fixes the message for loop not sending all messages - Still calls SpamProtection method for each message to count towards users spam chat score *** If the above isn't relevant, then the spam check can move outside the for loop - Tested with normal and a muted user ![image](https://user-images.githubusercontent.com/25198124/110751526-a3132b80-824c-11eb-9a9a-6ac507bb87b4.png) ![image](https://user-images.githubusercontent.com/25198124/110751829-14eb7500-824d-11eb-9f23-3aca11af428b.png) ## Checklist - [x] Tested the change ingame - [x] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: houseme-kyle <kyle@houseme.co.za> Co-authored-by: Kyle Bradley <kyle@house.me>
This commit is contained in:
commit
9b17e52d5b
|
@ -933,13 +933,21 @@ void CPlayer::ProcessScoreResult(CScorePlayerResult &Result)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CScorePlayerResult::ALL:
|
case CScorePlayerResult::ALL:
|
||||||
|
{
|
||||||
|
bool PrimaryMessage = true;
|
||||||
for(auto &aMessage : Result.m_Data.m_aaMessages)
|
for(auto &aMessage : Result.m_Data.m_aaMessages)
|
||||||
{
|
{
|
||||||
if(aMessage[0] == 0)
|
if(aMessage[0] == 0)
|
||||||
break;
|
break;
|
||||||
GameServer()->SendChat(-1, CGameContext::CHAT_ALL, aMessage, m_ClientID);
|
|
||||||
|
if(GameServer()->ProcessSpamProtection(m_ClientID) && PrimaryMessage)
|
||||||
|
break;
|
||||||
|
|
||||||
|
GameServer()->SendChat(-1, CGameContext::CHAT_ALL, aMessage, -1);
|
||||||
|
PrimaryMessage = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case CScorePlayerResult::BROADCAST:
|
case CScorePlayerResult::BROADCAST:
|
||||||
if(Result.m_Data.m_Broadcast[0] != 0)
|
if(Result.m_Data.m_Broadcast[0] != 0)
|
||||||
GameServer()->SendBroadcast(Result.m_Data.m_Broadcast, -1);
|
GameServer()->SendBroadcast(Result.m_Data.m_Broadcast, -1);
|
||||||
|
|
Loading…
Reference in a new issue