def stream_open(self, session): buffer = b"" address = session.get_address() identifier = address.to_string() buffer += chr(PyRakLib.PACKET_OPEN_SESSION) buffer += chr(len(identifier)) buffer += identifier buffer += chr(len(address.ip)) buffer += Binary.write_short(address.port) buffer += Binary.write_long(session.get_id()) self.server.push_thread_to_main_packet(buffer)
def put_long(self, v: int): self.buffer += Binary.write_long(v)