From 85bdc1dc6c13036984310f39428c82968ecffba7 Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 10 Jul 2006 19:41:25 +0000 Subject: - Added login-char packet 0x2737. Sets all characters offline (login-server side). - Cleaned up char server "set all offline" implementation to remove only characters from the map-server from which the packet was invoked. It will also now correctly kick/set-character offline from the map-server if they are connected. - Cleaned up the char-sql reconnect code. It no longer sets everyone to offline. - Removed setting "kick_on_disconnect", servers will no longer kick characters out when there's a disconnection. Instead, it'll use the most logical approach: Set characters into a "lost" state when there's a disconnection, on reconnect, resent the list of online-characters, do a sync, and let the difference be characters to be removed. Also, the map-server won't release character data until it's saved and the ack returns from the char-server to prevent data loss (all this data is resent on reconnect for saving anyway). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7600 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/chrif.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'src/map/chrif.c') diff --git a/src/map/chrif.c b/src/map/chrif.c index 9e98b5eb9..3cbce9849 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -454,7 +454,7 @@ int chrif_scdata_request(int account_id, int char_id) #endif chrif_check(-1); - WFIFOHEAD(char_fd, 10); + WFIFOHEAD(char_fd, 10); WFIFOW(char_fd, 0) = 0x2afc; WFIFOL(char_fd, 2) = account_id; WFIFOL(char_fd, 6) = char_id; @@ -1344,7 +1344,7 @@ int chrif_char_offline(struct map_session_data *sd) { chrif_check(-1); - WFIFOHEAD(char_fd, 10); + WFIFOHEAD(char_fd, 10); WFIFOW(char_fd,0) = 0x2b17; WFIFOL(char_fd,2) = sd->status.char_id; WFIFOL(char_fd,6) = sd->status.account_id; @@ -1374,7 +1374,7 @@ int chrif_flush_fifo(void) { int chrif_char_reset_offline(void) { chrif_check(-1); - WFIFOHEAD(char_fd, 2); + WFIFOHEAD(char_fd, 2); WFIFOW(char_fd,0) = 0x2b18; WFIFOSET(char_fd,2); @@ -1399,35 +1399,15 @@ int chrif_char_online(struct map_session_data *sd) return 0; } -/*========================================== - * - *------------------------------------------ - */ -int chrif_disconnect_sub(struct map_session_data* sd,va_list va) { - if (sd->fd) - clif_authfail_fd(sd->fd,1); - else - map_quit(sd); - return 0; -} - int chrif_disconnect(int fd) { if(fd == char_fd) { char_fd = 0; ShowWarning("Map Server disconnected from Char Server.\n\n"); - if (kick_on_disconnect) - clif_foreachclient(chrif_disconnect_sub); chrif_connected = 0; other_mapserver_count=0; //Reset counter. We receive ALL maps from all map-servers on reconnect. map_eraseallipport(); - // 倉庫キャッシュを消す - if (kick_on_disconnect) - { //Do not clean the storage if players are gonna be left inside. [Skotlex] - do_final_storage(); - do_init_storage(); - } //Attempt to reconnect in a second. [Skotlex] add_timer(gettick() + 1000, check_connect_char_server, 0, 0); } -- cgit v1.2.3-70-g09d2