Skip to content

NetworkVariable which have NetworkVariableWritePermission.Owner occurred infinity calling WriteDelta() from server. #2109

Closed
@Finn-NHNEdu

Description

@Finn-NHNEdu

Description

NetworkBehaviourUpdater.NetworkBehaviourUpdate() update every network variables for every connected clients. Inside of NetworkBehaviour.VariableUpdate() calls NetworkBehaviour.PreNetworkVariableWrite() and it clear list variable NetworkVariableIndexesToReset. But last client(in networkManager.ConnectedClientsList)'s variable is changed which has NetworkVariableWritePermission.Owner, at the last of update loop, it clears NetworkVariableIndexesToReset and ignore write because this client has write permission of that variable. So at the end of update loop NetworkVariableIndexesToReset is cleared. And called NetworkBehaviour.PostNetworkVariableWrite => do nothing. Server side : this NetworkVariable remains dirtyflag is true. and calling WriteDelta() at every Update.

Reproduce Steps

  1. Host client A(client id: 0), Clients B(client id:1), C(client id:2) and they have NetworkVariable with NetworkVariableWritePermission.Owner.
  2. Update C's variable.
  3. Server start calling WriteDelta() of C's NetworkVariable every tick.
  4. B received ReadDelta of C's NetworkVariable every tick.

Actual Outcome

Expected Outcome

Screenshots

Environment

  • OS: Windows 11
  • Unity Version: 2021.3.3f1
  • Netcode Version: 1.0.0
  • Netcode Commit: -

Additional Context

Metadata

Metadata

Assignees

Labels

priority:highThis issue has high priority and we are focusing to resolve itstat:importedStatus - Issue is tracked internally at Unitytype:bugBug Report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions