This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/src/hooks/protections/increment_stat_event.cpp
Yimura f6c00f113d
refactor!: globals (#717)
* refactor(globals): use macro's for to_json/from_json
* refactor(globals): switch from global pointer to global instance
2022-12-18 22:15:52 +00:00

34 lines
955 B
C++

#include "hooking.hpp"
#include "gta/net_game_event.hpp"
#include <network/CNetGamePlayer.hpp>
namespace big
{
bool hooks::increment_stat_event(CNetworkIncrementStatEvent* net_event, CNetGamePlayer* sender)
{
switch (net_event->m_stat)
{
case RAGE_JOAAT("MPPLY_BAD_CREW_STATUS"):
case RAGE_JOAAT("MPPLY_BAD_CREW_MOTTO"):
case RAGE_JOAAT("MPPLY_BAD_CREW_NAME"):
case RAGE_JOAAT("MPPLY_BAD_CREW_EMBLEM"):
case RAGE_JOAAT("MPPLY_EXPLOITS"):
case RAGE_JOAAT("MPPLY_GAME_EXPLOITS"):
case RAGE_JOAAT("MPPLY_TC_ANNOYINGME"):
case RAGE_JOAAT("MPPLY_TC_HATE"):
case RAGE_JOAAT("MPPLY_VC_ANNOYINGME"):
case RAGE_JOAAT("MPPLY_VC_HATE"):
const auto report = std::format("From: {}", sender->get_name());
if (g.notifications.reports.log)
LOG(INFO) << "Blocked report; " << report;
if (g.notifications.reports.notify)
g_notification_service->push_warning("BLOCKED REPORT", report);
return true;
}
return false;
}
}