summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-10 21:28:27 +0000
committerKevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-10 21:28:27 +0000
commitc41d6db582953265e2070b54529ed4baf9c61347 (patch)
treef79bb91c511845e8f2229f250e13a7b862cf9e42
parentca96d6732c71834c6424dfeb4b6696c381f6c662 (diff)
downloadhercules-c41d6db582953265e2070b54529ed4baf9c61347.tar.gz
hercules-c41d6db582953265e2070b54529ed4baf9c61347.tar.bz2
hercules-c41d6db582953265e2070b54529ed4baf9c61347.tar.xz
hercules-c41d6db582953265e2070b54529ed4baf9c61347.zip
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
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--src/char_sql/char.c1
-rw-r--r--src/map/chrif.c11
3 files changed, 12 insertions, 3 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index c776cea21..8293b92a6 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,9 @@ 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.
2008/04/10
+ * 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 skipped.(r12552) [Kevin]
* Rev. 12550 Reverted the change to MAX_SQUARE_LAYOUT. [L0ne_W0lf]
* Rev. 12548 Updated NPC skill "Evil Land". More gravity wtfage. [L0ne_W0lf]
- Based on visual observation, and experience with it on iRO Sakray.
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 4ee3c51f9..5ba6c6b29 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -3171,7 +3171,6 @@ int parse_char(int fd)
node->ip = ipl;
idb_put(auth_db, sd->account_id, node);
- set_char_online(i, char_dat.char_id, char_dat.account_id);
}
break;
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;
}