コード例 #1
0
ファイル: Packet.php プロジェクト: iPocketTeam/BigBrother
 protected function putPosition($x, $y, $z)
 {
     $int2 = $z & 0x3ffffff;
     //26 bits
     $int2 |= ($y & 0x3f) << 26;
     //6 bits
     $int1 = ($y & 0xfc0) >> 6;
     //6 bits
     $int1 |= ($x & 0x3ffffff) << 6;
     //26 bits
     $this->buffer .= Binary::writeInt($int1) . Binary::writeInt($int2);
 }
コード例 #2
0
ファイル: ServerManager.php プロジェクト: MrGenga/BigBrother
 protected function closeSession($id)
 {
     $this->thread->pushThreadToMainPacket(chr(self::PACKET_CLOSE_SESSION) . Binary::writeInt($id));
 }
コード例 #3
0
 public function enableEncryption(DesktopPlayer $player, $secret)
 {
     if (isset($this->sessions[$player])) {
         $target = $this->sessions[$player];
         $data = chr(ServerManager::PACKET_ENABLE_ENCRYPTION) . Binary::writeInt($target) . $secret;
         $this->thread->pushMainToThreadPacket($data);
     }
 }