diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-12-02 09:39:35 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-12-02 09:39:35 +0000 |
commit | 357627760a5810bf33e162431fd98c3f6ee84cfc (patch) | |
tree | c8ed4859fe4869caba2790734960e6e99611ea99 /src/login | |
parent | 8624af1916d4926e421ba4a5a9b261420fcaf189 (diff) | |
download | hercules-357627760a5810bf33e162431fd98c3f6ee84cfc.tar.gz hercules-357627760a5810bf33e162431fd98c3f6ee84cfc.tar.bz2 hercules-357627760a5810bf33e162431fd98c3f6ee84cfc.tar.xz hercules-357627760a5810bf33e162431fd98c3f6ee84cfc.zip |
Fixed charserver unable to reestablish link to login server after a disconnect (yet another problem caused by r11826).
Copied code from TXT to SQL to perform a graceful shutdown of all login server sockets while exiting.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11848 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/login.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/login/login.c b/src/login/login.c index 844549c6a..530d2eeda 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -1233,9 +1233,9 @@ int parse_fromchar(int fd) if( session[fd]->eof ) { ShowStatus("Char-server '%s' has disconnected.\n", server[id].name); - server[id].fd = -1; - memset(&server[id], 0, sizeof(struct mmo_char_server)); online_db->foreach(online_db, online_db_setoffline, id); //Set all chars from this char server to offline. + memset(&server[id], 0, sizeof(struct mmo_char_server)); + server[id].fd = -1; do_close(fd); return 0; } @@ -2606,7 +2606,8 @@ void login_set_defaults() void do_final(void) { int i, fd; - ShowInfo("Terminating...\n"); + ShowStatus("Terminating...\n"); + mmo_auth_sync(); online_db->destroy(online_db, NULL); @@ -2615,10 +2616,11 @@ void do_final(void) if(access_ladmin_allow) aFree(access_ladmin_allow); if(access_allow) aFree(access_allow); if(access_deny) aFree(access_deny); + for (i = 0; i < MAX_SERVERS; i++) { if ((fd = server[i].fd) >= 0) { - server[i].fd = -1; memset(&server[i], 0, sizeof(struct mmo_char_server)); + server[i].fd = -1; do_close(fd); } } @@ -2626,6 +2628,7 @@ void do_final(void) if(log_fp) fclose(log_fp); + ShowStatus("Finished.\n"); } |