Exemple #1
0
function sendGroupMessage()
{
    // send a normal group message
    $textGroupMessage = new TextGroupChatPacket();
    $textGroupMessage->setFrom(G::$uid);
    $textGroupMessage->setGroupId(G::$groupId);
    $textGroupMessage->setSendToAll();
    $textGroupMessage->setText('everybody is ok?[ID:' . rand(1000, 9999) . ']');
    G::$client->send(serializePacket($textGroupMessage));
    // send to friend
    $textGroupMessage = new TextGroupChatPacket();
    $textGroupMessage->setFrom(G::$uid);
    $textGroupMessage->setGroupId(G::$groupId);
    $textGroupMessage->setTo(G::$friendId);
    $textGroupMessage->setText('is ok, friend?[ID:' . rand(1000, 9999) . ']');
    G::$client->send(serializePacket($textGroupMessage));
}
Exemple #2
0
 public function sendGroupMessage()
 {
     // send a normal group message
     $textGroupMessage = new TextGroupChatPacket();
     $textGroupMessage->setFrom($this->userId);
     $textGroupMessage->setGroupId(Gbl::getRandomUserId());
     $textGroupMessage->setSendToAll();
     $textGroupMessage->setText('everybody is ok?汉字[ID:' . rand(1000, 9999) . ']');
     $this->send($this->serializePacket($textGroupMessage));
     // send to friend
     $textGroupMessage = new TextGroupChatPacket();
     $textGroupMessage->setFrom($this->userId);
     $textGroupMessage->setGroupId($this->groupId);
     $textGroupMessage->setTo(Gbl::getRandomUserId());
     $textGroupMessage->setText('is ok, friend?表情[ID:' . rand(1000, 9999) . ']');
     $this->send($this->serializePacket($textGroupMessage));
 }