ircbot/Testcode/Client/ClientManagerTest.php
2010-11-28 02:45:25 +00:00

40 lines
1.1 KiB
PHP

<?php
$clientManager = new Client_ClientManager();
$clientManager->registerProtocol("irc", "Irc");
$clientManager->registerProtocol("jpt", "Bot");
$freenode = $clientManager->createTcpConnection("freenode", "irc");
$clientManager->attachConfig(array(
"nick" => "Testinstanz",
"userident" => "uzuguck",
"channels" => array("#mstasty")
), $freenode);
$freenode->connect("irc.freenode.net", 6667);
$freenode = $clientManager->createTcpConnection("freenode", "irc");
$clientManager->attachConfig(array(
"nick" => "Testinstanz2",
"userident" => "uzuguck",
"channels" => array("#mstasty")
), $freenode);
$freenode->connect("irc.freenode.net", 6667);
/*$config_eloxoph = array(
"nick" => "Frischmilch",
"userident" => "olefolol",
"channels" => array("#eloxoph")
);
$eloxoph = $clientManager->createTcpConnection("eloxoph", "irc");
$clientManager->attachConfig($config_eloxoph, $eloxoph);
$eloxoph->connect("irc.eloxoph.com", 6667);*/
$srv = $clientManager->createTcpConnection("srv", "jpt");
$srv->bind("localhost", 7777);
$srv->listen();
while($clientManager->countConnections() > 0) {
$clientManager->work();
}
?>