feat(Hook): Added logging to script event handler

This commit is contained in:
Yimura 2020-12-28 01:32:22 +01:00
parent 6bd6466cbd
commit 939da8769d
No known key found for this signature in database
GPG Key ID: 54EFAD29393A6E78

View File

@ -1,9 +1,17 @@
#include "hooking.hpp"
#include "natives.hpp"
namespace big
{
bool hooks::script_event_handler(std::int64_t NetEventStruct, std::int64_t CNetGamePlayer)
{
auto args = reinterpret_cast<std::int64_t*>(NetEventStruct + 0x70);
Player SenderID = *reinterpret_cast<std::int8_t*>(CNetGamePlayer + 0x2D);
const auto ScriptEventHash = args[0];
LOG(INFO) << "Received Script Event " << ScriptEventHash << " from Player " << PLAYER::GET_PLAYER_NAME(SenderID);
return g_hooking->m_script_event_hook.get_original<decltype(&script_event_handler)>()(NetEventStruct, CNetGamePlayer);
}
}