elegant crash complete protection (#3109)

This commit is contained in:
lonelybud 2024-05-15 21:08:48 +05:30 committed by GitHub
parent 7195f5f069
commit cc91ad4ea4
3 changed files with 19 additions and 1 deletions

View File

@ -186,6 +186,7 @@ namespace big
TSECommand = 800157557, // CnCTG_IN_BF
TSECommandRotateCam = 225624744, // != 29) && f
TSECommandSound = 385726943,
Notification = -642704387,
NotificationMoneyBanked = 94410750, // TICK_TC_BANK

View File

@ -215,12 +215,28 @@ namespace big
}
break;
case eRemoteEvent::TSECommand:
if (g.protections.script_events.rotate_cam && static_cast<eRemoteEvent>(args[3]) == eRemoteEvent::TSECommandRotateCam && !NETWORK::NETWORK_IS_ACTIVITY_SESSION())
{
if (NETWORK::NETWORK_IS_ACTIVITY_SESSION())
break;
if (g.protections.script_events.rotate_cam && static_cast<eRemoteEvent>(args[3]) == eRemoteEvent::TSECommandRotateCam)
{
g.reactions.rotate_cam.process(plyr);
return true;
}
if (g.protections.script_events.sound_spam && static_cast<eRemoteEvent>(args[3]) == eRemoteEvent::TSECommandSound)
{
if (!plyr || plyr->m_play_sound_rate_limit_tse.process())
{
if (plyr->m_play_sound_rate_limit_tse.exceeded_last_process())
g.reactions.sound_spam.process(plyr);
return true;
}
}
break;
}
case eRemoteEvent::SendToCayoPerico:
if (g.protections.script_events.send_to_location && args[4] == 0)
{

View File

@ -67,6 +67,7 @@ namespace big
rate_limiter m_host_migration_rate_limit{2s, 15};
rate_limiter m_play_sound_rate_limit{1s, 10};
rate_limiter m_play_sound_rate_limit_tse{5s, 2};
rate_limiter m_invites_rate_limit{10s, 2};
rate_limiter m_radio_request_rate_limit{5s, 2};