]> icculus.org git repositories - divverent/nexuiz.git/blob - server/rcon2irc/bans.pl
echo-rcon.pl now allows multiple instances of rcon2irc on the same server, bans.pl...
[divverent/nexuiz.git] / server / rcon2irc / bans.pl
1 # Nexuiz 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.
3
4 $store{plugin_bans}->{interval} = 300; #interval to displays bans
5
6 sub out ($$@);
7 sub schedule($$);
8
9 schedule sub {
10         my ($timer) = @_;
11         if ($store{plugin_bans}->{attempts}) {
12                 foreach (sort keys %{ $store{plugin_bans}->{attempts} }) {
13                         out irc => 0, "PRIVMSG $config{irc_channel} :\00305* banned client\017 \00304$_\017 was refused to connect \00304" .
14                                 $store{plugin_bans}->{attempts}->{$_} . "\017 times";
15                 }
16                 $store{plugin_bans}->{attempts} = undef;
17         }
18         schedule $timer => $store{plugin_bans}->{interval};;
19 } => 1;
20
21 [ dp => q{(?:\^\d)?NOTE:(?:\^\d)? banned client (\d+\.\d+\.\d+\.\d+) just tried to enter} => sub {
22         my ($ip) = @_;
23         $store{plugin_bans}->{attempts}->{$ip} += 1;
24         return 0;
25 } ],
26
27 [ dp => q{(?:\^\d)?NOTE:(?:\^\d)? banned client (.*) has to go} => sub {
28         my ($name) = @_;
29         $name = color_dp2irc $name;
30         out irc => 0, "PRIVMSG $config{irc_channel} :\00305* banned client\017 $name\017 was removed from the server";
31         return 0;
32 } ],