From 4147bc583a6f60aaa23edd35fb13b9ba9fa3886c Mon Sep 17 00:00:00 2001 From: tyackman <38179522+tyackman@users.noreply.github.com> Date: Fri, 19 May 2023 03:29:10 -0500 Subject: [PATCH] fix(Log): Chat/Spam logs using the old IP address (#1363) IP addresses are not being logged properly via the chat/spam logger. --- src/util/spam.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/spam.hpp b/src/util/spam.hpp index 87f91dd8..9ad1149f 100644 --- a/src/util/spam.hpp +++ b/src/util/spam.hpp @@ -64,17 +64,17 @@ namespace big::spam return false; } - + inline void log_chat(char* msg, player_ptr player, bool is_spam) { std::ofstream spam_log(g_file_manager->get_project_file(is_spam ? "./spam.log" : "./chat.log").get_path(), std::ios::app); auto& plData = *player->get_net_data(); + auto ip = player->get_ip_address(); - spam_log << player->get_name() << " (" << plData.m_gamer_handle.m_rockstar_id << ") <" - << (int)plData.m_external_ip.m_field1 << "." << (int)plData.m_external_ip.m_field2 << "." - << (int)plData.m_external_ip.m_field3 << "." << (int)plData.m_external_ip.m_field4 << ">: " << msg << std::endl; + spam_log << player->get_name() << " (" << plData.m_gamer_handle.m_rockstar_id << ") <" << (int)ip.m_field1 << "." + << (int)ip.m_field2 << "." << (int)ip.m_field3 << "." << (int)ip.m_field4 << ">: " << msg << std::endl; spam_log.close(); } -} \ No newline at end of file +}