Ok, ce face aceast cod sursa ?

 

Salveaza toate loguile din pm in navicat in LOG.

 

Tot ce vorbesc playeri in pm , se salveaza in log navicat.

 

 

 

Deschidem log.cpp si adaugam :

 

 

 

//- Whisper Logging Function

void LogManager::WhisperLog(const char * from, const char * to, const char * message)

{

m_sql.EscapeString(__escape_hint, sizeof(__escape_hint), message, strlen(message));

Query("INSERT INTO whisper_log (from_msg, to_msg, msg_text) VALUES ('%s', '%s', '%s')", from, to, __escape_hint);

}

 

Descidem log.h si adaugam urmatoarea linie :

 

 

 

 

//Whisper Logging Function

void WhisperLog(const char * from, const char * to, const char * message);

 

Deschidem main.cpp si cautam linia asta :

 

 

 

 

 

 

if (LC_IsEurope() != true)

{

sys_log(0, "WHISPER: %s -> %s : %s", ch->GetName(), pinfo->szNameTo, buf);

}

 

Sub linia numaru 3 adagam acest cod :

 

 

 

//- Adds Whispers to Log Database

LogManager::instance().WhisperLog(ch->GetName(), pinfo->szNameTo, buf)

;

AM terminat cu partea de game 

 

Acum creeam un nou tabel in navicat la log, acesta este codul sursa la tabelul din navicat :

 

 

 

DROP TABLE IF EXISTS `whisper_log`;

CREATE TABLE `whisper_log` (

`id` int(20) NOT NULL AUTO_INCREMENT,

`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,

`from_msg` varchar(24) NOT NULL DEFAULT 'error',

`to_msg` varchar(24) NOT NULL DEFAULT 'error',

`msg_text` varchar(250) NOT NULL DEFAULT 'empty_msg_error',

PRIMARY KEY (`id`)

) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

Deci tot ce vorbesc playeri in pm, se salveza in acel log_whisper 

 

Succes !