summaryrefslogtreecommitdiff
path: root/src/map/chrif.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-04 18:04:04 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-04 18:04:04 +0000
commitb0c94b71b90c7ed4d3199e0ad019073c3f75f800 (patch)
treec1bb56b010b1573a812002d0c8c60e5996997512 /src/map/chrif.c
parent073d27498e3c63b64e9926c0ada83e3868aadc8f (diff)
downloadhercules-b0c94b71b90c7ed4d3199e0ad019073c3f75f800.tar.gz
hercules-b0c94b71b90c7ed4d3199e0ad019073c3f75f800.tar.bz2
hercules-b0c94b71b90c7ed4d3199e0ad019073c3f75f800.tar.xz
hercules-b0c94b71b90c7ed4d3199e0ad019073c3f75f800.zip
- Updated firepillar so it cannot be placed on top of others.
- Updated the firepillar code so it behaves like the other traps. - Changed the default format for @me and @main to avoid crashes on the newer clients. - Fixed the char-sql server so it returns a valid 'not found' packet when attempting to load a non-existing homunculus. - Fixed jump to use 0,0 for random coordinates rather than -1,-1 - Added missing \n to error reporting in getmonsterinfo - Additional status changes now only get triggered if the attack did damage, not if they get absorbed. - Fixed a logical comparison in unit_free to properly remove pets/homuncs when their intimacy is reduced to 0. - Properly set the opt3 value for Moonlight, Changeundead and Soul Link - Fixed the "no equip" flag of cards not being properly applied when attemting to equip items. - Added a check to avoid invoking pet menu entries when the pet is incuvated. - Fixed the session_data de-association in chrif_auth_delete - Cleaned chrif_auth_ok so that the latest received char info is kept when previous char login data was already in there. - Corrected docs mentioning non-existing flag 'mf_nopvp' git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12293 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r--src/map/chrif.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index db59e4097..941e17968 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -116,9 +116,9 @@ bool chrif_auth_delete(int account_id, int char_id, enum sd_state state) {
struct auth_node *node;
if ((node=chrif_auth_check(account_id, char_id, state)))
{
- if (node->fd && session[node->fd] && node->sd &&
- session[node->fd]->session_data == node->sd)
- session[node->fd]->session_data = NULL;
+ int fd = node->sd?node->sd->fd:node->fd;
+ if (session[fd] && session[fd]->session_data == node->sd)
+ session[fd]->session_data = NULL;
if (node->char_dat) aFree(node->char_dat);
if (node->sd) aFree(node->sd);
ers_free(auth_db_ers, node);
@@ -558,7 +558,9 @@ void chrif_authok(int fd)
if ((node = chrif_search(account_id)))
{ //Is the character already awaiting authorization?
- if (node->state == ST_LOGIN && node->sd)
+ if (node->state != ST_LOGIN)
+ return; //character in logout phase, do not touch that data.
+ if (node->sd)
{
sd = node->sd;
if(node->char_dat == NULL &&
@@ -566,16 +568,18 @@ void chrif_authok(int fd)
node->char_id == char_id &&
node->login_id1 == RFIFOL(fd, 8))
{ //Auth Ok
- if (!pc_authok(sd, RFIFOL(fd, 16), RFIFOL(fd, 12), status))
- chrif_auth_delete(account_id, char_id, ST_LOGIN);
+ if (pc_authok(sd, RFIFOL(fd, 16), RFIFOL(fd, 12), status))
+ 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_auth_delete(account_id, char_id, ST_LOGIN);
}
+ chrif_auth_delete(account_id, char_id, ST_LOGIN);
+ return;
}
- //Otherwise discard the entry received as we already have information.
- return;
+ //When we receive double login info and the client has not connected yet,
+ //discard the older one and keep the new one.
+ chrif_auth_delete(node->account_id, node->char_id, ST_LOGIN);
}
// Awaiting for client to connect.