diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-03-27 12:06:12 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-03-27 12:06:12 +0000 |
commit | b7bda5cccb691b35415a7aa1f51190c4ca487fc9 (patch) | |
tree | 66f63255ee81b51bda20c5e5d89fee29f0fab9d3 /src/login/admin.c | |
parent | a011f250a762ed62403cf25f61f52e7b35193aec (diff) | |
download | hercules-b7bda5cccb691b35415a7aa1f51190c4ca487fc9.tar.gz hercules-b7bda5cccb691b35415a7aa1f51190c4ca487fc9.tar.bz2 hercules-b7bda5cccb691b35415a7aa1f51190c4ca487fc9.tar.xz hercules-b7bda5cccb691b35415a7aa1f51190c4ca487fc9.zip |
Partial rewrite of the login server's auth system.
* replaced the cyclic, size-limited auth_fifo data structure with the more appropriate DBMap-based alternative (stops some erratic behavior)
* added code to simulate the pseudo-status "online on login server"
* auth data will now expire after 30 seconds instead of persisting
* better-than-aegis handling of login cancellation (the server will wipe all previous auth data instead of making you wait for it to expire)
* proper status message - no more generic "rejected from server", now you'll get "the server still recognizes your last connection"
* fixed a typo in r10110 which caused disconnect timer removal to fail
* split off some parsing code to login_auth_ok() and login_auth_failed()
* extended the auth confirmation packet so that the login_id1/2 values are sent along with the associated account id (stops charserver from making wrong choices if two incoming sessions have the same account id)
* fixed a bug in the disconnect part of the main charserver parsing loop, where a non-authed client would erase the online db entry for a client that's already online, thus bypassing any dual-login checks
* added code to stop the waiting_disconnect timer when the associated online entry is removed right away, instead of doing checks later
* removed code that would periodically wipe the online status of clients that are in the auth process (producing yet more erratic behavior)
* commented out some TXT-only reconnect prevention code (bugreport:1281)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12441 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login/admin.c')
-rw-r--r-- | src/login/admin.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/login/admin.c b/src/login/admin.c index 32b89fc4d..02e7a83ba 100644 --- a/src/login/admin.c +++ b/src/login/admin.c @@ -270,9 +270,11 @@ int parse_admin(int fd) WBUFB(buf,6) = 0; // 0: change of statut, 1: ban WBUFL(buf,7) = statut; // status or final date of a banishment charif_sendallwos(-1, buf, 11); +/* for(j = 0; j < AUTH_FIFO_SIZE; j++) if (auth_fifo[j].account_id == auth_dat[i].account_id) auth_fifo[j].login_id1++; // to avoid reconnection error when come back from map-server (char-server will ask again the authentication) +*/ } auth_dat[i].state = statut; memcpy(auth_dat[i].error_message, error_message, 20); @@ -363,9 +365,11 @@ int parse_admin(int fd) if (auth_dat[i].sex != ((sex == 'S' || sex == 's') ? 2 : (sex == 'M' || sex == 'm'))) { unsigned char buf[16]; WFIFOL(fd,2) = auth_dat[i].account_id; +/* for(j = 0; j < AUTH_FIFO_SIZE; j++) if (auth_fifo[j].account_id == auth_dat[i].account_id) auth_fifo[j].login_id1++; // to avoid reconnection error when come back from map-server (char-server will ask again the authentication) +*/ auth_dat[i].sex = (sex == 'S' || sex == 's') ? 2 : (sex == 'M' || sex == 'm'); ShowNotice("'ladmin': Modification of a sex (account: %s, new sex: %c, ip: %s)\n", auth_dat[i].userid, sex, ip); mmo_auth_sync(); @@ -635,9 +639,11 @@ int parse_admin(int fd) WBUFB(buf,6) = 1; // 0: change of statut, 1: ban WBUFL(buf,7) = (unsigned int)timestamp; // status or final date of a banishment charif_sendallwos(-1, buf, 11); +/* for(j = 0; j < AUTH_FIFO_SIZE; j++) if (auth_fifo[j].account_id == auth_dat[i].account_id) auth_fifo[j].login_id1++; // to avoid reconnection error when come back from map-server (char-server will ask again the authentication) +*/ } auth_dat[i].ban_until_time = timestamp; mmo_auth_sync(); @@ -693,11 +699,13 @@ int parse_admin(int fd) WBUFB(buf,6) = 1; // 0: change of statut, 1: ban WBUFL(buf,7) = (unsigned int)timestamp; // status or final date of a banishment charif_sendallwos(-1, buf, 11); +/* for(j = 0; j < AUTH_FIFO_SIZE; j++) if (auth_fifo[j].account_id == auth_dat[i].account_id) { auth_fifo[j].login_id1++; // to avoid reconnection error when come back from map-server (char-server will ask again the authentication) break; } +*/ } auth_dat[i].ban_until_time = timestamp; mmo_auth_sync(); |