Skip to content

Commit 8d5f84c

Browse files
Merge develop-2.0.0 into fix/mttb-1452-add-help-urls
2 parents ce4bdb8 + c63202f commit 8d5f84c

File tree

5 files changed

+338
-309
lines changed

5 files changed

+338
-309
lines changed

com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -787,13 +787,13 @@ public OwnershipRequestStatus RequestOwnership()
787787
// Otherwise, send the request ownership message
788788
var changeOwnership = new ChangeOwnershipMessage
789789
{
790+
ChangeMessageType = ChangeOwnershipMessage.ChangeType.RequestOwnership,
790791
NetworkObjectId = NetworkObjectId,
791792
OwnerClientId = OwnerClientId,
792793
ClientIdCount = 1,
793794
RequestClientId = NetworkManager.LocalClientId,
794795
ClientIds = new ulong[1] { OwnerClientId },
795796
DistributedAuthorityMode = true,
796-
RequestOwnership = true,
797797
OwnershipFlags = (ushort)Ownership,
798798
};
799799

@@ -868,18 +868,18 @@ internal void OwnershipRequest(ulong clientRequestingOwnership)
868868
else
869869
{
870870
// Otherwise, send back the reason why the ownership request was denied for the clientRequestingOwnership
871-
/// Notes:
872-
/// We always apply the <see cref="NetworkManager.LocalClientId"/> as opposed to <see cref="OwnerClientId"/> to the
873-
/// <see cref="ChangeOwnershipMessage.OwnerClientId"/> value as ownership could have changed and the denied requests
874-
/// targeting this instance are because there is a request pending.
875-
/// DANGO-TODO: What happens if the client requesting disconnects prior to responding with the update in request pending?
871+
// Notes:
872+
// We always apply the <see cref="NetworkManager.LocalClientId"/> as opposed to <see cref="OwnerClientId"/> to the
873+
// <see cref="ChangeOwnershipMessage.OwnerClientId"/> value as ownership could have changed and the denied requests
874+
// targeting this instance are because there is a request pending.
875+
// DANGO-TODO: What happens if the client requesting disconnects prior to responding with the update in request pending?
876876
var changeOwnership = new ChangeOwnershipMessage
877877
{
878+
ChangeMessageType = ChangeOwnershipMessage.ChangeType.RequestDenied,
878879
NetworkObjectId = NetworkObjectId,
879880
OwnerClientId = NetworkManager.LocalClientId, // Always use the local clientId (see above notes)
880881
RequestClientId = clientRequestingOwnership,
881882
DistributedAuthorityMode = true,
882-
RequestDenied = true,
883883
OwnershipRequestResponseStatus = (byte)response,
884884
OwnershipFlags = (ushort)Ownership,
885885
};
@@ -1065,10 +1065,10 @@ internal void SendOwnershipStatusUpdate()
10651065

10661066
var changeOwnership = new ChangeOwnershipMessage
10671067
{
1068+
ChangeMessageType = ChangeOwnershipMessage.ChangeType.OwnershipFlagsUpdate,
10681069
NetworkObjectId = NetworkObjectId,
10691070
OwnerClientId = OwnerClientId,
10701071
DistributedAuthorityMode = true,
1071-
OwnershipFlagsUpdate = true,
10721072
OwnershipFlags = (ushort)Ownership,
10731073
};
10741074

0 commit comments

Comments
 (0)