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


PHP Packet::decode方法代碼示例

本文整理匯總了PHP中raklib\protocol\Packet::decode方法的典型用法代碼示例。如果您正苦於以下問題:PHP Packet::decode方法的具體用法?PHP Packet::decode怎麽用?PHP Packet::decode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在raklib\protocol\Packet的用法示例。


在下文中一共展示了Packet::decode方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: decode

 public function decode()
 {
     parent::decode();
     $this->clientID = Binary::readLong($this->get(8));
     $this->session = Binary::readLong($this->get(8));
     $this->unknown = $this->get(1);
 }
開發者ID:Hydreon,項目名稱:PMSoft238,代碼行數:7,代碼來源:CLIENT_CONNECT_DataPacket.php

示例2: decode

 public function decode()
 {
     parent::decode();
     $this->clientID = Binary::readLong($this->get(8));
     $this->sendPing = Binary::readLong($this->get(8));
     $this->useSecurity = \ord($this->get(1)) > 0;
 }
開發者ID:xpyctum,項目名稱:PocketMinePlusPlus,代碼行數:7,代碼來源:CLIENT_CONNECT_DataPacket__32bit.php

示例3: decode

 public function decode()
 {
     parent::decode();
     $this->offset += 16;
     //Magic
     $this->protocol = $this->getByte();
     $this->mtuSize = strlen($this->get(true)) + 18;
 }
開發者ID:NewDelion,項目名稱:PocketMine-0.13.x,代碼行數:8,代碼來源:OPEN_CONNECTION_REQUEST_1.php

示例4: decode

 public function decode()
 {
     parent::decode();
     $this->offset += 16;
     //Magic
     $this->protocol = \ord($this->get(1));
     $this->mtuSize = \strlen($this->get(\true)) + 18;
 }
開發者ID:kakichi,項目名稱:ClearSky,代碼行數:8,代碼來源:OPEN_CONNECTION_REQUEST_1.php

示例5: decode

 public function decode()
 {
     parent::decode();
     $this->pingID = Binary::readLong($this->get(8));
     $this->serverID = Binary::readLong($this->get(8));
     $this->offset += 16;
     //magic
     $this->serverName = $this->getString();
 }
開發者ID:kakichi,項目名稱:ClearSky,代碼行數:9,代碼來源:UNCONNECTED_PONG.php

示例6: decode

 public function decode()
 {
     parent::decode();
     $this->offset += 16;
     //Magic
     $this->getAddress($this->serverAddress, $this->serverPort);
     $this->mtuSize = $this->getShort();
     $this->clientID = $this->getLong();
 }
開發者ID:ClearSkyTeam,項目名稱:ClearSky,代碼行數:9,代碼來源:OPEN_CONNECTION_REQUEST_2.php

示例7: decode

 public function decode()
 {
     parent::decode();
     $this->offset += 16;
     //Magic
     $this->getAddress($this->serverAddress, $this->serverPort);
     $this->mtuSize = \unpack("n", $this->get(2))[1];
     $this->clientID = Binary::readLong($this->get(8));
 }
開發者ID:xpyctum,項目名稱:PocketMinePlusPlus,代碼行數:9,代碼來源:OPEN_CONNECTION_REQUEST_2__64bit.php

示例8: decode

 public function decode()
 {
     parent::decode();
     $this->pingID = $this->getLong();
     $this->serverID = $this->getLong();
     $this->offset += 16;
     //magic
     $this->serverName = $this->getString();
 }
開發者ID:NewDelion,項目名稱:PocketMine-0.13.x,代碼行數:9,代碼來源:UNCONNECTED_PONG.php

示例9: decode

 public function decode()
 {
     parent::decode();
     $this->offset += 16;
     //Magic
     $this->serverID = Binary::readLong($this->get(8));
     \ord($this->get(1));
     //security
     $this->mtuSize = \unpack("n", $this->get(2))[1];
 }
開發者ID:TylerAndrew,項目名稱:Steadfast2,代碼行數:10,代碼來源:OPEN_CONNECTION_REPLY_1.php

示例10: decode

 public function decode()
 {
     parent::decode();
     $this->offset += 16;
     //Magic
     $this->serverID = $this->getLong();
     $this->clientPort = $this->getShort();
     $this->mtuSize = $this->getShort();
     //server security
 }
開發者ID:hlogeon,項目名稱:PocketMineJs-MP,代碼行數:10,代碼來源:OPEN_CONNECTION_REPLY_2.php

示例11: decode

 public function decode()
 {
     parent::decode();
     $this->offset += 16;
     //Magic
     $this->serverID = Binary::readLong($this->get(8));
     $this->clientPort = unpack("n", $this->get(2))[1];
     $this->mtuSize = unpack("n", $this->get(2))[1];
     //server security
 }
開發者ID:Hydreon,項目名稱:PMSoft238,代碼行數:10,代碼來源:OPEN_CONNECTION_REPLY_2.php

示例12: decode

 public function decode()
 {
     parent::decode();
     $this->getAddress($this->address, $this->port);
     for ($i = 0; $i < 10; ++$i) {
         $this->getAddress($addr, $port, $version);
         $this->systemAddresses[$i] = [$addr, $port, $version];
     }
     $this->sendPing = Binary::readLong($this->get(8));
     $this->sendPong = Binary::readLong($this->get(8));
 }
開發者ID:TylerAndrew,項目名稱:Steadfast2,代碼行數:11,代碼來源:CLIENT_HANDSHAKE_DataPacket.php

示例13: decode

 public function decode()
 {
     parent::decode();
     $this->cookie = $this->get(4);
     $this->security = $this->get(1);
     $this->port = unpack("n", $this->get(2))[1];
     $this->dataArray0 = $this->get(ord($this->get(1)));
     $this->dataArray = $this->getDataArray(9);
     $this->timestamp = $this->get(2);
     $this->session2 = Binary::readLong($this->get(8));
     $this->session = Binary::readLong($this->get(8));
 }
開發者ID:Hydreon,項目名稱:PMSoft238,代碼行數:12,代碼來源:CLIENT_HANDSHAKE_DataPacket.php

示例14: decode

 public function decode()
 {
     parent::decode();
     $this->seqNumber = unpack("V", $this->get(3) . "")[1];
     while (!$this->feof()) {
         $offset = 0;
         $packet = EncapsulatedPacket::fromBinary(substr($this->buffer, $this->offset), false, $offset);
         $this->offset += $offset;
         if (strlen($packet->buffer) === 0) {
             break;
         }
         $this->packets[] = $packet;
     }
 }
開發者ID:Hydreon,項目名稱:PMSoft238,代碼行數:14,代碼來源:DataPacket.php

示例15: decode

 public function decode()
 {
     parent::decode();
     $count = $this->getShort();
     $this->packets = [];
     $cnt = 0;
     for ($i = 0; $i < $count and !$this->feof() and $cnt < 4096; ++$i) {
         if ($this->getByte() === 0) {
             $start = $this->getLTriad();
             $end = $this->getLTriad();
             if ($end - $start > 512) {
                 $end = $start + 512;
             }
             for ($c = $start; $c <= $end; ++$c) {
                 $this->packets[$cnt++] = $c;
             }
         } else {
             $this->packets[$cnt++] = $this->getLTriad();
         }
     }
 }
開發者ID:iTXTech,項目名稱:Genisys,代碼行數:21,代碼來源:AcknowledgePacket.php


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