[Phpfreechat-svn] SF.net SVN: phpfreechat: [689] trunk/demo/demo27_customized_command.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-08-22 13:46:28
|
Revision: 689 Author: kerphi Date: 2006-08-22 06:46:23 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=689&view=rev Log Message: ----------- Fix customized command demo for the new 1.x api Modified Paths: -------------- trunk/demo/demo27_customized_command.php Modified: trunk/demo/demo27_customized_command.php =================================================================== --- trunk/demo/demo27_customized_command.php 2006-08-22 13:40:44 UTC (rev 688) +++ trunk/demo/demo27_customized_command.php 2006-08-22 13:46:23 UTC (rev 689) @@ -5,13 +5,19 @@ require_once dirname(__FILE__)."/../src/pfccommand.class.php"; class pfcCommand_roll extends pfcCommand { - function run(&$xml_reponse, $clientid, $msg) + function run(&$xml_reponse, $p) { + $clientid = $p["clientid"]; + $param = $p["param"]; + $sender = $p["sender"]; + $recipient = $p["recipient"]; + $recipientid = $p["recipientid"]; + $c =& $this->c; $nick = $c->nick; $container =& $c->getContainerInstance(); - $text = trim($msg); + $text = trim($param); // Call parse roll require_once dirname(__FILE__).'/demo27_dice.class.php'; @@ -19,13 +25,15 @@ if (!$dice->check($text)) { $result = $dice->error_get(); + $cmdp = $p; + $cmdp["param"] = "Cmd_roll failed: " . $result; $cmd =& pfcCommand::Factory("error", $c); - $cmd->run($xml_reponse, $clientid, "Cmd_roll failed: " . $result); + $cmd->run($xml_reponse, $cmdp); } else { $result = $dice->roll(); - $container->writeMsg($nick, $result); + $container->write($recipient, $nick, "send", $result); } if ($c->debug) pxlog("Cmd_roll[".$c->sessionid."]: msg=".$result, "chat", $c->getId()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |