NAME
POE::Component::Server::IRC::OperServ - a fully event-driven networkable IRC server daemon module with an OperServ.
SYNOPSIS
# A fairly simple example:
use strict;
use warnings;
use POE qw(Component::Server::IRC::OperServ);
my %config = (
servername => 'simple.poco.server.irc',
nicklen => 15,
network => 'SimpleNET'
);
my $pocosi = POE::Component::Server::IRC::OperServ->spawn( config => \%config );
POE::Session->create(
package_states => [
'main' => [qw(_start _default)],
],
heap => { ircd => $pocosi },
);
$poe_kernel->run();
exit 0;
sub _start {
my ($kernel,$heap) = @_[KERNEL,HEAP];
$heap->{ircd}->yield( 'register' );
# Anyone connecting from the loopback gets spoofed hostname
$heap->{ircd}->add_auth( mask => '*@localhost', spoof => 'm33p.com', no_tilde => 1 );
# We have to add an auth as we have specified one above.
$heap->{ircd}->add_auth( mask => '*@*' );
# Start a listener on the 'standard' IRC port.
$heap->{ircd}->add_listener( port => 6667 );
# Add an operator who can connect from localhost
$heap->{ircd}->add_operator( { username => 'moo', password => 'fishdont' } );
undef;
}
sub _default {
my ( $event, $args ) = @_[ ARG0 .. $#_ ];
print STDOUT "$event: ";
foreach (@$args) {
SWITCH: {
if ( ref($_) eq 'ARRAY' ) {
print STDOUT "[", join ( ", ", @$_ ), "] ";
last SWITCH;
}
if ( ref($_) eq 'HASH' ) {
print STDOUT "{", join ( ", ", %$_ ), "} ";
last SWITCH;
}
print STDOUT "'$_' ";
}
}
print STDOUT "\n";
return 0; # Don't handle signals.
}
DESCRIPTION
POE::Component::Server::IRC::OperServ is subclass of POE::Component::Server::IRC which provides simple operator services.
The documentation is the same as for POE::Component::Server::IRC, consult that for usage.
OperServ
This subclass provides a server user called OperServ. OperServ accepts PRIVMSG commands from operators.
/msg OperServ <command> <parameters>
The following commands are accepted:
- clear CHANNEL
-
The OperServ will remove all channel modes on the indicated channel, including all users' +ov flags. The timestamp of the channel will be reset and the OperServ will join that channel with +o.
Whenever an operator joins a channel the OperServ will issue a server mode change to +o the operator on that channel.
AUTHOR
Chris 'BinGOs' Williams