diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-04-16 07:48:53 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-04-16 07:48:53 +0000 |
commit | 226d526a49322d1fa755645801254703dfd90476 (patch) | |
tree | b616c8aec2c30bc90d771953838c566ba5daad62 /src/char_sql | |
parent | 1e560981e0c0dfff9cc0ae4c8cb3eb7e59438745 (diff) | |
download | hercules-226d526a49322d1fa755645801254703dfd90476.tar.gz hercules-226d526a49322d1fa755645801254703dfd90476.tar.bz2 hercules-226d526a49322d1fa755645801254703dfd90476.tar.xz hercules-226d526a49322d1fa755645801254703dfd90476.zip |
Fixed an issue in r12575 where 'not setting char offline when going from mapserver to charserver' also caused a permanent account lockout if the player pressed 'cancel' in the char select screen.
Merged some recent changes from SQL to TXT, as someone didn't bother to do it.
Ifdefed the quest data request code as SQL-only (this was causing server disconnects whenver someone logged in).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12606 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r-- | src/char_sql/char.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 992e7892a..d3839ca2f 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -263,8 +263,7 @@ void set_char_offline(int char_id, int account_id) { struct online_char_data* character; - //FIXME: usage of 'magic constant'; this needs to go! [ultramage] - if ( char_id == 99 ) + if ( char_id == -1 ) { if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `online`='0' WHERE `account_id`='%d'", char_db, account_id) ) Sql_ShowDebug(sql_handle); @@ -297,7 +296,7 @@ void set_char_offline(int char_id, int account_id) } } - if (login_fd > 0 && !session[login_fd]->flag.eof && (character == NULL || character->char_id != -1)) + if (login_fd > 0 && !session[login_fd]->flag.eof && (char_id == -1 || character == NULL || character->char_id != -1)) { WFIFOHEAD(login_fd,6); WFIFOW(login_fd,0) = 0x272c; @@ -1930,7 +1929,7 @@ int parse_fromlogin(int fd) set_eof(i); } else //Shouldn't happen, but just in case. - set_char_offline(99, aid); + set_char_offline(-1, aid); } } } @@ -2917,7 +2916,6 @@ int parse_char(int fd) { // already authed client struct online_char_data* data = (struct online_char_data*)idb_get(online_char_db, sd->account_id); if( data == NULL || data->server == -1) //If it is not in any server, send it offline. [Skotlex] - //send -1 as char id (99 means at char select) [Kevin] set_char_offline(-1,sd->account_id); if( data != NULL && data->fd == fd) data->fd = -1; |