示例#1
0
文件: client.php 项目: lscgzwd/jegarn
function sendChatPacket()
{
    // send friend a hello message
    $textMessage = new TextChatPacket();
    $textMessage->setFrom(G::$uid);
    $textMessage->setTo(G::$friendId);
    $textMessage->setText('hello, how are you?[ID:' . rand(1000, 9999) . ']');
    G::$client->send(serializePacket($textMessage));
}
示例#2
0
 public function sendChatPacket()
 {
     // send friend a hello message
     $textMessage = new TextChatPacket();
     $textMessage->setFrom($this->userId);
     $textMessage->setTo(Gbl::getRandomUserId());
     $textMessage->setText('hello, how are you?中文[ID:' . rand(1000, 9999) . ']');
     $this->send($this->serializePacket($textMessage));
 }