From c41d6db582953265e2070b54529ed4baf9c61347 Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 10 Apr 2008 21:28:27 +0000 Subject: Client not marked online until map receives auth request from the client and is approved. Also added some online/offline sets to the auth system that were being looked over and not properly updating the char server as to what's going on. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12552 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/chrif.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/map/chrif.c') diff --git a/src/map/chrif.c b/src/map/chrif.c index 48bd65522..cb631a16c 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -163,6 +163,7 @@ static bool chrif_auth_logout(TBL_PC* sd, enum sd_state state) if(sd->fd && state == ST_LOGOUT) { //Disassociate player, and free it after saving ack returns. [Skotlex] //fd info must not be lost for ST_MAPCHANGE as a final packet needs to be sent to the player. + chrif_char_offline(sd); if (session[sd->fd]) session[sd->fd]->session_data = NULL; sd->fd = 0; @@ -527,16 +528,18 @@ void chrif_authreq(struct map_session_data *sd) node->login_id1 == sd->login_id1) { //auth ok if (!pc_authok(sd, node->login_id2, node->expiration_time, node->char_dat)) + chrif_char_offline(sd); //Set client offline chrif_auth_delete(node->account_id, node->char_id, ST_LOGIN); else { //char_dat no longer needed, but player auth is not completed yet. aFree(node->char_dat); node->char_dat = NULL; node->sd = sd; + chrif_char_online(sd); //Set client online } } else { //auth failed pc_authfail(sd); - chrif_char_offline(sd); //Set him offline, the char server likely has it set as online already. + chrif_char_offline(sd); //Set client offline chrif_auth_delete(sd->status.account_id, sd->status.char_id, ST_LOGIN); } return; @@ -576,11 +579,14 @@ void chrif_authok(int fd) node->login_id1 == RFIFOL(fd, 8)) { //Auth Ok if (pc_authok(sd, RFIFOL(fd, 16), RFIFOL(fd, 12), status)) + { + chrif_char_online(sd); return; + } } else { //Auth Failed pc_authfail(sd); - chrif_char_offline(sd); //Set him offline, the char server likely has it set as online already. } + chrif_char_offline(sd); //Set client offline chrif_auth_delete(account_id, char_id, ST_LOGIN); return; } @@ -619,6 +625,7 @@ int auth_db_cleanup_sub(DBKey key,void *data,va_list ap) default: //Clear data. any connected players should have timed out by now. ShowInfo("auth_db: Node (state %s) timed out for %d:%d\n", states[node->state], node->account_id, node->char_id); + chrif_char_offline(node->sd); chrif_auth_delete(node->account_id, node->char_id, node->state); break; } -- cgit v1.2.3-70-g09d2