POE::Component::IRC::Service::P10

POE::Component::IRC::Service::P10 is a fully event-driven IRC services module for P10 compliant networks.
Download

POE::Component::IRC::Service::P10 Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Chris Williams
  • Publisher web site:
  • http://search.cpan.org/~bingos/

POE::Component::IRC::Service::P10 Tags


POE::Component::IRC::Service::P10 Description

POE::Component::IRC::Service::P10 is a fully event-driven IRC services module for P10 compliant networks. POE::Component::IRC::Service::P10 is a fully event-driven IRC services module for P10 compliant networks.SYNOPSIS use POE::Component::IRC::Service::P10; # Do this when you create your sessions. 'IRC-Service' is just a # kernel alias to christen the new IRC connection with. Second argument # must be a hash reference with your options. my (%hash) = { ServerNumeric => 3, ServerName => 'services.lamenet.org', ServerDesc => 'Services for LameNET', RemoteServer => 'hub.lamenet.org', ServerPort => 4400, Password => 'password', EventMode => 0 # Default is 1 Reconnect => 1 # Default is 0 Version => 'LameServ0.1a' # Defaults to module name and version }; my ($object) = POE::Component::IRC::Service::P10->new('IRC-Service', %hash ) or die "Oh noooo! $!"; # Do stuff like this from within your sessions. This line tells the # connection named "IRC-Service" to send your session the following # events when they happen. $kernel->post('IRC-Service', 'register', qw(connected msg public nick server)); # You can guess what this line does. $kernel->post('IRC-Service', 'connect'); # Add a services identity to the network $kernel->post('IRC-Service' => 'addnick', { NickName => 'Lame', Umode => '+odk', Description => 'Lame Services Bot', } ); # Determine if a user is an IRCop if ( $object->is_operator( $numeric ) ) { $kernel->post( 'IRC-Service' => privmsg => $botnumeric => $numeric => "Access granted." ); }POE::Component::IRC::Service::P10 is a POE component which acts as an easily controllable IRC Services server for your other POE components and sessions. You create an IRC Services component and tell it what events your session cares about and where to connect to, and it sends back interesting IRC events when they happen. You make the client do things by sending it events.The component implements the basic functionality of an IRC server and will track state changes ( such as new users, channels, etc. ) on the IRC network. To access this state the component returns an object when created and there are a hat-full of methods to query the state from your POE sessions. This also means that it is not necessary to use 'connect' to link to your uplink server before creating nicks and joining channels, as the component will track all these changes and during connection to the IRC network will "burst" in the necessary information. See the events section below for more information about this.In order to write a POE program with POE::Component::IRC::Service::P10: Create your session(s) and an alias for a new POE::Component::IRC::Service::P10 server. (Conceptually, it helps if you think of them as little IRC servers.) In your session's _start handler, send the IRC service a 'register' event to tell it which IRC events you want to receive from it. Send it a 'connect' event at some point to tell it to join the IRC network, and it should start sending you interesting events every once in a while. Use the 'addnick' event to add an IRC client to your "server". The IRC Service accepts two different sets of events, server and client. Server events are commands that are issued by (heh) the server and client events are commands issued by clients. # Example of a client command: $kernel->post( 'IRC-Service', 'join', 'ADAAA' , '#LameNET' ); # Example of a server command: $kernel->post( 'IRC-Service', 'opmode', '#LameNET', '+o', 'ADAAA' );Basically, client commands require a source nickname for the command, eg. it doesn't make sense for a server to "join" a channel.Requirements:· Perl Requirements: · Perl


POE::Component::IRC::Service::P10 Related Software