Jump to content
×
×
  • Create New...
  • 0

Help Whispers


MORTE

Question

 
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 

Link to comment
  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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.