From 2265aef916e3b2d63d87faa68a2b51e7d747c54c Mon Sep 17 00:00:00 2001 From: Seline Date: Tue, 14 Oct 2008 11:57:03 -0500 Subject: [svn] * Merge Temp dev SVN with Assembla. * Changes include: - Implementation of w12x's Outdoor PvP and Game Event Systems. - Temporary removal of IRC Chat Bot (until infinite loop when disabled is fixed). - All mangos -> trinity (to convert your mangos_string table, please run mangos_string_to_trinity_string.sql). - Improved Config cleanup. - And many more changes. --HG-- branch : trunk --- src/game/IRCLog.cpp | 60 ----------------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 src/game/IRCLog.cpp (limited to 'src/game/IRCLog.cpp') diff --git a/src/game/IRCLog.cpp b/src/game/IRCLog.cpp deleted file mode 100644 index 07bde4a6326..00000000000 --- a/src/game/IRCLog.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "IRCLog.h" -#include "Config/ConfigEnv.h" -#include "IRCClient.h" -#include - -IRCLog::IRCLog() -{ - std::string logsDir = sConfig.GetStringDefault("LogsDir",""); - std::string ircLogName = logsDir + "/IRC_"; - std::string ircLogTimestamp = GetLogDateStr(); - ircLogName += ircLogTimestamp +".log"; - ircLogfile.open (ircLogName.c_str(), std::ios::app); -} - -IRCLog::~IRCLog() -{ - ircLogfile.close(); -} -// Was added because using the time for logs is very annoying... one log per day.. much cleaner looking.. -std::string IRCLog::GetLogDateStr() const -{ - time_t t = time(NULL); - tm* aTm = localtime(&t); - // YYYY year - // MM month (2 digits 01-12) - // DD day (2 digits 01-31) - // HH hour (2 digits 00-23) - // MM minutes (2 digits 00-59) - // SS seconds (2 digits 00-59) - char buf[20]; - snprintf(buf,20,"%04d-%02d-%02d",aTm->tm_year+1900,aTm->tm_mon+1,aTm->tm_mday); - return std::string(buf); -} - -std::string IRCLog::GetLogDateTimeStr() const -{ - time_t t = time(NULL); - tm* aTm = localtime(&t); - // YYYY year - // MM month (2 digits 01-12) - // DD day (2 digits 01-31) - // HH hour (2 digits 00-23) - // MM minutes (2 digits 00-59) - // SS seconds (2 digits 00-59) - char buf[30]; - snprintf(buf,30,"[ %04d-%02d-%02d ] [ %02d:%02d:%02d ]",aTm->tm_year+1900,aTm->tm_mon+1,aTm->tm_mday,aTm->tm_hour,aTm->tm_min,aTm->tm_sec); - return std::string(buf); -} - -void IRCLog::WriteLog(const char *what, ...) -{ - va_list ap; - char tmpoutp[1024]; - va_start(ap, what); - vsnprintf(tmpoutp, 1024, what, ap ); - va_end(ap); - ircLogfile << tmpoutp; - ircLogfile << "\n"; - ircLogfile.flush(); -} -- cgit v1.2.3