public function readString() { $len = HabboEncoding::decodeByte16($this->packet); $string = substr($this->packet, 2, $len); $this->pop($len + 2); return $string; }
public function bufferParser($buffer) { $packets = array(); while (strlen($buffer) > 3) { $len = HabboEncoding::decodeByte32($buffer) + 4; $packets[] = substr($buffer, 0, $len); $buffer = substr($buffer, $len); } return $packets; }
public function get() { return HabboEncoding::encodeByte32(strlen($this->packet) + 2) . HabboEncoding::encodeByte16($this->header) . $this->packet; }