summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-25 05:28:29 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-25 05:28:29 +0000
commit89ed514db4619f1d0a20a90c7f6db64e22fdfdb9 (patch)
treea1f3351a76016e3b08e9ef9ec2f45f9dcb87514a
parent7ab61eb4bd3e948f57cd0439d81e4b29464623fa (diff)
downloadhercules-89ed514db4619f1d0a20a90c7f6db64e22fdfdb9.tar.gz
hercules-89ed514db4619f1d0a20a90c7f6db64e22fdfdb9.tar.bz2
hercules-89ed514db4619f1d0a20a90c7f6db64e22fdfdb9.tar.xz
hercules-89ed514db4619f1d0a20a90c7f6db64e22fdfdb9.zip
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@785 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog.txt5
-rw-r--r--src/map/clif.c24
-rw-r--r--src/map/clif.h1
-rw-r--r--src/map/pc.c4
4 files changed, 31 insertions, 3 deletions
diff --git a/Changelog.txt b/Changelog.txt
index 75498a36b..38b0506f9 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,5 +1,9 @@
Date Added
12/24
+ * Added suggested fix when client disconnected [celest]
+ - send "disconnected due to time gap" and close session when timed out
+ - send "server still recognises last login" message and close existing
+ session when client reconnects
* Upped windwalk to lv 10 in skill_tree [MouseJstr]
* Fixed a scripting crash (SVN: 781) [MouseJstr]
* removed @changesex and @charchangesex until we can
@@ -18,6 +22,7 @@ Date Added
Note: mes = otput into client's NPC window
debugmes = output into map-server window
logmes = output into lognpc log DB.
+
12/23
* Fixed some bugs in the clif.c changes (SVN 766 to SVN 767) [MouseJstr]
* Added ayo monsters to @disguise
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;
}