Jump to content
  • We are looking for staff for the Wiki area!
    If interested please
    click here and select "Documentation Team"

  • Data types of packet fields


    Olion

    The numeric data longer than 1 byte are represented in the big-endian form. The cores provide the conversion (if needed) by the ">>" and "<<" operators.

    Data formats
    Type Getting it in the core Description
    uint8, uint16, uint32, int8, int16, int32 Direct conversion of numbers and enum members to the corresponding type, like uint8(SPELL_FAILED_DONT_REPORT) Signed and unsigned versions are interchangeable if the representation is correct. Boolean true/false are represented usually as uint8(1), uint8(0) respectively.
    uint64 (GUID) Object::GetObjectGuid() A 8-bytes value, see class ObjectGuid. It is used for nothing but GUIDs, so uint64(0) in the code should be changed to ObjectGuid().
    PackedGUID Object::GetPackGUID(), ObjectGuid::ReadAsPacked() A GUID in the packed form can be 2 to 9 bytes long. A brief description is presented below.
    C string string::c_str() A zero-terminated sequence of characters. Read/write operators for string type ("<< string" so on) provide this conversion, making call to c_str() optional.
    Raw data ByteBuffer::contents(), BigNumber::AsByteArray() An arbitrary sequence of bytes, following the uint8, uint16, or uint32 field which stores the length of the sequence.

    A packed GUID consists of a flag byte followed by the GUID data. This is based on the 1:1 mapping of a bit of the flag byte to the byte in 8-bytes GUID. The flag byte contains only those bits set which correspond to the non-zero bytes of the full GUID. The packed GUID length varies from 2 bytes (the best case for a player with low GUID under 256) and 9 bytes (with the flag byte 0xFF followed by the full GUID). The most saving in size provide player GUIDs since any other GUID contains non-zero data in the highest bytes, at least in the 12 highest bits (see ObjectGuid class for details).


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • 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