Jump to content

Recommended Posts

Posted

Does it make a difference if I use GetObjectGuid in sending packet data?

data << m_caster->GetPackGUID();

or

data << m_caster->GetObjectGuid();

Does it have a big impact on anything?

Posted

yes, a normal guid is always 8bytes while a packed one is between 1 and 9 (I think?). Meaning that it can break the whole packet if you use the wrong one

Posted

Object GUID is always 64 bits.

Packed GUID is 8 to 72 bits.

Packed GUID consists of:

[8 bits (mask)] + [8*n bits (data) (n = 'on' bit count in mask)]

Packed GUID is used to reduce GUID size for less data usage over network.

Take bit from mask, if it's 0 put 0x00 in your GUID, if it's 1 put next two bytes of data and put in your guid.

Example of packed GUID vs GUID:

GUID= 0x0000000012345678 (player guid, because high part is 0x0000)

Packed GUID:

-mask (binary): 00001111 (0x0F)

-data: 0x12345678

-together: 0x0F12345678

GUID= 0x0012003400560078

Packed GUID:

-mask (binary): 01010101 (0x55)

-data: 0x12345678

-together: 0x5512345678

Posted

Is the increased data usage notable?

I was experimenting with some packets and the problem is that some packets only work with data GetObjectGuid(); and not with GetPackGUID();

So I assume it's safe to use GetObjectGuid(); where needed, right?

Posted

you _must_ use the guid format that is expected to be sent by the client.

If you chose the wrong one, the client will either crash (most likely) or produce total crap..

Edit: To be clear: This is a choice that was made by blizzard developers, and if you want to talk to the client, you must use the 'language' the client understands. This is nothing where you can chose.

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