diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-03-25 09:56:18 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-03-25 09:56:18 +0000 |
commit | fc135d64a1ad6b36d807e6b7ab9d804bffe95e48 (patch) | |
tree | 0c443f2942d07e145f1055d2301d215ebd317976 /src/login_sql | |
parent | f257beaebc07d3a1d8acae247f10ab35a19d867c (diff) | |
download | hercules-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_sql')
-rw-r--r-- | src/login_sql/login.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/login_sql/login.c b/src/login_sql/login.c index f4a40c990..fddb4b248 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -553,17 +553,22 @@ int mmo_auth(struct mmo_account* account, int fd) if( login_config.online_check ) { struct online_login_data* data = idb_get(online_db, account->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", account->userid); - WBUFW(buf,0) = 0x2734; - WBUFL(buf,2) = account->account_id; - charif_sendallwos(-1, buf, 6); - if( data->waiting_disconnect == -1 ) - data->waiting_disconnect = add_timer(gettick()+30000, waiting_disconnect_timer, account->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", account->userid); + WBUFW(buf,0) = 0x2734; + WBUFL(buf,2) = account->account_id; + charif_sendallwos(-1, buf, 6); + if( data->waiting_disconnect == -1 ) + data->waiting_disconnect = add_timer(gettick()+30000, waiting_disconnect_timer, account->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 + } } @@ -667,7 +672,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 |