elegant crash complete protection (#3109)

This commit is contained in:
lonelybud 2024-05-15 21:08:48 +05:30 committed by GitHub
parent 44269fcf35
commit b693509609
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 21 additions and 1 deletions

View File

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

View File

@ -214,6 +214,7 @@ namespace big
if (data.m_hash == model) if (data.m_hash == model)
{ {
model_str = name.data(); model_str = name.data();
break;
} }
} }
} }
@ -224,6 +225,7 @@ namespace big
if (data.m_hash == model) if (data.m_hash == model)
{ {
model_str = name.data(); model_str = name.data();
break;
} }
} }
} }

View File

@ -215,12 +215,28 @@ namespace big
} }
break; break;
case eRemoteEvent::TSECommand: 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); g.reactions.rotate_cam.process(plyr);
return true; 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; break;
}
case eRemoteEvent::SendToCayoPerico: case eRemoteEvent::SendToCayoPerico:
if (g.protections.script_events.send_to_location && args[4] == 0) 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_host_migration_rate_limit{2s, 15};
rate_limiter m_play_sound_rate_limit{1s, 10}; 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_invites_rate_limit{10s, 2};
rate_limiter m_radio_request_rate_limit{5s, 2}; rate_limiter m_radio_request_rate_limit{5s, 2};