For Programmers: Free Programming Magazines  


Home > Archive > PERL POE > January 2007 > Newbie Question about P::C::S::IRC









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Newbie Question about P::C::S::IRC
Guillaume Arcas

2007-01-04, 7:23 pm

Hi (and happy new year).

I'am trying to get familiar with POE programming for a few days now but still am
sometimes - not to say: totally lost.

I picked the POE::Component::Server::IRC "fairly simple example" code.

All's fine, OK, I got my IRC server running.

What I want now is to be able to kick user as they join some channels from this
program.

I am a bit about the daemon_cmd_kick and daemon_server_kick events and
how to "send" its to the main process.

I'm not sure where to place my "kick" order. I tried in sub _default with a
$poe_kernel->post() but, well, without success.

Does anyone have a example of that kind of call ?

Regards,

Guillaume Arcas - [http://yom.retiaire.org]
-----------------------------------------------------------
"Je cherche un ailleurs, mais pas trop loin d'ici." (Sempé)
Kidney Bingos

2007-01-06, 4:24 am

On Thu, Jan 04, 2007 at 06:51:55PM +0100, Guillaume Arcas wrote:
> Hi (and happy new year).


Hello.

> All's fine, OK, I got my IRC server running.
>
> What I want now is to be able to kick user as they join some channels from this
> program.
>
> I am a bit about the daemon_cmd_kick and daemon_server_kick events and
> how to "send" its to the main process.


The 'daemon_server_*' commands are actually methods that are applied to the
POE::Component::Server::IRC object.

The 'daemon_cmd_*' commands are events, but they require a 'spoofed nickname', ie. an
IRC service, to work with, which must be created first.

> I'm not sure where to place my "kick" order. I tried in sub _default witha
> $poe_kernel->post() but, well, without success.


In the examples/ folder of the PCSI distribution is a script called test-harness.pl
This has examples of the use of both 'daemon_server_*' methods and 'daemon_cmd_*' events.

Cheers,

--
Chris Williams
aka BinGOs
PGP ID 0x4658671F
http://www.gumbynet.org.uk
==========================

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com