fix(Log): Chat/Spam logs using the old IP address (#1363)
IP addresses are not being logged properly via the chat/spam logger.
This commit is contained in:
parent
fa53e65995
commit
0c0c1cc2ed
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user