Skip to content
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

feat: Add a SessionOwner ObjectStatus and allow InScenePlaced network objects to be distributed #3175

Conversation

EmandM
Copy link
Contributor

@EmandM EmandM commented Dec 13, 2024

During the development of NGO DA it was surfaced that there are some network objects that we don't want to distribute when a new client joins. The workaround at the time was to not distribute any in-scene placed network objects when a new client joins.

This PR fixes this issue via adding a NetworkObject.OwnershipStatus.SessionOwner to mark objects that should be distributable, but should only ever belong to the current session owner. It also now allows in-scene placed network objects to be distributed.

The NetworkObject.OwnershipStatus.SessionOwner flag will override all other OwnershipStatus flags, and cannot be set in conjunction with any other flag.

Changelog

  • Added: NetworkObject.OwnershipStatus.SessionOwner flag. This flag will override all other OwnershipStatus flags.
  • Changed: In-scene placed network objects can now be distributed when a new client joins.

Testing and Documentation

  • Includes unit tests.

EmandM and others added 9 commits December 12, 2024 17:09
removing additional session owner accessor.
This reverts commit 3c3b354.
object distribution for in-scene placed NetworkObjects needs to use the InScenePlacedSourceGlobalObjectIdHash when building an object distribution list.
@EmandM EmandM requested a review from a team as a code owner December 13, 2024 01:46
EmandM and others added 10 commits December 12, 2024 20:48
DAHost should not distribute session owner permission NetworkObjects.
When client is promoted to session owner, for now newly promoted client takes ownership of NetworkObjects that have the SessionOwner permission set.
Only prevent non-session owners from taking ownership of a NetworkObject with the SessionOwner permission set.
Avoid the RemoveOwnership client-server only method.
Visual studio code cleanup likes to sort by alpha... fixing for our standards.
Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity left a comment

Choose a reason for hiding this comment

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

Awesome!
:godmode:

Adding check for session owner trying to change ownership to a non-session owner client.
Adding an additional validation that a non-session owner cannot change ownership and that a session owner cannot change ownership to a non-session owner when the NetworkObject in question has the SessionOwner permissions set.
@NoelStephensUnity NoelStephensUnity merged commit 2d10975 into develop-2.0.0 Dec 13, 2024
24 checks passed
@NoelStephensUnity NoelStephensUnity deleted the feat/session_owner_only_network_object_distribution branch December 13, 2024 06:29
NoelStephensUnity added a commit that referenced this pull request Dec 13, 2024
* fix: clamp spawntimeout to recommended range (#3174)

* update

Clamping spawntimeout

* update

improving parenting failed message when either the child or parent NetworkObject is not spawnd.

* update

Update the local SceneEventData.SceneEventType on the authority side for SceneLoadComplete.

* style

removing whitespaces

* feat: Add a SessionOwner ObjectStatus and allow InScenePlaced network objects to be distributed (#3175)

* Initial pass on SessionOwner ownership flag

* feat: Add SessionOwner OwnershipStatus flag

* update

removing additional session owner accessor.

* Add OwnershipPermissions tests

* fix client connect

* Revert "fix client connect"

This reverts commit 3c3b354.

* update

object distribution for in-scene placed NetworkObjects needs to use the InScenePlacedSourceGlobalObjectIdHash when building an object distribution list.

* Add changelog

* Remove unnecessary change

* Remove Settings.json

* Reword CHANGELOG

* fix

DAHost should not distribute session owner permission NetworkObjects.
When client is promoted to session owner, for now newly promoted client takes ownership of NetworkObjects that have the SessionOwner permission set.
Only prevent non-session owners from taking ownership of a NetworkObject with the SessionOwner permission set.

* test fix

Avoid the RemoveOwnership client-server only method.

* style

Visual studio code cleanup likes to sort by alpha... fixing for our standards.

* update

Adding check for session owner trying to change ownership to a non-session owner client.

* test

Adding an additional validation that a non-session owner cannot change ownership and that a session owner cannot change ownership to a non-session owner when the NetworkObject in question has the SessionOwner permissions set.

---------

Co-authored-by: NoelStephensUnity <[email protected]>

---------

Co-authored-by: Emma <[email protected]>
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.

2 participants