-
Notifications
You must be signed in to change notification settings - Fork 459
fix: Moving tick writing out of NetworkVariable and into NetworkBehav… #590
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -145,14 +145,6 @@ public bool CanClientRead(ulong clientId) | |
| /// <param name="stream">The stream to write the value to</param> | ||
| public void WriteDelta(Stream stream) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar to what we are doing here, can we have
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is an awesome point and forced be to go back to re-thinking the whole rationale. Where we start from:
Where we want to go:
This experimental release, sadly, sits somewhere in between. Netvars (all types) looks like they carry remote tick and local tick. But only NetworkedVariables actually do. But we don't have the full snapshot system either. I'm unwilling to revert back the whole tick transport into the NetworkedVariables just to not change stuff. In the end, the NetworkBehaviour will be an integral part of writing the snapshot. So, it feels OK to have some of the feature there. Similarly, in the end, the sets, lists, and dictionaries will have to be able to fit in the snapshot, so... This change is needed. It's not optimal and, in hindsight, the part that goes in the experimental release would have been cut out differently. But for this release, I'd go forward with this PR, adding the tests that Matt suggests below. Would that be acceptable ? |
||
| { | ||
| using (var writer = PooledNetworkWriter.Get(stream)) | ||
| { | ||
| // write the network tick at which this NetworkVariable was modified remotely | ||
| // this will allow lag-compensation | ||
| // todo: this is currently only done on delta updates. Consider whether it should be done in WriteField | ||
| writer.WriteUInt16Packed(RemoteTick); | ||
| } | ||
|
|
||
| WriteField(stream); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind describing the problem and the proposed fix in this PR?
I have very little to zero context, what I'm reviewing? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See below comment