Jump to content

UpdateFields: Type BYTES


/dev/not/null

Recommended Posts

Imagine the object fields as an array of 32bit values. Let's call it "physical layout". Let's call the meaning of the fields "logical layout".

There are 6 types of connections between physical layout and logical layout:

  1. 1:1 - 1(one) 32bit physical field means a 32bit logical field (ints and/or floats) - for example OBJECT_FIELD_TYPE
  2. 2:1 - 2(two) 32bit fields means a 64bit logical field (usually a GUID) - for example OBJECT_FIELD_GUID
  3. N:1 - N 32bit physical fields means a logical field - for example UNIT_FIELD_AURA is a logical field composed of an array of 56 integers. The N is specified as SIZE: N in comments
  4. 1:2 - 1(one) 32bit physical field means 2(two) 16bit logical fields, denotes as TWO-SHORT in comments (for example UNIT_TRAINING_POINTS field). In code you'll see  defined the constants UNIT_TRAINING_POINTS_0 and UNIT_TRAINING_POINTS_1, which refers to the right most part and left most part of that physical field.
  5. 1:4 - 1(one) 32bit physical field means 4 (four) 8bit logical fields, denoted as BYTES in comments (for example UNIT_FIELD_BYTES_2). You can imagine these logical fields as an 4 byte array, indexed by 0. In code you'll see constants like UNIT_FIELD_BYTES_2_0, UNIT_FIELD_BYTES_2_1, etc, which simply refers to the corresponding byte at the index 0, 1, 2, 3 in that physical field.
  6. N:4N - a generalization of point e. N 32bit physical fields means a logical field composed of an array of 4*N bytes - for example UNIT_FIELD_AURAFLAGS has size 14, so it's a 56 8bit array field (each 8bit value is a flag for the corresponding 32bit value in array UNIT_FIELD_AURA referenced at point c)

So, to recap, ALL physical fields are 32bit, i.e. 4bytes long, and their logical meanings are different sizes.

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