Skip to content

fix: Never distribute an object to a client who is not an observer #3323

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

Merged

Conversation

EmandM
Copy link
Collaborator

@EmandM EmandM commented Feb 25, 2025

MTTB-1041

Changelog

  • Fixed: ChangeOwnership should never distribute to a client that is not an observer of that object.

Testing and Documentation

  • No tests have been added.

Closes #3299

@EmandM EmandM requested a review from a team as a code owner February 25, 2025 19:51
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.

:godmode:
💯

@EmandM EmandM merged commit 0e475bc into develop-2.0.0 Mar 6, 2025
27 checks passed
@EmandM EmandM deleted the fix/MTTB-1041-never-distribute-to-non-observer branch March 6, 2025 20:09
NoelStephensUnity added a commit that referenced this pull request Mar 11, 2025
<!-- Replace this block with what this PR does and why. Describe what
you'd like reviewers to know, how you applied the engineering
principles, and any interesting tradeoffs made. Delete bullet points
below that don't apply, and update the changelog section as appropriate.
-->

- Ensure objects with no observers (or only current owner as observer)
are treated as if `DontDestroyWithOwner = true` on client disconnect
- Explicitly check if childObject has new client as observer on client
connect

<!-- Add short version of the JIRA ticket to the PR title (e.g. "feat:
new shiny feature [MTT-123]") -->
[MTTB-1041](https://jira.unity3d.com/browse/MTTB-1041)
Changelog for this is in #3323.

<!-- Add RFC link here if applicable. -->

## Changelog

- Fixed: Ensure objects with no observers are treated as if
`DontDestroyWithOwner = true` on client disconnect

## Testing and Documentation

- No tests have been added.

<!-- Uncomment and mark items off with a * if this PR deprecates any
API:
### Deprecated API
- [ ] An `[Obsolete]` attribute was added along with a `(RemovedAfter
yyyy-mm-dd)` entry.
- [ ] An [api updater] was added.
- [ ] Deprecation of the API is explained in the CHANGELOG.
- [ ] The users can understand why this API was removed and what they
should use instead.
-->

Co-authored-by: Noel Stephens <[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