當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Packet::encode方法代碼示例

本文整理匯總了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 .= "";
 }
開發者ID:Hydreon,項目名稱:PMSoft238,代碼行數:7,代碼來源:CLIENT_CONNECT_DataPacket.php

示例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);
 }
開發者ID:orlando092,項目名稱:ImagicalMine,代碼行數:7,代碼來源:OPEN_CONNECTION_REQUEST_1.php

示例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);
 }
開發者ID:xpyctum,項目名稱:PocketMinePlusPlus,代碼行數:7,代碼來源:CLIENT_CONNECT_DataPacket__64bit.php

示例4: encode

 public function encode()
 {
     parent::encode();
     $this->put(RakLib::MAGIC);
     $this->putByte($this->protocol);
     $this->put(str_repeat(chr(0x0), $this->mtuSize - 18));
 }
開發者ID:NewDelion,項目名稱:PocketMine-0.13.x,代碼行數:7,代碼來源:OPEN_CONNECTION_REQUEST_1.php

示例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);
 }
開發者ID:xpyctum,項目名稱:PocketMinePlusPlus,代碼行數:7,代碼來源:CLIENT_CONNECT_DataPacket__32bit.php

示例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;
     }
 }
開發者ID:TylerAndrew,項目名稱:Steadfast2,代碼行數:8,代碼來源:DataPacket.php

示例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);
 }
開發者ID:xpyctum,項目名稱:PocketMinePlusPlus,代碼行數:8,代碼來源:OPEN_CONNECTION_REQUEST_2__64bit.php

示例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);
 }
開發者ID:ken77731,項目名稱:PocketMine-0.13.0,代碼行數:8,代碼來源:UNCONNECTED_PONG__64bit.php

示例9: encode

 public function encode()
 {
     parent::encode();
     $this->putLong($this->pingID);
     $this->putLong($this->serverID);
     $this->put(RakLib::MAGIC);
     $this->putString($this->serverName);
 }
開發者ID:NewDelion,項目名稱:PocketMine-0.13.x,代碼行數:8,代碼來源:UNCONNECTED_PONG.php

示例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);
 }
開發者ID:ClearSkyTeam,項目名稱:ClearSky,代碼行數:8,代碼來源:OPEN_CONNECTION_REQUEST_2.php

示例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);
 }
開發者ID:kakichi,項目名稱:ClearSky,代碼行數:8,代碼來源:OPEN_CONNECTION_REQUEST_2.php

示例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);
 }
開發者ID:kakichi,項目名稱:ClearSky,代碼行數:8,代碼來源:UNCONNECTED_PONG.php

示例13: encode

 public function encode()
 {
     parent::encode();
     $this->put(RakLib::MAGIC);
     $this->putLong($this->serverID);
     $this->putByte(0);
     //Server security
     $this->putShort($this->mtuSize);
 }
開發者ID:iTXTech,項目名稱:Genisys,代碼行數:9,代碼來源:OPEN_CONNECTION_REPLY_1.php

示例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);
 }
開發者ID:xpyctum,項目名稱:PocketMinePlusPlus,代碼行數:9,代碼來源:OPEN_CONNECTION_REPLY_1__64bit.php

示例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);
 }
開發者ID:TylerAndrew,項目名稱:Steadfast2,代碼行數:9,代碼來源:OPEN_CONNECTION_REPLY_1.php


注:本文中的raklib\protocol\Packet::encode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。