From 89ed514db4619f1d0a20a90c7f6db64e22fdfdb9 Mon Sep 17 00:00:00 2001 From: celest Date: Sat, 25 Dec 2004 05:28:29 +0000 Subject: git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@785 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/clif.c | 24 ++++++++++++++++++++++-- src/map/clif.h | 1 + src/map/pc.c | 4 +++- 3 files changed, 26 insertions(+), 3 deletions(-) (limited to 'src/map') diff --git a/src/map/clif.c b/src/map/clif.c index 75f791589..386cceb44 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -7104,6 +7104,25 @@ int clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd,int ty return 0; } + +/*========================================== + * + *------------------------------------------ + */ + +int clif_timedout(struct map_session_data *sd) +{ + nullpo_retr(0, sd); + + sprintf(tmp_output,"%sCharacter with Account ID '"CL_WHITE"%d"CL_RESET"' timed out.\n", (pc_isGM(sd))?"GM ":"", sd->bl.id); + ShowInfo(tmp_output); + map_quit(sd); + clif_authfail_fd(sd->fd,3); // Even if player is not on we still send anyway + clif_setwaitclose(sd->fd); // Set session to EOF + + return 0; +} + /*========================================== * Wis‹‘”Ϋ‹–‰Β‰ž“š *------------------------------------------ @@ -7251,8 +7270,9 @@ void clif_parse_WantToConnection(int fd, struct map_session_data *sd) // if same account already connected, we disconnect the 2 sessions if ((old_sd = map_id2sd(account_id)) != NULL) { - clif_authfail_fd(fd, 2); // same id + clif_authfail_fd(fd, 8); // still recognizes last connection clif_authfail_fd(old_sd->fd, 2); // same id + clif_setwaitclose(sd->fd); // Set session to EOF } else { sd = session[fd]->session_data = (struct map_session_data*)aCalloc(1, sizeof(struct map_session_data)); sd->fd = fd; @@ -10234,7 +10254,7 @@ static int clif_parse(int fd) { if (RFIFOREST(fd) < 2) return 0; - //printf("clif_parse: connection #%d, packet: 0x%x (with being read: %d bytes).\n", fd, RFIFOW(fd,0), RFIFOREST(fd)); +// printf("clif_parse: connection #%d, packet: 0x%x (with being read: %d bytes).\n", fd, RFIFOW(fd,0), RFIFOREST(fd)); cmd = RFIFOW(fd,0); diff --git a/src/map/clif.h b/src/map/clif.h index 0a61ea052..a51aaddfc 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -280,6 +280,7 @@ int clif_message(struct block_list *bl, char* msg); // messages (from mobs/npcs) int clif_GM_kickack(struct map_session_data *sd,int id); int clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd,int type); +int clif_timedout(struct map_session_data *sd); int clif_foreachclient(int (*)(struct map_session_data*,va_list),...); diff --git a/src/map/pc.c b/src/map/pc.c index 897b96861..fda290532 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -7853,7 +7853,9 @@ int pc_alive_timer(int tid,unsigned int tick,int id,int data) nullpo_retr(0, sd); if(sd->alive_timer != tid) return 0; - map_quit(sd); +// map_quit(sd); + clif_timedout (sd); + return 0; } -- cgit v1.2.3-70-g09d2