· 8 years ago · Aug 11, 2018, 03:16 PM
1Open log.cpp and add:
2
3void LogManager::WhisperLog(const char * from, const char * to, const char * message)
4{
5 m_sql.EscapeString(__escape_hint, sizeof(__escape_hint), message, strlen(message));
6 Query("INSERT INTO whisper_log (from_msg, to_msg, msg_text) VALUES ('%s', '%s', '%s')", from, to, __escape_hint);
7}
8
9Open log.h and add:
10
11void WhisperLog(const char * from, const char * to, const char * message);
12
13Open input_main.cpp and search:
14
15sys_log(0, "WHISPER: %s -> %s : %s", ch->GetName(), pinfo->szNameTo, buf);
16
17Add after:
18
19LogManager::instance().WhisperLog(ch->GetName(), pinfo->szNameTo, buf);
20
21
22After this create a new table in log with this structure:
23
24DROP TABLE IF EXISTS `whisper_log`;
25CREATE TABLE `whisper_log` (
26 `id` int(20) NOT NULL AUTO_INCREMENT,
27 `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
28 `from_msg` varchar(24) NOT NULL DEFAULT 'error',
29 `to_msg` varchar(24) NOT NULL DEFAULT 'error',
30 `msg_text` varchar(250) NOT NULL DEFAULT 'empty_msg_error',
31 PRIMARY KEY (`id`)
32) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;