summaryrefslogtreecommitdiff
path: root/src/map/chrif.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-23 15:58:36 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-23 15:58:36 +0000
commit994c3f6cf2e8a1a5b531340df3ab713cf176b854 (patch)
treea783e430870a99213030d6af7dc73cc0cc556f73 /src/map/chrif.c
parent0a3a5e636498600bda531404efabfcfea10ca150 (diff)
downloadhercules-994c3f6cf2e8a1a5b531340df3ab713cf176b854.tar.gz
hercules-994c3f6cf2e8a1a5b531340df3ab713cf176b854.tar.bz2
hercules-994c3f6cf2e8a1a5b531340df3ab713cf176b854.tar.xz
hercules-994c3f6cf2e8a1a5b531340df3ab713cf176b854.zip
- Made waiting_disconnect on the char server be an int to hold the timer ID of the timeout timer. It is now deleted when a player is successfully set offline/online.
- Corrected @unjail having the GM level check backwards. - chrif_authok will now reject to store the newly received status data when the player it was received from is still online, should prevent losing data in certain situations. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10060 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r--src/map/chrif.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index e19f66126..403cfdcb1 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -496,7 +496,18 @@ void chrif_authreq(struct map_session_data *sd)
//character selected, insert into auth db
void chrif_authok(int fd) {
struct auth_node *auth_data;
+ TBL_PC* sd;
RFIFOHEAD(fd);
+ //Check if we don't already have player data in our server
+ //(prevents data that is to be saved from being overwritten by
+ //this received status data if this auth is later successful) [Skotlex]
+ if ((sd = map_id2sd(RFIFOL(fd, 4))) != NULL)
+ {
+ struct mmo_charstatus *status = (struct mmo_charstatus *)RFIFOP(fd, 20);
+ //Auth check is because this could be the very same sd that is waiting char-server authorization.
+ if (sd->state.auth && sd->status.char_id == status->char_id)
+ return;
+ }
if ((auth_data =uidb_get(auth_db, RFIFOL(fd, 4))) != NULL)
{ //Is the character already awaiting authorization?