diff options
author | Andrei Karas <akaras@inbox.ru> | 2019-04-16 23:23:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2019-05-05 22:22:05 +0300 |
commit | 200bb9f2408d0abb805c8352750a9d4949fbed78 (patch) | |
tree | 4988c0775a669febaa446348aed16b0321a6667b /src/map | |
parent | a3cda4e072586458e1ace4d215f3fd2406518d96 (diff) | |
download | hercules-200bb9f2408d0abb805c8352750a9d4949fbed78.tar.gz hercules-200bb9f2408d0abb805c8352750a9d4949fbed78.tar.bz2 hercules-200bb9f2408d0abb805c8352750a9d4949fbed78.tar.xz hercules-200bb9f2408d0abb805c8352750a9d4949fbed78.zip |
Add option for drop connection on disconnect packet from client
New configuration option drop_connection_on_quit.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 1 | ||||
-rw-r--r-- | src/map/battle.h | 4 | ||||
-rw-r--r-- | src/map/clif.c | 3 |
3 files changed, 6 insertions, 2 deletions
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); } |