public function encode()
 {
     parent::encode();
     $this->putLong($this->clientID);
     $this->putLong($this->sendPing);
     $this->putByte($this->useSecurity ? 1 : 0);
 }
 public function encode()
 {
     parent::encode();
     $this->putLong($this->clientID);
     $this->putLong($this->session);
     $this->put("");
 }
Exemplo n.º 3
0
 public function encode()
 {
     parent::encode();
     $this->putLTriad($this->seqNumber);
     foreach ($this->packets as $packet) {
         $this->put($packet instanceof EncapsulatedPacket ? $packet->toBinary() : (string) $packet);
     }
 }
Exemplo n.º 4
0
 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;
     }
 }
 public function encode()
 {
     parent::encode();
     $this->putAddress($this->address, $this->port, 4);
     $this->putShort(0);
     for ($i = 0; $i < 10; ++$i) {
         $this->putAddress($this->systemAddresses[$i][0], $this->systemAddresses[$i][1], $this->systemAddresses[$i][2]);
     }
     $this->putLong($this->sendPing);
     $this->putLong($this->sendPong);
 }
 public function encode()
 {
     parent::encode();
     $this->put("?Wþ");
     //cookie
     $this->put("Í");
     //security flags
     $this->putShort($this->port);
     $this->putDataArray(["õÿÿõ", "ÿÿÿÿ", "ÿÿÿÿ", "ÿÿÿÿ", "ÿÿÿÿ", "ÿÿÿÿ", "ÿÿÿÿ", "ÿÿÿÿ", "ÿÿÿÿ", "ÿÿÿÿ"]);
     $this->put("");
     $this->putLong($this->session);
     $this->putLong($this->session2);
 }
 public function encode()
 {
     parent::encode();
     $payload = "";
     sort($this->packets, SORT_NUMERIC);
     $count = count($this->packets);
     $records = 0;
     if ($count > 0) {
         $pointer = 1;
         $start = $this->packets[0];
         $last = $this->packets[0];
         while ($pointer < $count) {
             $current = $this->packets[$pointer++];
             $diff = $current - $last;
             if ($diff === 1) {
                 $last = $current;
             } elseif ($diff > 1) {
                 //Forget about duplicated packets (bad queues?)
                 if ($start === $last) {
                     $payload .= "";
                     $payload .= substr(pack("V", $start), 0, -1);
                     $start = $last = $current;
                 } else {
                     $payload .= "";
                     $payload .= substr(pack("V", $start), 0, -1);
                     $payload .= substr(pack("V", $last), 0, -1);
                     $start = $last = $current;
                 }
                 ++$records;
             }
         }
         if ($start === $last) {
             $payload .= "";
             $payload .= substr(pack("V", $start), 0, -1);
         } else {
             $payload .= "";
             $payload .= substr(pack("V", $start), 0, -1);
             $payload .= substr(pack("V", $last), 0, -1);
         }
         ++$records;
     }
     $this->buffer .= pack("n", $records);
     $this->buffer .= $payload;
 }
 public function encode()
 {
     parent::encode();
 }
Exemplo n.º 9
0
 public function encode()
 {
     parent::encode();
     $this->putLong($this->pingID);
 }