Skip to content

fix: resetting the NetworkVariable dirty status at end of frame, … #2344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Dec 12, 2022

Conversation

jeffreyrainy
Copy link
Contributor

… even if a given NetworkVariable is not sent to any client

Also queueing NetworkShow to be done at end-of-frame, to address modified-after-shown objects.

Also changing NetworkHide so that hiding objects that would be shown at end of frame does nothing, but emit a warning.

MTT-5121
#2306

Changelog:

  • NetworkShow() of NetworkObjects are delayed until the end of the frame to ensure consistency of delta-driven variables like NetworkList.
  • Dirty NetworkObject are reset at end-of-frame and not at serialization time.
  • NetworkHide() of an object that was just NetworkShow()n produces a warning, as remote clients will not get a spawn/despawn pair.

@jeffreyrainy jeffreyrainy requested a review from a team as a code owner December 12, 2022 00:49
@@ -64,6 +64,16 @@ public void Serialize(FastBufferWriter writer, int targetVersion)
shouldWrite = false;
}

// The object containing the behaviour we're about to process is about to be shown to this client
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@jeffreyrainy jeffreyrainy merged commit e3b837a into develop Dec 12, 2022
@jeffreyrainy jeffreyrainy deleted the fix/mtt-5121-networklist-hide-remove-2 branch December 12, 2022 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants