Merge pull request #172 from Salanto/log_shownames

Add showname to IC logs
This commit is contained in:
scatterflower 2021-08-02 16:52:51 -05:00 committed by GitHub
commit 97e0d633d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -52,7 +52,7 @@ public slots:
* @param f_ipid_r The IPID of the aforementioned client.
* @param f_message_r The text of the IC message.
*/
void logIC(const QString& f_charName_r, const QString& f_ipid_r, const QString& f_message_r);
void logIC(const QString& f_charName_r, const QString& f_ipid_r, const QString& f_message_r, const QString& f_showname);
/**
* @brief Logs an OOC message.

View File

@ -282,7 +282,7 @@ void AreaData::log(const QString &f_clientName_r, const QString &f_clientIpid_r,
auto l_header = f_packet_r.header;
if (l_header == "MS") {
m_logger->logIC(f_clientName_r, f_clientIpid_r, f_packet_r.contents.at(4));
m_logger->logIC(f_clientName_r, f_clientIpid_r, f_packet_r.contents.at(4), f_packet_r.contents.at(15));
} else if (l_header == "CT") {
m_logger->logOOC(f_clientName_r, f_clientIpid_r, f_packet_r.contents.at(1));
} else if (l_header == "ZZ") {

View File

@ -20,9 +20,9 @@
#include "include/logger.h"
void Logger::logIC(const QString& f_charName_r, const QString& f_ipid_r, const QString& f_message_r)
void Logger::logIC(const QString& f_charName_r, const QString& f_ipid_r, const QString& f_message_r, const QString& f_showname_r)
{
addEntry(f_charName_r, f_ipid_r, "IC", f_message_r);
addEntry((f_charName_r + " (" + f_showname_r + ") "), f_ipid_r, "IC", f_message_r);
}
void Logger::logOOC(const QString& f_charName_r, const QString& f_ipid_r, const QString& f_message_r)