diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-10 20:44:10 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-10 20:44:10 +0000 |
commit | bd04c907de380951fee0588dc7c7482a2d2e19aa (patch) | |
tree | 3ca420c27cf43f2e0f03f346791bf70b7f4b9ff4 /src/login_sql/login.c | |
parent | 35c12d9230436bdc9eb2b7312634c0b808e333e6 (diff) | |
download | hercules-bd04c907de380951fee0588dc7c7482a2d2e19aa.tar.gz hercules-bd04c907de380951fee0588dc7c7482a2d2e19aa.tar.bz2 hercules-bd04c907de380951fee0588dc7c7482a2d2e19aa.tar.xz hercules-bd04c907de380951fee0588dc7c7482a2d2e19aa.zip |
- 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
Diffstat (limited to 'src/login_sql/login.c')
-rw-r--r-- | src/login_sql/login.c | 18 |
1 files changed, 12 insertions, 6 deletions
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));
|