From 200bb9f2408d0abb805c8352750a9d4949fbed78 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 16 Apr 2019 23:23:40 +0300 Subject: Add option for drop connection on disconnect packet from client New configuration option drop_connection_on_quit. --- src/map/battle.c | 1 + src/map/battle.h | 4 +++- src/map/clif.c | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/map/battle.c b/src/map/battle.c index ba7c1130d..b06de267d 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7418,6 +7418,7 @@ static const struct battle_data { { "ping_timer_inverval", &battle_config.ping_timer_interval, 30, 0, 99999999, }, { "ping_time", &battle_config.ping_time, 20, 0, 99999999, }, { "option_drop_max_loop", &battle_config.option_drop_max_loop, 10, 1, 100000, }, + { "drop_connection_on_quit", &battle_config.drop_connection_on_quit, 0, 0, 1, }, }; static bool battle_set_value_sub(int index, int value) diff --git a/src/map/battle.h b/src/map/battle.h index a99e95c86..8743274ee 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -583,8 +583,10 @@ struct Battle_Config { int ping_timer_interval; int ping_time; - + int option_drop_max_loop; + + int drop_connection_on_quit; }; /* criteria for battle_config.idletime_critera */ diff --git a/src/map/clif.c b/src/map/clif.c index 43407af10..91965cce1 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10978,7 +10978,8 @@ static void clif_parse_QuitGame(int fd, struct map_session_data *sd) (!battle_config.prevent_logout || DIFF_TICK(timer->gettick(), sd->canlog_tick) > battle_config.prevent_logout)) { clif->disconnect_ack(sd, 0); sockt->flush(fd); - sockt->eof(fd); + if (battle_config.drop_connection_on_quit) + sockt->eof(fd); } else { clif->disconnect_ack(sd, 1); } -- cgit v1.2.3-70-g09d2