mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +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;
|
||||
case CScorePlayerResult::ALL:
|
||||
{
|
||||
bool PrimaryMessage = true;
|
||||
for(auto &aMessage : Result.m_Data.m_aaMessages)
|
||||
{
|
||||
if(aMessage[0] == 0)
|
||||
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;
|
||||
}
|
||||
case CScorePlayerResult::BROADCAST:
|
||||
if(Result.m_Data.m_Broadcast[0] != 0)
|
||||
GameServer()->SendBroadcast(Result.m_Data.m_Broadcast, -1);
|
||||
|
|
Loading…
Reference in a new issue