summaryrefslogtreecommitdiff
path: root/src/login/login.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-25 09:56:18 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-25 09:56:18 +0000
commitfc135d64a1ad6b36d807e6b7ab9d804bffe95e48 (patch)
tree0c443f2942d07e145f1055d2301d215ebd317976 /src/login/login.c
parentf257beaebc07d3a1d8acae247f10ab35a19d867c (diff)
downloadhercules-fc135d64a1ad6b36d807e6b7ab9d804bffe95e48.tar.gz
hercules-fc135d64a1ad6b36d807e6b7ab9d804bffe95e48.tar.bz2
hercules-fc135d64a1ad6b36d807e6b7ab9d804bffe95e48.tar.xz
hercules-fc135d64a1ad6b36d807e6b7ab9d804bffe95e48.zip
Added proper checks to adoption processing (followup to r12428).
Cleaned up some code / fixed some typos. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12432 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login/login.c')
-rw-r--r--src/login/login.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/login/login.c b/src/login/login.c
index 02c6cbd38..2931c87cb 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -1151,17 +1151,22 @@ int mmo_auth(struct mmo_account* account, int fd)
if( login_config.online_check )
{
struct online_login_data* data = idb_get(online_db,auth_dat[i].account_id);
- if( data && data->char_server > -1 )
- {
- //Request char servers to kick this account out. [Skotlex]
- uint8 buf[8];
- ShowNotice("User '%s' is already online - Rejected.\n", auth_dat[i].userid);
- WBUFW(buf,0) = 0x2734;
- WBUFL(buf,2) = auth_dat[i].account_id;
- charif_sendallwos(-1, buf, 6);
- if( data->waiting_disconnect == -1 )
- data->waiting_disconnect = add_timer(gettick()+30000, waiting_disconnect_timer, auth_dat[i].account_id, 0);
- return 3; // Rejected
+ if( data )
+ {// account is already marked as online!
+ if( data->char_server > -1 )
+ {
+ //Request char servers to kick this account out. [Skotlex]
+ uint8 buf[8];
+ ShowNotice("User '%s' is already online - Rejected.\n", auth_dat[i].userid);
+ WBUFW(buf,0) = 0x2734;
+ WBUFL(buf,2) = auth_dat[i].account_id;
+ charif_sendallwos(-1, buf, 6);
+ if( data->waiting_disconnect == -1 )
+ data->waiting_disconnect = add_timer(gettick()+30000, waiting_disconnect_timer, auth_dat[i].account_id, 0);
+ return 3; // Rejected
+ }
+ else
+ ; // the client disconnects after doing auth, so can't really kick it... need some form of expiration timer
}
}
@@ -1274,7 +1279,7 @@ int parse_fromchar(int fd)
auth_fifo[i].login_id2 == login_id2 &&
auth_fifo[i].sex == sex &&
auth_fifo[i].ip == ip_ &&
- !auth_fifo[i].delflag );
+ auth_fifo[i].delflag == 0 );
if( i == AUTH_FIFO_SIZE || account_id <= 0 )
{// authentication not found