you can easily get the full message, listenFor() returns now an array with all data, in older versions it just returned the parsed message part (where the numbers are cut, due strange server response). With the current version you can receive the rawmessage which contains the full unparsed serverresponse, var_dump() the listenFor() result and you should see what I mean..
tell me if it works, thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
if (is_array($r_channel))
{
$channel = explode(' ', $r_channel[0]);
while (list($key,$val) = each ($r_channel))
{
echo "$key \t --> \t $val <br>\n";
}
echo "<B>On our IRC Channel #test are $count Users</B>";
}
else
{
echo "<B>An error occured, please check the specified server and settings<B>";
}
-----------------------------------------------
when I execute the script, the DEBUG_MESSAGEPARSER already cuts the first character:
-----------------------------------------------
DEBUG_IRCMESSAGES: received: ":irc.test.com 254 chatnick 1 :channels formed"
DEBUG_MESSAGEPARSER: ircdata nick: "" ident: "rc.test.co" host: "rc.test.com" type: "16384" from: "irc.test.com" channel: "" message: "channels formed"
DEBUG_MESSAGEHANDLER: no method found for "254" (event_rpl_luserchannels)
DEBUG_ACTIONHANDLER: actionhandler match found for id: 0 type: 16384 message: "channels formed" regex: "/.*/"
-----------------------------------------------
this is the output that I get:
0 --> There are 6 users and 5 invisible on 2 servers
1 --> IRC Operators online
2 --> channels formed
3 --> I have 3 clients and 0 servers
On our IRC Channel #test are Users
-----------------------------------------------
I've noticed, that everytime when the DEBUG_MESSAGEHANDLER says "no method found for ..." then the first character will be cut off
do I need to create my own messagehandlers to get rid of this problem?
it would be really great if someone could help me with this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-10-15
The CVS version is up to 0.76, you should probably try that one. (http://cvs.php.net/cvs.php/pear/Net_SmartIRC)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you are right, in revision 1.72 "- listenFor() now stores the whole parsed data packet instead of just the message." changed, and this fixes the problem of mediaslut,
so download SmartIRC from CVS (dont forget that you need all .php files also in the subdir SmartIRC/)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to get the result of a basic LUSERS query.
I'm getting the results with the command listenFor(SMARTIRC_TYPE_INFO);
but some characters are missing...
this is the result I'm getting:
There are 6 users and 9 invisible on 2 servers
IRC Operators online
channels formed
I have 7 clients and 0 servers
the integers for the operators (7) and channels (1) are missing - it should be:
There are 6 users and 9 invisible on 2 servers
7 IRC Operators online
1 channels formed
I have 7 clients and 0 servers
does anybody know why they do not show up?
this is a part from the debug code:
DEBUG_IRCMESSAGES: received: ":irc.test.com 254 chatnick 1 :channels formed"
DEBUG_MESSAGEPARSER: ircdata nick: "" ident: "rc.test.co" host: "rc.test.com" type: "16384" from: "irc.test.com" channel: "" message: "channels formed"
DEBUG_MESSAGEHANDLER: no method found for "254" (event_rpl_luserchannels)
DEBUG_ACTIONHANDLER: actionhandler match found for id: 0 type: 16384 message: "channels formed" regex: "/.*/"
any help appreciated!
ok, I think I now why the first character cut off... I'm using the bahamut chatserver which is based on rfc1459 - but smartIRC is based on rfc2812.
so, I would probably have to change my chatserver software or modify the smarIRC source to make everything work...
my question is now, does anybody else uses the bahamut chatserver? if yes, did you experience any similar problems? how did you solve it?
you can easily get the full message, listenFor() returns now an array with all data, in older versions it just returned the parsed message part (where the numbers are cut, due strange server response). With the current version you can receive the rawmessage which contains the full unparsed serverresponse, var_dump() the listenFor() result and you should see what I mean..
tell me if it works, thanks.
thanks for your reply :)
Actually, I'm already using the function listenFor()
and I'm using the SmartIRC version v0.5.5
this is how the code looks like:
-----------------------------------------------
include_once('../SmartIRC.php');
$irc = &new Net_SmartIRC();
$irc->startBenchmark();
$irc->setDebug(SMARTIRC_DEBUG_ALL);
$irc->setBenchmark(TRUE);
$irc->connect('irc.shoe.org', 6667);
$irc->login('testuser22', 'Tester Client '.SMARTIRC_VERSION.' (example2.php)', 0, 'Net_SmartIRC');
$irc->getUsers();
$r_channel = $irc->listenFor(SMARTIRC_TYPE_INFO);
$irc->disconnect();
$irc->stopBenchmark();
if (is_array($r_channel))
{
$channel = explode(' ', $r_channel[0]);
while (list($key,$val) = each ($r_channel))
{
echo "$key \t --> \t $val <br>\n";
}
echo "<B>On our IRC Channel #test are $count Users</B>";
}
else
{
echo "<B>An error occured, please check the specified server and settings<B>";
}
-----------------------------------------------
when I execute the script, the DEBUG_MESSAGEPARSER already cuts the first character:
-----------------------------------------------
DEBUG_IRCMESSAGES: received: ":irc.test.com 254 chatnick 1 :channels formed"
DEBUG_MESSAGEPARSER: ircdata nick: "" ident: "rc.test.co" host: "rc.test.com" type: "16384" from: "irc.test.com" channel: "" message: "channels formed"
DEBUG_MESSAGEHANDLER: no method found for "254" (event_rpl_luserchannels)
DEBUG_ACTIONHANDLER: actionhandler match found for id: 0 type: 16384 message: "channels formed" regex: "/.*/"
-----------------------------------------------
this is the output that I get:
0 --> There are 6 users and 5 invisible on 2 servers
1 --> IRC Operators online
2 --> channels formed
3 --> I have 3 clients and 0 servers
On our IRC Channel #test are Users
-----------------------------------------------
I've noticed, that everytime when the DEBUG_MESSAGEHANDLER says "no method found for ..." then the first character will be cut off
do I need to create my own messagehandlers to get rid of this problem?
it would be really great if someone could help me with this.
The CVS version is up to 0.76, you should probably try that one. (http://cvs.php.net/cvs.php/pear/Net_SmartIRC)
you are right, in revision 1.72 "- listenFor() now stores the whole parsed data packet instead of just the message." changed, and this fixes the problem of mediaslut,
so download SmartIRC from CVS (dont forget that you need all .php files also in the subdir SmartIRC/)
THANK YOU, THANK YOU, THANK YOU ALL!!!! you definitively made my day happier :-)
it works :-)))))