diff options
author | EyesOfAHawk <blackoutro2006@gmail.com> | 2018-10-16 19:53:33 +1300 |
---|---|---|
committer | EyesOfAHawk <blackoutro2006@gmail.com> | 2018-10-16 19:53:33 +1300 |
commit | 86b135b3e0a76680af677cca491b471d6c0d6429 (patch) | |
tree | 7875fa68f9a2fccac6e2d63c28ecc92571647484 /src/map/channel.c | |
parent | baeb7a1742b0fd7ac5d3a4cecd90f74d461895fe (diff) | |
download | hercules-86b135b3e0a76680af677cca491b471d6c0d6429.tar.gz hercules-86b135b3e0a76680af677cca491b471d6c0d6429.tar.bz2 hercules-86b135b3e0a76680af677cca491b471d6c0d6429.tar.xz hercules-86b135b3e0a76680af677cca491b471d6c0d6429.zip |
Add config for '@channel setopt MessageDelay <delay>'.
Diffstat (limited to 'src/map/channel.c')
-rw-r--r-- | src/map/channel.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/map/channel.c b/src/map/channel.c index f1946385d..73398c152 100644 --- a/src/map/channel.c +++ b/src/map/channel.c @@ -622,7 +622,8 @@ static void read_channels_config(void) irc_autojoin = 0, irc_flood_protection_rate = 0, irc_flood_protection_burst = 0, - irc_flood_protection_enabled = 0; + irc_flood_protection_enabled = 0, + channel_opt_msg_delay = 10; if( !libconfig->setting_lookup_string(settings, "map_local_channel_name", &local_name) ) local_name = "map"; @@ -818,6 +819,16 @@ static void read_channels_config(void) } } + libconfig->setting_lookup_int(settings, "channel_opt_msg_delay", &channel_opt_msg_delay); + if (channel_opt_msg_delay < 0) { + ShowWarning("channels.conf: channel_opt_msg_delay value '%d' must be from 0-255. Defaulting to 0...\n", channel_opt_msg_delay); + channel_opt_msg_delay = 0; + } else if (channel_opt_msg_delay > 255) { + ShowWarning("channels.conf: channel_opt_msg_delay value '%d' must be from 0-255. Defaulting to 255...\n", channel_opt_msg_delay); + channel_opt_msg_delay = 255; + } + channel->config->channel_opt_msg_delay = channel_opt_msg_delay; + ShowStatus("Done reading '"CL_WHITE"%u"CL_RESET"' channels in '"CL_WHITE"%s"CL_RESET"'.\n", db_size(channel->db), config_filename); } libconfig->destroy(&channels_conf); |