Skip to content

Conversation

@LPLafontaineB
Copy link
Contributor

@LPLafontaineB LPLafontaineB commented Aug 4, 2022

This simply makes sure that m_LastSentState is initialized when the NetworkTransform is spawned. Not initializing it caused an issue with the ClientNetworkTransform where spawning it with client ownership would have the client send the uninitialized m_LastSentState to the server during the first Update, which could lead to the client and server versions having different rotations.

Changelog

  • Fixed the NetworkTransform's m_LastSentState being uninitialized at spawn

Testing and Documentation

  • No tests have been added.
  • No documentation changes or additions were necessary.

@LPLafontaineB LPLafontaineB requested a review from a team as a code owner August 4, 2022 18:56
@LPLafontaineB LPLafontaineB marked this pull request as draft August 4, 2022 19:01
@JesseOlmer
Copy link
Contributor

cc @NoelStephensUnity since you're looking at this same code right now.

TryCommitTransformToServer(m_Transform, m_CachedNetworkManager.LocalTime.Time);
}
m_LocalAuthoritativeNetworkState = m_ReplicatedNetworkState.Value;
m_LastSentState = m_LocalAuthoritativeNetworkState = m_ReplicatedNetworkState.Value;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I will look into this issue in #2102 since there are some adjustments that could fix the issue you might be experiencing with client-side authority. m_LastSentState should be only set by the authority as that is all it is used for, and this change will set it on both non-authoritative and authoritative (although setting it on the non-authoritative side shouldn't have any real impact to non-authoritative instances).

@NoelStephensUnity
Copy link
Collaborator

@LPLafontaineB
I am closing this out because of PR-2110

@LPLafontaineB LPLafontaineB deleted the fix/last-sent-state-not-initialized-network-transform branch October 19, 2022 20:45
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.

4 participants