Jump to content

SMSG_CHAR_ENUM returns error


/dev/not/null

Recommended Posts

I'm trying to send SMSG_CHAR_ENUM packet (example below):

1. Character data

data = pack(
            '<Q{name_len}s3B5BB2I3f2IB3IIBI'.format(name_len = len(name_bytes)),
            1,               # guid
            name_bytes,	     # 'Name' + '\x00'
            4,               # race
            11,              # class id
            0,               # gender
            0,               # skin
            0,               # face
            0,               # hair style
            0,               # hair color
            0,               # facial hair
            61,              # level
            141,             # zone id
            1,               # map id
            10322.1,         # x
            825.436,         # y
            1326.37,         # z
            0,               # guild
            0,               # char flags ?
            0,               # first login
            0,               # pet display id
            0,               # pet level
            0,               # pet family
            0,               # first bag inventory id
            0,               # first bag inventory type
            0                # enchant ?
        )

2. Full packet:

packet = pack('<B', num_chars) + data

But client returns 'Error retrieving character list'. What am I doing wrong ?

Link to comment
Share on other sites

4 hours ago, Talendrys said:

Yes, I did. Character data has little endian. When I sending empty SMSG_CHAR_ENUM (num_chars = 0 and no character data) all is OK. Something wrong with character data.

Link to comment
Share on other sites

Edited response and added equipment data and first bag data to it. But no success(client still returns error):

name_bytes = name.encode('utf-8') + b'\x00'
        data = pack(
            '<Q{name_len}s3B5BB2I3f2IB3I'.format(name_len=len(name_bytes)),
            1,               # guid 0
            name_bytes,      # 1
            4,               # race 2
            11,              # class 3
            0,               # gender 4
            0,               # skin 5
            0,               # face 5
            0,               # hair style 5
            0,               # hair color 5
            0,               # facial hair 6
            61,              # level 7
            141,             # zone id 8
            1,               # map id 9
            10322.1,         # x 10
            825.436,         # y 11
            1326.37,         # z 12
            0,               # guild 13
            0,               # char flags ? 14
            0,               # first login 15
            0,               # pet display id 16
            0,               # pet level 17
            0                # pet family 18
        )

        char_equipment = []

    	# 19 pieces of equipment
        for item in range(CharacterEquipSlot.HEAD.value, CharacterEquipSlot.TABARD.value + 1):
            char_equipment.append(pack('<IBI', 0, 0, 0))  # item display id - item inventory type - enchant

        # first bag data
        char_equipment.append(pack('<IBI', 0, 0, 0))  # first bag display id - inventory type - enchant

 

Link to comment
Share on other sites

SMSG_CHAR_ENUM means an enumeration. The very first value you send (1 byte) is the number of characters (heroes) on the selected realm, not the number of characters in the name... After this field you start enumerating your characters, starting with their guid (8 bytes), name (null terminated), race, class, gender, skin, face etc. So, for example, if you have 5 heroes on the realm, you'll send 5 as the first byte and then 5 structures describing each of your hero, each one starting with the GUID. I cannot be more specific than this.

Cheers!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use