summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-20 17:49:30 +0000
committerLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-20 17:49:30 +0000
commit7c958b1bd13c14022fb118fca661eb449645c87a (patch)
treeb6776d6eb162b0b0c834b8a5a83417e77412c314 /src/map
parentc5d586a611baf934fe30b2291e51002a4506bdbb (diff)
downloadhercules-7c958b1bd13c14022fb118fca661eb449645c87a.tar.gz
hercules-7c958b1bd13c14022fb118fca661eb449645c87a.tar.bz2
hercules-7c958b1bd13c14022fb118fca661eb449645c87a.tar.xz
hercules-7c958b1bd13c14022fb118fca661eb449645c87a.zip
some Valaris's fixes of "double connect bug"
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@663 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c8
-rw-r--r--src/map/map.c4
-rw-r--r--src/map/pc.c17
-rw-r--r--src/map/pc.h3
4 files changed, 32 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 36001f74e..951eed42c 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3543,6 +3543,7 @@ void clif_getareachar_pc(struct map_session_data* sd,struct map_session_data* ds
* NPC表示
*------------------------------------------
*/
+//fixed by Valaris
void clif_getareachar_npc(struct map_session_data* sd,struct npc_data* nd)
int len;
nullpo_retv(sd);
@@ -3560,6 +3561,7 @@ void clif_getareachar_npc(struct map_session_data* sd,struct npc_data* nd)
clif_dispchat((struct chat_data*)map_id2bl(nd->chat_id),sd->fd);
}
}
+
/*==========================================
* 移動停止
*------------------------------------------
@@ -7424,6 +7426,12 @@ void clif_parse_TickSend(int fd, struct map_session_data *sd) {
sd->client_tick = RFIFOL(fd,2);
break;
}
+
+ //double connection bug fix by Valaris
+ if(sd->alive_timer)
+ delete_timer(sd->alive_timer,pc_alive_timer);
+ sd->alive_timer=add_timer(gettick()+60*1000,pc_alive_timer,sd->bl.id,0);
+
sd->server_tick = gettick();
clif_servertick(sd);
}
diff --git a/src/map/map.c b/src/map/map.c
index f066b8f00..d709272be 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1035,6 +1035,10 @@ int map_quit(struct map_session_data *sd) {
chrif_save(sd);
storage_storage_save(sd);
+ //double connect bug fix by Valaris
+ if(sd->alive_timer)
+ delete_timer(sd->alive_timer,pc_alive_timer);
+
if( sd->npc_stackbuf && sd->npc_stackbuf != NULL)
free( sd->npc_stackbuf );
diff --git a/src/map/pc.c b/src/map/pc.c
index 4a019de58..40b8491b5 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3892,6 +3892,11 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt
// map_addblock(&sd->bl); /// ブロック登?とspawnは
// clif_spawnpc(sd);
+ //double connection bug fix by Valaris
+ if(sd->alive_timer)
+ delete_timer(sd->alive_timer,pc_alive_timer);
+ sd->alive_timer=add_timer(gettick()+60*1000,pc_alive_timer,sd->bl.id,0);
+
return 0;
}
@@ -8085,6 +8090,7 @@ int do_init_pc(void) {
// add night/day timer (by [yor])
add_timer_func_list(map_day_timer, "map_day_timer"); // by [yor]
add_timer_func_list(map_night_timer, "map_night_timer"); // by [yor]
+ add_timer_func_list(pc_alive_timer, "pc_alive_timer"); //by Valaris
{
int day_duration = battle_config.day_duration;
int night_duration = battle_config.night_duration;
@@ -8105,3 +8111,14 @@ int do_init_pc(void) {
return 0;
}
+
+//Valaris
+int pc_alive_timer(int tid,unsigned int tick,int id,int data)
+{
+ struct map_session_data *sd=(struct map_session_data*)map_id2bl(id);
+ nullpo_retr(0, sd);
+ if(sd->alive_timer != tid)
+ return 0;
+ map_quit(sd);
+ return 0;
+} \ No newline at end of file
diff --git a/src/map/pc.h b/src/map/pc.h
index 5e6ff280d..2de919ce2 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -198,5 +198,8 @@ int night_timer_tid;
int map_day_timer(int,unsigned int,int,int); // by [yor]
int map_night_timer(int,unsigned int,int,int); // by [yor]
+//double connect bug fix
+add int pc_alive_timer(int tid,unsigned int tick,int,int);
+
#endif