Exemple #1
0
    def handle(world_session, socket, reader):
        if len(reader.data) >= 4:  # Avoid handling empty item query packet.
            entry = unpack('<I', reader.data[:4])[0]
            if entry > 0:
                item_template = WorldDatabaseManager.ItemTemplateHolder.item_template_get_by_entry(
                    entry)
                if item_template:
                    item_mgr = ItemManager(item_template=item_template)
                    world_session.enqueue_packet(item_mgr.query_details())

        return 0
Exemple #2
0
    def _gen_item_struct(self, item_entry, count):
        item_template = WorldDatabaseManager.ItemTemplateHolder.item_template_get_by_entry(
            item_entry)
        display_id = 0
        if item_template:
            item_mgr = ItemManager(item_template=item_template)
            self.player_mgr.enqueue_packet(item_mgr.query_details())
            display_id = item_template.display_id

        item_data = pack('<3I', item_entry, count, display_id)

        return item_data