Ejemplo n.º 1
0
    if ($intRoom == -1) {
        echo 'Target is offline', chr(10), die;
    }
    $objPenguin->joinRoom($intRoom);
});
$objPenguin->addListener('rp', function ($arrPacket) use($objPenguin, &$mixTarget) {
    $intPlayer = $arrPacket[3];
    unset($objPenguin->arrRoom[$intPlayer]);
    if ($intPlayer == $mixTarget) {
        $objPenguin->findBuddy($mixTarget);
    }
});
try {
    $objPenguin->login('Username', 'Password');
    $objPenguin->joinServer('Sleet');
} catch (ConnectionException $objException) {
    die;
}
if (!is_numeric($mixTarget)) {
    $objPenguin->getPlayerByName($mixTarget);
    while (!is_numeric($mixTarget)) {
        $objPenguin->recv();
    }
}
$objPenguin->findBuddy($mixTarget);
while (true) {
    $strData = $objPenguin->recv();
    if (XTParser::IsValid($strData)) {
        echo $strData, chr(10);
    }
}