2437: Spam protection on /rank r=Zwelf a=Learath2

Honestly, this isn't really the best fix, it'd probably be best to rate limit the query itself more harshly but this is how it behaved in the past before @Zwelf's rework.

Co-authored-by: Learath <learath2@gmail.com>
This commit is contained in:
bors[bot] 2020-07-01 21:28:36 +00:00 committed by GitHub
commit d551b2f069
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -411,8 +411,8 @@ void CPlayer::Snap(int SnappingClient)
{
CPlayer *pSnapPlayer = GameServer()->m_apPlayers[SnappingClient];
ShowSpec = ShowSpec && (
GameServer()->GetDDRaceTeam(id) == GameServer()->GetDDRaceTeam(SnappingClient)
|| pSnapPlayer->m_ShowOthers
GameServer()->GetDDRaceTeam(id) == GameServer()->GetDDRaceTeam(SnappingClient)
|| pSnapPlayer->m_ShowOthers
|| (pSnapPlayer->GetTeam() == TEAM_SPECTATORS || pSnapPlayer->IsPaused())
);
}
@ -933,7 +933,7 @@ void CPlayer::ProcessScoreResult(CScorePlayerResult &Result)
{
if(Result.m_Data.m_aaMessages[i][0] == 0)
break;
GameServer()->SendChat(-1, CGameContext::CHAT_ALL, Result.m_Data.m_aaMessages[i]);
GameServer()->SendChat(-1, CGameContext::CHAT_ALL, Result.m_Data.m_aaMessages[i], m_ClientID);
}
break;
case CScorePlayerResult::BROADCAST: