def __init__(self, packet: HPacket): self.flat_id, self.room_name, self.owner_id, self.owner_name, door_mode_id, self.user_count,\ self.max_user_count, self.description, self.trade_mode, self.score, self.ranking, self.category_id\ = packet.read('isisiiisiiii') self.door_mode = HDoorMode(door_mode_id) self.tags = [ packet.read_string() for _ in range(packet.read_int()) ] multiUse = packet.read_int() if (multiUse & 1) > 0: self.official_room_pic_ref = packet.read_string() if (multiUse & 2) > 0: self.group_id, self.group_name, self.group_badge_code = packet.read( 'iss') if (multiUse & 4) > 0: self.room_ad_name, self.room_ad_description, self.room_ad_expires_in_min = packet.read( 'ssi') self.show_owner = (multiUse & 8) > 0 self.allow_pets = (multiUse & 16) > 0 self.display_room_entry_ad = (multiUse & 32) > 0
def __init__(self, packet: HPacket): self.id, self.name, self.motto, self.figure_id, self.index, x, y, z, facing_id, entity_type_id = \ packet.read('isssiiisii') self.tile = HPoint(x, y, float(z)) self.headFacing = HDirection(facing_id) self.bodyFacing = HDirection(facing_id) self.entity_type = HEntityType(entity_type_id) self.stuff = [] if self.entity_type == HEntityType.HABBO: self.gender = packet.read_string() self.stuff.extend(packet.read('ii')) self.favorite_group = packet.read_string() self.stuff.extend(packet.read('siB')) elif self.entity_type == HEntityType.PET: self.stuff.extend(packet.read('iisiBBBBBBis')) elif self.entity_type == HEntityType.BOT: self.stuff.extend(packet.read('sis')) self.stuff.append( [packet.read_short() for _ in range(packet.read_int())])