Jump to content
/dev/not/null

update mask for SMSG_UPDATE_OBJECT

Recommended Posts

This mask should contains zero (by default) for each object field if field do not set or 1 if field has value, isn't it ?

For example, for player update mask looks like 

'0' * player_field_count

Am I right ?

Share this post


Link to post
Share on other sites

No, you're not right! Updatemask is used as part of client/server dialog to send changes to the client. Everytime an object field CHANGES at the server side (from the last time it's update was sent), the corresponding updatemask bit is set to 1.
When an object changes server side, the updatemask is sent along with the changed fields (and only those) to the client.
After the object update is sent to the client, the updatemask resets all its bits to 0.

When you first create an object first time, ALL FIELDS MUST BE INITIALIZED, so the updatemask bits are all 1 and you send to the client all object fields. There is no field left unintialized.

  • Like 2

Share this post


Link to post
Share on other sites
4 hours ago, H0zen said:

No, you're not right! Updatemask is used as part of client/server dialog to send changes to the client. Everytime an object field CHANGES at the server side (from the last time it's update was sent), the corresponding updatemask bit is set to 1.
When an object changes server side, the updatemask is sent along with the changed fields (and only those) to the client.
After the object update is sent to the client, the updatemask resets all its bits to 0.

When you first create an object first time, ALL FIELDS MUST BE INITIALIZED, so the updatemask bits are all 1 and you send to the client all object fields. There is no field left unintialized.

Ok. if I understand it correctly, for player world entering I need to initialize all fields from update fields ?

Share this post


Link to post
Share on other sites
On 1/14/2019 at 8:13 PM, H0zen said:

Yes.

OK, but then what the purpose of InitVisibleBits method of Player.cpp ?

Edited by /dev/not/null

Share this post


Link to post
Share on other sites

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

Contact Us

To contact us click here
You can also email us at [email protected]

Privacy Policy | Terms & Conditions

Repositories

The Link to the master list
of MaNGOS repositories:
Copyright © getMaNGOS. All rights Reserved.

This website is in no way associated with or endorsed by Blizzard Entertainment®
×