1 # VoreTournament rcon2irc plugin by Merlijn Hofstra licensed under GPL - bans.pl
2 # Place this file inside the same directory as rcon2irc.pl and add the full filename to the plugins.
4 $store{plugin_bans}->{interval} = 60; #interval to displays bans
12 if ($store{plugin_bans}->{attempts}) {
13 foreach (sort keys %{ $store{plugin_bans}->{attempts} }) {
16 my @names = grep !$temp{$_}++, @{ $store{plugin_bans}->{names}->{$_} };
18 out irc => 0, "PRIVMSG $config{irc_channel} :\00305* banned client\017 \00304$_\017 was denied access \00304" .
19 $store{plugin_bans}->{attempts}->{$_} . "\017 times" .
20 (scalar(@names) ? ' with name(s): ' . join("\017, ", @names) : '');
22 $store{plugin_bans}->{attempts} = undef;
23 $store{plugin_bans}->{names} = undef;
25 schedule $timer => $store{plugin_bans}->{interval};;
30 # old style without names
31 [ dp => q{(?:\^\d)?NOTE:(?:\^\d)? banned client (\d+\.\d+\.\d+\.\d+) just tried to enter} => sub {
33 $store{plugin_bans}->{attempts}->{$ip} += 1;
37 # new style with names if known
38 [ dp => q{(?:\^\d)?NOTE:(?:\^\d)? banned client (\d+\.\d+\.\d+\.\d+) \((.*)\) just tried to enter} => sub {
40 $name = color_dp2irc $name;
41 $store{plugin_bans}->{attempts}->{$ip} += 1;
42 if ($name && $name ne 'unconnected') {
43 push @{ $store{plugin_bans}->{names}->{$ip} }, $name;
48 [ dp => q{(?:\^\d)?NOTE:(?:\^\d)? banned client (.*) has to go} => sub {
50 $name = color_dp2irc $name;
51 out irc => 0, "PRIVMSG $config{irc_channel} :\00305* banned client\017 $name\017 was removed from the server";