本文整理汇总了PHP中raklib\protocol\Packet::encode方法的典型用法代码示例。如果您正苦于以下问题:PHP Packet::encode方法的具体用法?PHP Packet::encode怎么用?PHP Packet::encode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类raklib\protocol\Packet
的用法示例。
在下文中一共展示了Packet::encode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: encode
public function encode()
{
parent::encode();
$this->buffer .= Binary::writeLong($this->clientID);
$this->buffer .= Binary::writeLong($this->session);
$this->buffer .= "";
}
示例2: encode
public function encode()
{
parent::encode();
$this->buffer .= RakLib::MAGIC;
$this->buffer .= chr($this->protocol);
$this->buffer .= str_repeat(chr(0x0), $this->mtuSize - 18);
}
示例3: encode
public function encode()
{
parent::encode();
$this->buffer .= \pack("NN", $this->clientID >> 32, $this->clientID & 0xffffffff);
$this->buffer .= \pack("NN", $this->sendPing >> 32, $this->sendPing & 0xffffffff);
$this->buffer .= \chr($this->useSecurity ? 1 : 0);
}
示例4: encode
public function encode()
{
parent::encode();
$this->put(RakLib::MAGIC);
$this->putByte($this->protocol);
$this->put(str_repeat(chr(0x0), $this->mtuSize - 18));
}
示例5: encode
public function encode()
{
parent::encode();
$this->buffer .= Binary::writeLong($this->clientID);
$this->buffer .= Binary::writeLong($this->sendPing);
$this->buffer .= \chr($this->useSecurity ? 1 : 0);
}
示例6: encode
public function encode()
{
parent::encode();
$this->buffer .= \substr(\pack("V", $this->seqNumber), 0, -1);
foreach ($this->packets as $packet) {
$this->buffer .= $packet instanceof EncapsulatedPacket ? $packet->toBinary() : (string) $packet;
}
}
示例7: encode
public function encode()
{
parent::encode();
$this->buffer .= RakLib::MAGIC;
$this->putAddress($this->serverAddress, $this->serverPort, 4);
$this->buffer .= \pack("n", $this->mtuSize);
$this->buffer .= \pack("NN", $this->clientID >> 32, $this->clientID & 0xffffffff);
}
示例8: encode
public function encode()
{
parent::encode();
$this->buffer .= \pack("NN", $this->pingID >> 32, $this->pingID & 4294967295.0);
$this->buffer .= \pack("NN", $this->serverID >> 32, $this->serverID & 4294967295.0);
$this->buffer .= RakLib::MAGIC;
$this->putString($this->serverName);
}
示例9: encode
public function encode()
{
parent::encode();
$this->putLong($this->pingID);
$this->putLong($this->serverID);
$this->put(RakLib::MAGIC);
$this->putString($this->serverName);
}
示例10: encode
public function encode()
{
parent::encode();
$this->put(RakLib::MAGIC);
$this->putAddress($this->serverAddress, $this->serverPort, 4);
$this->putShort($this->mtuSize);
$this->putLong($this->clientID);
}
示例11: encode
public function encode()
{
parent::encode();
$this->buffer .= RakLib::MAGIC;
$this->putAddress($this->serverAddress, $this->serverPort, 4);
$this->buffer .= \pack("n", $this->mtuSize);
$this->buffer .= Binary::writeLong($this->clientID);
}
示例12: encode
public function encode()
{
parent::encode();
$this->buffer .= Binary::writeLong($this->pingID);
$this->buffer .= Binary::writeLong($this->serverID);
$this->buffer .= RakLib::MAGIC;
$this->putString($this->serverName);
}
示例13: encode
public function encode()
{
parent::encode();
$this->put(RakLib::MAGIC);
$this->putLong($this->serverID);
$this->putByte(0);
//Server security
$this->putShort($this->mtuSize);
}
示例14: encode
public function encode()
{
parent::encode();
$this->buffer .= RakLib::MAGIC;
$this->buffer .= \pack("NN", $this->serverID >> 32, $this->serverID & 0xffffffff);
$this->buffer .= \chr(0);
//Server security
$this->buffer .= \pack("n", $this->mtuSize);
}
示例15: encode
public function encode()
{
parent::encode();
$this->buffer .= RakLib::MAGIC;
$this->buffer .= Binary::writeLong($this->serverID);
$this->buffer .= \chr(0);
//Server security
$this->buffer .= \pack("n", $this->mtuSize);
}