Log modcalls, add case for modcall logger writing
This commit is contained in:
		
							parent
							
								
									4d20facc33
								
							
						
					
					
						commit
						86a7d0a3aa
					
				@ -82,6 +82,11 @@ public slots:
 | 
				
			|||||||
    void logBan(const QString& f_moderator, const QString& f_targetIPID, const QString& f_targetName, const QString f_targetOOCName,
 | 
					    void logBan(const QString& f_moderator, const QString& f_targetIPID, const QString& f_targetName, const QString f_targetOOCName,
 | 
				
			||||||
                const QString &f_duration);
 | 
					                const QString &f_duration);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * @brief Adds a modcall event to the area buffer, also triggers modcall writing.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    void logModcall(const QString& f_charName, const QString &f_ipid, const QString& f_oocName, const QString& f_areaName);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * @brief Logs any connection attempt to the server, wether sucessful or not.
 | 
					     * @brief Logs any connection attempt to the server, wether sucessful or not.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
 | 
				
			|||||||
@ -24,10 +24,13 @@ ULogger::ULogger(QObject* parent) :
 | 
				
			|||||||
    switch (ConfigManager::loggingType()) {
 | 
					    switch (ConfigManager::loggingType()) {
 | 
				
			||||||
        case DataTypes::LogType::MODCALL :
 | 
					        case DataTypes::LogType::MODCALL :
 | 
				
			||||||
            writerModcall = new WriterModcall;
 | 
					            writerModcall = new WriterModcall;
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
        case DataTypes::LogType::FULL :
 | 
					        case DataTypes::LogType::FULL :
 | 
				
			||||||
            writerFull = new WriterFull;
 | 
					            writerFull = new WriterFull;
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
        case DataTypes::LogType::SQL :
 | 
					        case DataTypes::LogType::SQL :
 | 
				
			||||||
            writerSQL = new WriterSQL;
 | 
					            writerSQL = new WriterSQL;
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -99,7 +102,18 @@ void ULogger::logBan(const QString &f_moderator, const QString &f_targetIPID, co
 | 
				
			|||||||
    QString l_logEntry = QStringLiteral("[%1][BAN][%2][%3(%4)][%5][%6]")
 | 
					    QString l_logEntry = QStringLiteral("[%1][BAN][%2][%3(%4)][%5][%6]")
 | 
				
			||||||
            .arg(l_time, f_moderator, f_targetName, f_targetOOCName, f_targetIPID, f_duration);
 | 
					            .arg(l_time, f_moderator, f_targetName, f_targetOOCName, f_targetIPID, f_duration);
 | 
				
			||||||
    updateAreaBuffer("SERVER",l_logEntry);
 | 
					    updateAreaBuffer("SERVER",l_logEntry);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void ULogger::logModcall(const QString &f_charName, const QString &f_ipid, const QString &f_oocName, const QString &f_areaName)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    QString l_time = QDateTime::currentDateTime().toString("ddd MMMM d yyyy | hh:mm:ss");
 | 
				
			||||||
 | 
					    QString l_logEvent = QStringLiteral("[%1][%2][MODCALL][%5][%3(%4)]")
 | 
				
			||||||
 | 
					            .arg(l_time, f_areaName, f_charName, f_oocName, f_ipid);
 | 
				
			||||||
 | 
					    updateAreaBuffer(f_areaName, l_logEvent);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (ConfigManager::loggingType() == DataTypes::LogType::MODCALL) {
 | 
				
			||||||
 | 
					        writerModcall->flush(f_areaName, buffer(f_areaName));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ULogger::logConnectionAttempt(const QString& f_ip_address, const QString& f_ipid, const QString& f_hdid)
 | 
					void ULogger::logConnectionAttempt(const QString& f_ip_address, const QString& f_ipid, const QString& f_hdid)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user