Skip to content

Wrong IsOwner/IsOwnedByServer in NetworkBehaviour on Server #2063

@Myxcil

Description

@Myxcil

Description

UpdateOwnershipTable(networkObject, NetworkManager.ServerClientId, true);
networkObject.OwnerClientId = NetworkManager.ServerClientId;

When a client owner is removed UpdateNetworkProperties is called on the server with the previous OwnerClientId still set, which leads to wrong values in NetworkBehaviour.IsOwner, IsOwnedByServer and OwnerClientId

Not sure if a simple swap of lines 217 and 219 will introduce side effects, so I haven't created a pull request.

Reproduce Steps

Remove ownership from an object which is controlled by a client and has a NetworkBehaviour assigned.
Compare IsOwner etc. properties between NetworkObject and the behaviour on the server.

Actual Outcome

NetworkBehaviour properties aren't properly set on the server.

Expected Outcome

Correct owner is set in the NetworkBehaviours on the server after ownership is lost.

Environment

  • OS: Windows
  • Unity Version: 2021.1.24f1
  • Netcode Version: 1.0.0

Metadata

Metadata

Labels

priority:mediumThis issue has medium priority and may take some time to be resolvedstat: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