Jump to content

Recommended Posts

 
ThatGuyPT, on 02 Jan 2014 - 11:17, said:

A seguir ao ShoutLog adicionamos isto: (at log.cpp)
 
 

//NEWTHATGUYPT - Whisper Logging Functionvoid 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);}
 
No log.h adicionamos o seguinte método virtual à classe:
 
//NEWTHATGUYPT - Whisper Logging Functionvoid WhisperLog(const char * from, const char * to, const char * message);
 
 
No input_main.cpp procuramos por:
 
if (LC_IsEurope() != true){sys_log(0, "WHISPER: %s -> %s : %s", ch->GetName(), pinfo->szNameTo, buf);}
 
E substituimos por:
 
//NEWTHATGUYPT - Adds Whispers to Log DatabaseLogManager::instance().WhisperLog(ch->GetName(), pinfo->szNameTo, buf);
 
 
Adicionamos esta tabela á base de dados 'log':
 
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;
 
 
Obrigado ao Zonni pela ideia, retrabalhado por mim visto a ideia dele estar mais desorganizada e vulnerável a vulnerabilidades SQL bastante conhecidas. Eg:
Mandar uma mensagem privada a alguém com mensagem: "UPDATE INTO PLAYERS WHERE NAME='MY NAME' GOLD=9999999999" para aumentar o meu yang.


E cá está o resultado:
Imagem colocada

 

 

How do you save an example file: /locale/portugal/log_Whispers.txt

 

not to overload mysql 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.