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://svn.code.sf.net/p/rathena/svn/trunk@12606 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
ultramage 2008-04-16 07:48:53 +00:00
parent 034920992e
commit 70e34f81cd
6 changed files with 27 additions and 21 deletions

View File

@ -6,7 +6,7 @@
1001,SCORPION,Scorpion,Scorpion,24,1109,0,287,176,1,80,135,30,0,1,24,24,5,52,5,10,12,0,4,23,0x3195,200,1564,864,576,0,0,0,0,0,0,0,0,990,70,904,5500,757,57,943,210,7041,100,508,200,625,20,0,0,0,0,4068,1
1002,PORING,Poring,Poring,1,50,0,2,1,1,7,10,0,5,1,1,1,0,6,30,10,12,1,3,21,0x83,400,1872,672,480,0,0,0,0,0,0,0,0,909,7000,1202,100,938,400,512,1000,713,1500,512,150,619,20,0,0,0,0,4001,1
1003,TESTEGG,Test Egg,Test Egg,2,100000,0,10,10,0,3,9,99,0,1,99,1,1,1,1,10,12,0,4,22,0,512,0,512,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
//1003,TESTEGG,Test Egg,Test Egg,2,100000,0,10,10,0,3,9,99,0,1,99,1,1,1,1,10,12,0,4,22,0,512,0,512,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1004,HORNET,Hornet,Hornet,8,169,0,19,15,1,22,27,5,5,6,20,8,10,17,5,10,12,0,4,24,0x1189,150,1292,792,216,0,0,0,0,0,0,0,0,992,80,939,9000,909,3500,1208,15,511,350,518,150,0,0,0,0,0,0,4019,1
1005,FARMILIAR,Familiar,Familiar,8,155,0,28,15,1,20,28,0,0,1,12,8,5,28,0,10,12,0,2,27,0x3885,150,1276,576,384,0,0,0,0,0,0,0,0,913,5500,1105,20,2209,15,601,50,514,100,507,700,645,50,0,0,0,0,4020,1
//1006,THIEF_BUG_LARVA,Thief Bug Larva,Thief Bug Larva,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

View File

@ -3,15 +3,16 @@
//===== By ================================================
//= Valaris, Spira, Au{R}oN, Tharis, HiddenDragon
//===== Version ===========================================
//= 1.6
//= 1.7
//=========================================================
//= 1.0 - Formatted to the standard
//= 1.1 - New Effects, up to 2007/05/07 Sakexe [Au{R}oN]
//= 1.2 - New Effects, up to 2007/07/12 Sakexe [Au{R}oN]
//= 1.3 - New Effects, up to 2007/08/01 Sakexe [Au{R}oN]
//= 1.4 - New Effects, up to 2007/09/11 Sakexe [Au{R}oN]
//= 1.5 - New Effects, up to 2007/10/02 Sakexe [Au{R}oN]
//= 1.6 - New Effects, up to 2008/01/02 Sakexe [Au{R}oN]
//= 1.1 - New Effects, up to 2007/05/07 Sakexe. [Au{R}oN]
//= 1.2 - New Effects, up to 2007/07/12 Sakexe. [Au{R}oN]
//= 1.3 - New Effects, up to 2007/08/01 Sakexe. [Au{R}oN]
//= 1.4 - New Effects, up to 2007/09/11 Sakexe. [Au{R}oN]
//= 1.5 - New Effects, up to 2007/10/02 Sakexe. [Au{R}oN]
//= 1.6 - New Effects, up to 2008/01/02 Sakexe. [Au{R}oN]
//= 1.7 - New Effects, up to 2008/03/26 Sakexe. [Au{R}oN]
//===== Description =======================================
//= A list of client-side effects sorted by their ID
//=========================================================
@ -721,4 +722,7 @@ number description
694. The Semi-Green Sun
695. Something Like Green DiscoDance Light.
696. The same of 690 and 691 but Blue/Purple.
697+. No More Effects From 2008/01/22 Sakexe
697. (Nothing)
698. (Nothing)
699. Fall of powder from the sky and raise of some leaf.
700+. No More Effects From 2008/03/26 Sakexe.

View File

@ -241,15 +241,19 @@ void set_char_offline(int char_id, int account_id)
if( character->server > -1 )
server[character->server].users--;
character->char_id = -1;
character->server = -1;
if(character->waiting_disconnect != -1){
delete_timer(character->waiting_disconnect, chardb_waiting_disconnect);
character->waiting_disconnect = -1;
}
//If user is NOT at char screen, delete entry [Kevin]
if(character->char_id != -1)
{
idb_remove(online_char_db, account_id);
}
}
if (login_fd > 0 && !session[login_fd]->flag.eof)
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;
@ -2335,7 +2339,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);
}
}
}

View File

@ -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;

View File

@ -7952,7 +7952,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
}
#ifndef TXT_ONLY
mail_clear(sd);
mail_clear(sd);
#endif
quest_pc_login(sd);

View File

@ -962,11 +962,11 @@ int pc_reg_received(struct map_session_data *sd)
status_calc_pc(sd,1);
chrif_scdata_request(sd->status.account_id, sd->status.char_id);
#ifndef TXT_ONLY
intif_Mail_requestinbox(sd->status.char_id, 0); // MAIL SYSTEM - Request Mail Inbox
#endif
intif_request_questlog(sd);
#endif
if (!sd->state.connect_new && sd->fd)
{ //Character already loaded map! Gotta trigger LoadEndAck manually.