Improve protections (#428)
This commit is contained in:
parent
4336a403e4
commit
8e7677e500
@ -141,14 +141,12 @@ namespace big
|
||||
CeoKick = -1425016400, // BGDISMISSED
|
||||
CeoMoney = 547083265, // Goon_Paid_Large
|
||||
ClearWantedLevel = 1449852136,
|
||||
FakeDeposit = -1529596656, // TICK_ATTVAN
|
||||
ForceMission = -283041276, // ), Var0.f_2, 1))
|
||||
ForceMission2 = -1908874529,
|
||||
GtaBanner = 145637109, // NETWORK::NETWORK_IS_SCRIPT_ACTIVE("BUSINESS_BATTLES", -1, true, 0) second one
|
||||
NetworkBail = 1674887089, // NETWORK::NETWORK_BAIL(16, 0, 0); xref func
|
||||
PersonalVehicleDestroyed = -1838276770, // PLYVEH_INS_DES1
|
||||
RemoteOffradar = -1973627888, // NETWORK::GET_TIME_DIFFERENCE(NETWORK::GET_NETWORK_TIME(), Var0.f_2)
|
||||
RotateCam = -1388926377, // CnCTG_IN_BF
|
||||
SendToCutscene = 2131601101, // (bVar3, bVar4, 125f, 1)
|
||||
SendToCayoPerico = 1361475530, // CELL_HI_INV
|
||||
SendToLocation = 1214823473, // &Var222, 11);
|
||||
@ -156,6 +154,7 @@ namespace big
|
||||
SoundSpam = 1111927333, // CELL_APTINVYACHT
|
||||
Spectate = -2131157870, // SPEC_TCK1
|
||||
Teleport = -1390976345, // Mission_Pass_Notify
|
||||
TeleportToWarehouse = 2130458390, // CAM::FORCE_CINEMATIC_RENDERING_THIS_UPDATE(true) xref counter
|
||||
TransactionError = -768108950, // NETWORK_RECEIVE_PLAYER_JOBSHARE_CASH
|
||||
VehicleKick = -714268990, // PIM_RFMOC
|
||||
Kick = 1674887089,
|
||||
@ -163,9 +162,77 @@ namespace big
|
||||
ChangeMCRole = 656530441, // _PLAYSTATS_CHANGE_MC_ROLE
|
||||
DisableRecording = 867047895, // GET_FINAL_RENDERED_CAM_COORD
|
||||
MCTeleport = -555356783, // NETWORK::NETWORK_HASH_FROM_PLAYER_HANDLE(PLAYER::PLAYER_ID()) == (first one)
|
||||
StartActivity = 1368055548, // (Var0.f_2, -1); first match
|
||||
|
||||
Crash = -1386010354, // SET_NO_LOADING_SCREEN, xref it
|
||||
Crash = 526822748, // SET_NO_LOADING_SCREEN, xref it
|
||||
Crash2 = 1348481963,
|
||||
|
||||
TSECommand = -1388926377, // CnCTG_IN_BF
|
||||
TSECommandRotateCam = -1762807505, // != 29) && f
|
||||
|
||||
Notification = -1529596656,
|
||||
NotificationMoneyBanked = -849958015, // TICK_TC_BANK
|
||||
NotificationMoneyRemoved = -290070531, // TICK_TC_REMO
|
||||
NotificationMoneyStolen = -1640162684, // TICK_TC_STOL
|
||||
};
|
||||
|
||||
enum class eActivityType
|
||||
{
|
||||
HeistPrep = 233,
|
||||
Gunrunning = 180,
|
||||
Sightseer = 142,
|
||||
HeadHunter = 166,
|
||||
BuySpecialCargo = 167,
|
||||
SellSpecialCargo = 168,
|
||||
DefendSpecialCargo = 169,
|
||||
StealVehicle = 178,
|
||||
ExportVehicle = 188,
|
||||
Gunrunning2 = 225,
|
||||
GunrunningSell = 226,
|
||||
GunrunningDefend = 227,
|
||||
BikerSell = 190,
|
||||
BikerDefend = 191,
|
||||
BusinessResupply = 192,
|
||||
Survival = 3,
|
||||
Darts = 14,
|
||||
ArmWresling = 15,
|
||||
GangAttack = 6,
|
||||
PilotSchool = 122,
|
||||
Golf = 11,
|
||||
ShootingRange = 13,
|
||||
Tennis = 12,
|
||||
BaseJump = 8,
|
||||
Deathmatch = 1,
|
||||
ImpromptuDeathmatch = 5,
|
||||
Mission = 0,
|
||||
Race = 2,
|
||||
ExecutiveDeathmatch = 148,
|
||||
MarkedForDeath = 151,
|
||||
PiracyPrevention = 152,
|
||||
MostWanted = 153,
|
||||
AssetRecovery = 157,
|
||||
HostileTakeover = 159,
|
||||
Point2Point = 162,
|
||||
AmphibiousAssault = 216,
|
||||
Velocity = 219,
|
||||
GunsForHire = 185,
|
||||
ByThePound = 182,
|
||||
RippingItUp = 194,
|
||||
RaceToPoint = 189,
|
||||
HitAndRide = 193,
|
||||
CriminalMischief = 205,
|
||||
WeaponOfChoice = 186,
|
||||
FragileGoods = 207,
|
||||
Torched = 208,
|
||||
Outrider = 209,
|
||||
WheelieRider = 210,
|
||||
POW = 183,
|
||||
ExecutiveSearch = 199,
|
||||
StandYourGround = 201,
|
||||
AutoBuyout = 163,
|
||||
DueDiligence = 160,
|
||||
MarketManipulation = 154,
|
||||
CourierService = 155,
|
||||
};
|
||||
|
||||
enum class eSessionType
|
||||
|
@ -62,6 +62,8 @@ namespace big
|
||||
pair transaction_error{};
|
||||
pair tse_freeze{};
|
||||
pair vehicle_kick{};
|
||||
pair teleport_to_warehouse{};
|
||||
pair start_activity{};
|
||||
} script_event_handler{};
|
||||
|
||||
pair gta_thread_kill{};
|
||||
@ -116,6 +118,8 @@ namespace big
|
||||
bool spectate = true;
|
||||
bool transaction_error = true;
|
||||
bool vehicle_kick = true;
|
||||
bool teleport_to_warehouse = true;
|
||||
bool start_activity = true;
|
||||
};
|
||||
|
||||
script_events script_events{};
|
||||
@ -464,6 +468,10 @@ namespace big
|
||||
script_handler.tse_freeze.notify = script_handler_j["tse_freeze"]["notify"];
|
||||
script_handler.vehicle_kick.log = script_handler_j["vehicle_kick"]["log"];
|
||||
script_handler.vehicle_kick.notify = script_handler_j["vehicle_kick"]["notify"];
|
||||
script_handler.teleport_to_warehouse.log = script_handler_j["teleport_to_warehouse"]["log"];
|
||||
script_handler.teleport_to_warehouse.notify = script_handler_j["teleport_to_warehouse"]["notify"];
|
||||
script_handler.start_activity.log = script_handler_j["start_activity"]["log"];
|
||||
script_handler.start_activity.notify = script_handler_j["start_activity"]["notify"];
|
||||
}
|
||||
|
||||
g->notifications.send_net_info_to_lobby.log = j["notifications"]["send_net_info_to_lobby"]["log"];
|
||||
@ -497,6 +505,8 @@ namespace big
|
||||
script_handler.spectate = script_handler_j["spectate"];
|
||||
script_handler.transaction_error = script_handler_j["transaction_error"];
|
||||
script_handler.vehicle_kick = script_handler_j["vehicle_kick"];
|
||||
script_handler.teleport_to_warehouse = script_handler_j["teleport_to_warehouse"];
|
||||
script_handler.start_activity = script_handler_j["start_activity"];
|
||||
}
|
||||
|
||||
this->tunables.disable_phone = j["tunables"]["disable_phone"];
|
||||
@ -704,7 +714,9 @@ namespace big
|
||||
{ "spectate", return_notify_pair(script_handler_notifications.spectate) },
|
||||
{ "transaction_error", return_notify_pair(script_handler_notifications.transaction_error) },
|
||||
{ "tse_freeze", return_notify_pair(script_handler_notifications.tse_freeze) },
|
||||
{ "vehicle_kick", return_notify_pair(script_handler_notifications.vehicle_kick) }
|
||||
{ "vehicle_kick", return_notify_pair(script_handler_notifications.vehicle_kick) },
|
||||
{ "teleport_to_warehouse", return_notify_pair(script_handler_notifications.teleport_to_warehouse) },
|
||||
{ "start_activity", return_notify_pair(script_handler_notifications.start_activity) }
|
||||
}
|
||||
},
|
||||
{ "send_net_info_to_lobby", return_notify_pair(g->notifications.send_net_info_to_lobby) },
|
||||
@ -739,7 +751,9 @@ namespace big
|
||||
{ "sound_spam", script_handler_protections.sound_spam },
|
||||
{ "spectate", script_handler_protections.spectate },
|
||||
{ "transaction_error", script_handler_protections.transaction_error },
|
||||
{ "vehicle_kick", script_handler_protections.vehicle_kick }
|
||||
{ "vehicle_kick", script_handler_protections.vehicle_kick },
|
||||
{ "teleport_to_warehouse", script_handler_protections.teleport_to_warehouse },
|
||||
{ "start_activity", script_handler_protections.start_activity },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ namespace big
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool hooks::receive_net_message(void* netConnectionManager, void* a2, rage::netConnection::InFrame* frame)
|
||||
{
|
||||
if (frame->get_type() == 4)
|
||||
@ -45,6 +46,25 @@ namespace big
|
||||
buffer.Seek(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
case rage::eNetMessage::CMsgScriptMigrateHost:
|
||||
{
|
||||
if (std::chrono::system_clock::now() - player->m_last_transition_msg_sent < 200ms)
|
||||
{
|
||||
if (player->m_num_failed_transition_attempts++ == 20)
|
||||
{
|
||||
g_notification_service->push_error("Protections", fmt::format("{} tried to OOM kick you!", player->get_name()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
player->m_last_transition_msg_sent = std::chrono::system_clock::now();
|
||||
player->m_num_failed_transition_attempts = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,12 @@ namespace big
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case eRemoteEvent::FakeDeposit:
|
||||
case eRemoteEvent::Notification:
|
||||
switch (static_cast<eRemoteEvent>(args[2]))
|
||||
{
|
||||
case eRemoteEvent::NotificationMoneyBanked:
|
||||
case eRemoteEvent::NotificationMoneyRemoved:
|
||||
case eRemoteEvent::NotificationMoneyStolen:
|
||||
if (g->protections.script_events.fake_deposit)
|
||||
{
|
||||
format_string(player_name, "Fake Deposit", notify.fake_deposit.log, notify.fake_deposit.notify);
|
||||
@ -82,6 +87,8 @@ namespace big
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case eRemoteEvent::ForceMission:
|
||||
if (g->protections.script_events.force_mission)
|
||||
{
|
||||
@ -99,9 +106,15 @@ namespace big
|
||||
}
|
||||
break;
|
||||
case eRemoteEvent::MCTeleport:
|
||||
if (g->protections.script_events.mc_teleport)
|
||||
if (g->protections.script_events.mc_teleport && args[3] <= 32)
|
||||
{
|
||||
format_string(player_name, "MC Teleport", notify.mc_teleport.log, notify.mc_teleport.notify);
|
||||
format_string(player_name, "Remote Teleport", notify.mc_teleport.log, notify.mc_teleport.notify);
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (g->protections.script_events.crash && args[3] > 32)
|
||||
{
|
||||
format_string(player_name, "TSE Crash", notify.crash.log, notify.crash.notify);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -130,16 +143,9 @@ namespace big
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case eRemoteEvent::RotateCam:
|
||||
if (g->protections.script_events.crash && args[2] == 537560473) {
|
||||
format_string(player_name, "Crash - Rotate Cam", notify.crash.log, notify.crash.notify);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (g->protections.script_events.rotate_cam)
|
||||
case eRemoteEvent::TSECommand:
|
||||
if (g->protections.script_events.rotate_cam && static_cast<eRemoteEvent>(args[2]) == eRemoteEvent::TSECommandRotateCam)
|
||||
{
|
||||
if (CNetworkPlayerMgr* player_mgr = gta_util::get_network_player_mgr(); player_mgr != nullptr)
|
||||
if (args[2] == player_mgr->m_local_net_player->m_player_id)
|
||||
format_string(player_name, "Rotate Cam", notify.rotate_cam.log, notify.rotate_cam.notify);
|
||||
|
||||
return true;
|
||||
@ -254,6 +260,58 @@ namespace big
|
||||
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case eRemoteEvent::TeleportToWarehouse:
|
||||
if (g->protections.script_events.teleport_to_warehouse)
|
||||
{
|
||||
format_string(player_name, "Teleport To Warehouse", notify.teleport_to_warehouse.log, notify.teleport_to_warehouse.notify);
|
||||
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case eRemoteEvent::StartActivity:
|
||||
eActivityType activity = static_cast<eActivityType>(args[2]);
|
||||
if (g->protections.script_events.start_activity)
|
||||
{
|
||||
if (activity == eActivityType::Survival || activity == eActivityType::Mission || activity == eActivityType::Deathmatch || activity == eActivityType::BaseJump || activity == eActivityType::Race)
|
||||
{
|
||||
format_string(player_name, "Softlock Game", notify.start_activity.log, notify.start_activity.notify);
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (activity == eActivityType::Darts)
|
||||
{
|
||||
format_string(player_name, "Send To Darts", notify.start_activity.log, notify.start_activity.notify);
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (activity == eActivityType::PilotSchool)
|
||||
{
|
||||
format_string(player_name, "Send To Flight School", notify.start_activity.log, notify.start_activity.notify);
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (activity == eActivityType::ImpromptuDeathmatch)
|
||||
{
|
||||
format_string(player_name, "Start Impromptu Deathmatch", notify.start_activity.log, notify.start_activity.notify);
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (activity == eActivityType::DefendSpecialCargo || activity == eActivityType::GunrunningDefend || activity == eActivityType::BikerDefend)
|
||||
{
|
||||
format_string(player_name, "Trigger Business Raid", notify.start_activity.log, notify.start_activity.notify);
|
||||
|
||||
return true;
|
||||
}
|
||||
// there are MANY more
|
||||
}
|
||||
else if (g->protections.script_events.crash && activity == eActivityType::Tennis)
|
||||
{
|
||||
format_string(player_name, "TSE Crash (Start Tennis)", notify.crash.log, notify.crash.notify);
|
||||
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,6 +38,9 @@ namespace big
|
||||
|
||||
bool never_wanted = false;
|
||||
|
||||
std::chrono::system_clock::time_point m_last_transition_msg_sent{};
|
||||
int m_num_failed_transition_attempts = 0;
|
||||
|
||||
protected:
|
||||
bool equals(const CNetGamePlayer* net_game_player) const;
|
||||
|
||||
|
@ -92,6 +92,13 @@ namespace big
|
||||
draw_pair_option("Wanted Level", script_event_handler.clear_wanted_level);
|
||||
ImGui::EndGroup();
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
ImGui::BeginGroup();
|
||||
draw_pair_option("Teleport To Warehouse", script_event_handler.teleport_to_warehouse);
|
||||
draw_pair_option("Start Activity", script_event_handler.start_activity);
|
||||
ImGui::EndGroup();
|
||||
|
||||
components::sub_title("Other");
|
||||
|
||||
draw_pair_option("Reports", g->notifications.reports);
|
||||
|
@ -37,6 +37,13 @@ namespace big
|
||||
ImGui::Checkbox("Vehicle Kick", &g->protections.script_events.vehicle_kick);
|
||||
ImGui::Checkbox("Wanted Level", &g->protections.script_events.clear_wanted_level);
|
||||
ImGui::EndGroup();
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
ImGui::BeginGroup();
|
||||
ImGui::Checkbox("Teleport To Warehouse", &g->protections.script_events.teleport_to_warehouse);
|
||||
ImGui::Checkbox("Start Activity", &g->protections.script_events.start_activity);
|
||||
ImGui::EndGroup();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user