summaryrefslogtreecommitdiff
path: root/src/map/chrif.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-10 19:41:25 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-10 19:41:25 +0000
commit85bdc1dc6c13036984310f39428c82968ecffba7 (patch)
tree88e0e06f9b7bfa6bcd30b75c6e8f5335b26267c1 /src/map/chrif.c
parent1a26dbddc283e94bdfb684a71b0d9db471e18b3b (diff)
downloadhercules-85bdc1dc6c13036984310f39428c82968ecffba7.tar.gz
hercules-85bdc1dc6c13036984310f39428c82968ecffba7.tar.bz2
hercules-85bdc1dc6c13036984310f39428c82968ecffba7.tar.xz
hercules-85bdc1dc6c13036984310f39428c82968ecffba7.zip
- 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
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r--src/map/chrif.c26
1 files changed, 3 insertions, 23 deletions
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);
}