summaryrefslogtreecommitdiff
path: root/src/map/chrif.c
diff options
context:
space:
mode:
author(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-27 15:53:28 +0000
committer(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-27 15:53:28 +0000
commit8f3d851c422e444510b659a2f4f850cb5036e604 (patch)
tree95655c033a5c9b4ff4f88d1738899ea703918305 /src/map/chrif.c
parent33794f0169fff0884af02c9487a8660572de94d5 (diff)
downloadhercules-8f3d851c422e444510b659a2f4f850cb5036e604.tar.gz
hercules-8f3d851c422e444510b659a2f4f850cb5036e604.tar.bz2
hercules-8f3d851c422e444510b659a2f4f850cb5036e604.tar.xz
hercules-8f3d851c422e444510b659a2f4f850cb5036e604.zip
Kick all characters when the char server disconnects from the map server
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1005 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r--src/map/chrif.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index cda7b42e2..185fe307d 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -992,6 +992,27 @@ int chrif_char_online(struct map_session_data *sd)
return 0;
}
+/*==========================================
+ *
+ *------------------------------------------
+ */
+int chrif_disconnect_sub(struct map_session_data* sd,va_list va) {
+ clif_authfail_fd(sd->fd,1);
+ map_quit(sd);
+ return 0;
+}
+
+int chrif_disconnect(int fd) {
+ if(fd == char_fd) {
+ char_fd = -1;
+ sprintf(tmp_output,"Map Server disconnected from Char Server.\n\n");
+ ShowWarning(tmp_output);
+ clif_foreachclient(chrif_disconnect_sub);
+ chrif_connected = 0;
+ }
+ close(fd);
+ return 0;
+}
/*==========================================
*
@@ -1003,13 +1024,8 @@ int chrif_parse(int fd)
// only char-server can have an access to here.
// so, if it isn't the char-server, we disconnect the session (fd != char_fd).
if (fd != char_fd || session[fd]->eof) {
- if (fd == char_fd) {
- if (chrif_connected == 1) {
- sprintf(tmp_output,"Map Server disconnected from Char Server.\n\n");
- ShowWarning(tmp_output);
- chrif_connected=0;
- }
- char_fd = -1;
+ if (fd == char_fd && chrif_connected == 1) {
+ chrif_disconnect (fd);
// check_connect_char_server(0, 0, 0, 0);
}
close(fd);