summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/login_sql/login.c76
2 files changed, 40 insertions, 38 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index c4d3998a1..949a38b80 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,6 +3,8 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+2006/11/11
+ * Fixed debug message in login_sql [KarLaeda]
2006/11/10
* Deluge/Violent Gale/Volcano tiles will now fail to be placed on cells
that are already ocuppied by anything else. [Skotlex]
diff --git a/src/login_sql/login.c b/src/login_sql/login.c
index 903b38b35..8133849d7 100644
--- a/src/login_sql/login.c
+++ b/src/login_sql/login.c
@@ -287,7 +287,7 @@ int isGM(int account_id) {
sprintf(tmpsql,"SELECT `%s` FROM `%s` WHERE `%s`='%d'", login_db_level, login_db, login_db_account_id, account_id);
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
sql_res = mysql_store_result(&mysql_handle);
if (sql_res) {
@@ -395,7 +395,7 @@ int mmo_auth_sqldb_init(void) {
//query
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
}
@@ -429,7 +429,7 @@ void mmo_db_close(void) {
//query
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
}
/*
@@ -438,7 +438,7 @@ void mmo_db_close(void) {
//query
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
mysql_close(&mysql_handle);
ShowStatus("close DB connect....\n");
@@ -451,7 +451,7 @@ void mmo_db_close(void) {
if (mysql_query(&mysql_handle, tmpsql))
{
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
delete_session(fd);
}
@@ -651,7 +651,7 @@ int mmo_auth( struct mmo_account* account , int fd){
// query
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
sql_res = mysql_store_result(&mysql_handle) ;
if (sql_res) {
@@ -798,7 +798,7 @@ int mmo_auth( struct mmo_account* account , int fd){
sprintf(tmpsql, "UPDATE `%s` SET `ban_until`='0' WHERE `%s`= %s '%s'", login_db, login_db_userid, case_sensitive ? "BINARY" : "", t_uid);
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
}
@@ -870,7 +870,7 @@ int mmo_auth( struct mmo_account* account , int fd){
mysql_free_result(sql_res) ; //resource free
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
return -1;
@@ -918,7 +918,7 @@ int parse_fromchar(int fd){
// query
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
}
do_close(fd);
@@ -935,7 +935,7 @@ int parse_fromchar(int fd){
sprintf(tmpsql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`log`) VALUES (NOW(), '%u', '%s', 'GM reload request')", loginlog_db, (unsigned int)ntohl(ipl),server[id].name);
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
}
read_gm_account();
@@ -975,7 +975,7 @@ int parse_fromchar(int fd){
sprintf(tmpsql, "SELECT `email`,`connect_until` FROM `%s` WHERE `%s`='%d'", login_db, login_db_account_id, account_id);
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
sql_res = mysql_store_result(&mysql_handle) ;
if (sql_res) {
@@ -1013,7 +1013,7 @@ int parse_fromchar(int fd){
// query
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
}
@@ -1036,7 +1036,7 @@ int parse_fromchar(int fd){
sprintf(tmpsql,"SELECT `email`,`connect_until` FROM `%s` WHERE `%s`='%d'",login_db, login_db_account_id, account_id);
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
sql_res = mysql_store_result(&mysql_handle) ;
if (sql_res) {
@@ -1095,7 +1095,7 @@ int parse_fromchar(int fd){
if (mysql_query(&mysql_handle, tmpsql))
{
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
sql_res = mysql_store_result(&mysql_handle);
if (sql_res) {
@@ -1106,7 +1106,7 @@ int parse_fromchar(int fd){
// query
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
ShowInfo("Char-server '%s': Modify an e-mail on an account (@email GM command) (account: %d (%s), new e-mail: %s, ip: %s)." RETCODE,
server[id].name, acc, sql_row[0], actual_email, ip);
@@ -1128,7 +1128,7 @@ int parse_fromchar(int fd){
sprintf(tmpsql, "SELECT `state` FROM `%s` WHERE `%s` = '%d'", login_db, login_db_account_id, acc);
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
sql_res = mysql_store_result(&mysql_handle);
if (sql_res) {
@@ -1146,7 +1146,7 @@ int parse_fromchar(int fd){
//query
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
RFIFOSKIP(fd,10);
break;
@@ -1163,7 +1163,7 @@ int parse_fromchar(int fd){
sprintf(tmpsql, "SELECT `ban_until` FROM `%s` WHERE `%s` = '%d'",login_db,login_db_account_id,acc);
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
sql_res = mysql_store_result(&mysql_handle);
if (sql_res) {
@@ -1199,7 +1199,7 @@ int parse_fromchar(int fd){
// query
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
}
}
@@ -1218,7 +1218,7 @@ int parse_fromchar(int fd){
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
return 0;
}
@@ -1240,7 +1240,7 @@ int parse_fromchar(int fd){
//query
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
WBUFW(buf,0) = 0x2723;
WBUFL(buf,2) = acc;
@@ -1266,7 +1266,7 @@ int parse_fromchar(int fd){
sprintf(tmpsql,"DELETE FROM `%s` WHERE `type`='1' AND `account_id`='%d';",reg_db,acc);
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
//Proceed to insert them....
for(j=0,p=13;j<ACCOUNT_REG2_NUM && p<RFIFOW(fd,2);j++){
@@ -1280,7 +1280,7 @@ int parse_fromchar(int fd){
sprintf(tmpsql,"INSERT INTO `%s` (`type`, `account_id`, `str`, `value`) VALUES ( 1 , '%d' , '%s' , '%s');", reg_db, acc, jstrescapecpy(temp_str,str), jstrescapecpy(temp_str2,value));
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
}
@@ -1303,7 +1303,7 @@ int parse_fromchar(int fd){
sprintf(tmpsql,"SELECT `ban_until` FROM `%s` WHERE `%s` = '%d'",login_db,login_db_account_id,acc);
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
sql_res = mysql_store_result(&mysql_handle) ;
if (sql_res && mysql_num_rows(sql_res) > 0) { //Found a match
@@ -1311,7 +1311,7 @@ int parse_fromchar(int fd){
//query
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
}
if (sql_res) mysql_free_result(sql_res);
@@ -1363,7 +1363,7 @@ int parse_fromchar(int fd){
sprintf(tmpsql, "SELECT `str`,`value` FROM `%s` WHERE `type`='1' AND `account_id`='%d'",reg_db, account_id);
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
break;
}
sql_res = mysql_store_result(&mysql_handle) ;
@@ -1452,7 +1452,7 @@ int login_ip_ban_check(unsigned char *p, unsigned long ipl)
p[0], p[0], p[1], p[0], p[1], p[2], p[0], p[1], p[2], p[3]);
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
// close connection because we can't verify their connectivity.
return 1;
}
@@ -1475,7 +1475,7 @@ int login_ip_ban_check(unsigned char *p, unsigned long ipl)
// query
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
}
mysql_free_result(sql_res);
@@ -1589,7 +1589,7 @@ int parse_login(int fd) {
//query
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
}
if (account.level)
@@ -1749,7 +1749,7 @@ int parse_login(int fd) {
//query
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
} //End login log of error.
if ((result == 1) && (dynamic_pass_failure_ban != 0) && log_login){ // failed password
@@ -1757,7 +1757,7 @@ int parse_login(int fd) {
loginlog_db,(unsigned int)ntohl(ipl), dynamic_pass_failure_ban_time); //how many times filed account? in one ip.
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
//check query result
sql_res = mysql_store_result(&mysql_handle) ;
@@ -1767,7 +1767,7 @@ int parse_login(int fd) {
sprintf(tmpsql,"INSERT INTO `ipbanlist`(`list`,`btime`,`rtime`,`reason`) VALUES ('%d.%d.%d.*', NOW() , NOW() + INTERVAL %d MINUTE ,'Password error ban: %s')", p[0], p[1], p[2], dynamic_pass_failure_ban_how_long, t_uid);
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
}
if(sql_res) mysql_free_result(sql_res);
@@ -1776,7 +1776,7 @@ int parse_login(int fd) {
sprintf(tmpsql,"INSERT INTO `ipbanlist`(`list`,`btime`,`rtime`,`reason`) VALUES ('%d.%d.%d.*', NOW() , NOW() + INTERVAL 1 MONTH ,'Dynamic banned user id : %s')", p[0], p[1], p[2], t_uid);
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
result = -3;
}else if(result == 6){ //not lastet version ..
@@ -1786,7 +1786,7 @@ int parse_login(int fd) {
sprintf(tmpsql,"SELECT `ban_until` FROM `%s` WHERE `%s` = %s '%s'",login_db, login_db_userid, case_sensitive ? "BINARY" : "", t_uid);
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
sql_res = mysql_store_result(&mysql_handle) ;
sql_row = sql_res?mysql_fetch_row(sql_res):NULL; //row fetching
@@ -1837,7 +1837,7 @@ int parse_login(int fd) {
//query
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
}
ShowInfo("server connection request %s @ %d.%d.%d.%d:%d (%d.%d.%d.%d)\n",
@@ -1866,7 +1866,7 @@ int parse_login(int fd) {
//query
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
jstrescapecpy(t_uid,server[account.account_id].name);
@@ -1875,7 +1875,7 @@ int parse_login(int fd) {
//query
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
WFIFOW(fd,0)=0x2711;
WFIFOB(fd,2)=0;
@@ -2041,7 +2041,7 @@ int ip_ban_check(int tid, unsigned int tick, int id, int data){
//query
if(mysql_query(&mysql_handle, "DELETE FROM `ipbanlist` WHERE `rtime` <= NOW()")) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ ShowDebug("at %s:%d - DELETE FROM `ipbanlist` WHERE `rtime` <= NOW()\n", __FILE__,__LINE__);
}
return 0;