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); }
protected function closeSession($id) { $this->thread->pushThreadToMainPacket(chr(self::PACKET_CLOSE_SESSION) . Binary::writeInt($id)); }
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); } }