From bd04c907de380951fee0588dc7c7482a2d2e19aa Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 10 Jul 2006 20:44:10 +0000 Subject: - Login-sql server will no longer change an account's state to "7" when banning a player. This should fix being able to use @ban to clear out a @blocked player. Players will now be identified as banned only through the banned-until timestamp. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7604 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 4 ++++ src/login_sql/login.c | 18 ++++++++++++------ src/map/chrif.c | 4 ++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 39f2bbadc..3d6e74c75 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2006/07/10 + * Login-sql server will no longer change an account's state to "7" when + banning a player. This should fix being able to use @ban to clear out a + @blocked player. Players will now be identified as banned only through the + banned-until timestamp. [Skotlex] * Fixed a crash when using Gospel... [Skotlex] * The on-place function won't be invoked on setting ground skills if the group's tick is greater than the current tick. As Buuyo pointed out, this diff --git a/src/login_sql/login.c b/src/login_sql/login.c index 8e508bb4b..fe1583429 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -787,12 +787,18 @@ int mmo_auth( struct mmo_account* account , int fd){ //login {0-account_id/1-userid/2-user_pass/3-lastlogin/4-logincount/5-sex/6-connect_untl/7-last_ip/8-ban_until/9-state} if (ban_until_time != 0) { // if account is banned - strftime(tmpstr, 20, date_format, localtime(&ban_until_time)); - tmpstr[19] = '\0'; - if (ban_until_time > time(NULL)) { // always banned + if (ban_until_time > time(NULL)) // always banned return 6; // 6 = Your are Prohibited to log in until %s - } else { // ban is finished + + sprintf(tmpsql, "UPDATE `%s` SET `ban_until`='0' WHERE %s `%s`='%s'", login_db, case_sensitive ? "BINARY" : "", login_db_userid, 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); + } + + // ban is finished // reset the ban time +/* //Removed "state" of bans, it behaves now like their TXT counter-part. [Skotlex] if (atoi(sql_row[9])==7) {//it was a temp ban - so we set STATE to 0 sprintf(tmpsql, "UPDATE `%s` SET `ban_until`='0', `state`='0' WHERE %s `%s`='%s'", login_db, case_sensitive ? "BINARY" : "", login_db_userid, t_uid); strcpy(sql_row[9],"0"); //we clear STATE @@ -803,7 +809,7 @@ int mmo_auth( struct mmo_account* account , int fd){ ShowSQL("DB error - %s\n",mysql_error(&mysql_handle)); ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql); } - } +*/ } if (atoi(sql_row[9])) { @@ -1198,7 +1204,7 @@ int parse_fromchar(int fd){ charif_sendallwos(-1, buf, 11); } ShowNotice("Account: %d Banned until: %ld\n", acc, timestamp); - sprintf(tmpsql, "UPDATE `%s` SET `ban_until` = '%ld', `state`='7' WHERE `%s` = '%d'", login_db, (unsigned long)timestamp, login_db_account_id, acc); + sprintf(tmpsql, "UPDATE `%s` SET `ban_until` = '%ld' WHERE `%s` = '%d'", login_db, (unsigned long)timestamp, login_db_account_id, acc); // query if (mysql_query(&mysql_handle, tmpsql)) { ShowSQL("DB error - %s\n",mysql_error(&mysql_handle)); diff --git a/src/map/chrif.c b/src/map/chrif.c index 3cbce9849..3f3ecb10f 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -684,7 +684,7 @@ int chrif_char_ask_name(int id, char * character_name, short operation_type, int WFIFOW(char_fd, 40) = minute; WFIFOW(char_fd, 42) = second; } - ShowInfo("chrif : sended 0x2b0e\n"); +// ShowInfo("chrif : sent 0x2b0e\n"); WFIFOSET(char_fd,44); return 0; @@ -702,7 +702,7 @@ int chrif_changesex(int id, int sex) { WFIFOW(char_fd,2) = 9; WFIFOL(char_fd,4) = id; WFIFOB(char_fd,8) = sex; - ShowInfo("chrif : sent 0x3000(changesex)\n"); +// ShowInfo("chrif : sent 0x3000(changesex)\n"); WFIFOSET(char_fd,9); return 0; } -- cgit v1.2.3-60-g2f50