IsOwner is False on owning Client when spawning object during ConnectionApproval.
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- csharp, unity
- 領域
- networking
調査の方向性
同梱されている ownership_issue_repro.zip から始め、Client - Direct Connection の構成を使用して Bootstrap scene 経由で問題を再現します。ConnectionApproval、CreateObjectMessages、clientId の割り当て、Network Behavior の初期化を追跡します。完了の条件は、承認中にスポーンされたオブジェクトが一貫した所有権を報告し、スポーンされていないオブジェクトが出現しないことです。
索引モデルが issue の本文から書いたものです。
説明
Description
When spawning a Player object and a Player Owned object during Connection Approval, the Network Behaviors on the Clients GameObjects report IsOwner as being false, while the Network Object reports IsOwner as true.
It seems based on my repro project that the client receives the CreateObjectMessages for their Player and Owned object before their ConnectionApproved message. This causes the client to not have an assigned clientId so when the Network Behaviours initialze, they set IsOwner as false (Although, the Network Object seems to include IsOwner as part of its serialized data). My guess is that this is some kind of knock on from distributed authority being added to the library (I am 99% certain I have done what is happening in this repro here in other projects from a couple years ago...)
I think that the fix here (at least if I was to rework my code) would be to do all spawning once the connection is approved and once the client reports they are ready to get their objects (somehow)
I have included a small repro project with this report.
Reproduce Steps
Download the repro project.
ownership_issue_repro.zip
- Go to Scenes and open Bootstrap
- Click the MPPM dropdown near the play button and select "Client - Direct Connection"
- Click Play, and wait for the client to connect to the host.
- Find their Player(clone) or ClientObject(clone) object in the hierarchy, note that IsOwner is True on the Network Object.
- Switch inspector to Debug mode, and look at the IsOwner field on the attached network behaviors. Note that it is set to false.
- Additionally, note that some random network objects are in the hierarchy, which were never spawned.
Actual Outcome
Objects spawned during ConnectionApproval are incorrectly set as IsOwner = false;
Expected Outcome
Either an error / warning is called when spawning with ownership for a none approved client OR the spawn messages are only sent once the approval is complete and the client has their clientId
Environment
- OS: Windows 11
- Unity Version: 6000.0.60f1
- Netcode Version: 2.7.0
- Netcode Topology: Client-Server
- 主要言語
- C#
- スター
- 2.3k
- フォーク
- 461
- 平均マージ
- 3日 16時間
- マージ済み PR(30日)
- 20
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Unity-Technologies/com.unity.netcode.gameobjects のほかの issue
-
stat:import type:bug
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
-
stat:reply-needed type:support
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
Unity-Technologies/com.unity.netcode.gameobjects#4095 · コメント 10 件 ·
-
stat:awaiting-triage stat:Investigating type:bug
Unity-Technologies/com.unity.netcode.gameobjects#3912 · コメント 5 件 · 担当者 1 名 ·
-
Tracking type:feature-2.x
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
Unity-Technologies/com.unity.netcode.gameobjects#3870 · コメント 5 件 ·
-
Tracking type:feature
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Unity-Technologies/com.unity.netcode.gameobjects#3830 · コメント 7 件 ·
Unity-Technologies/com.unity.netcode.gameobjects の issue をすべて見る
似ている issue
-
type/automation type/tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
t/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
ci-failure-cause test-failure
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
area:auth FE mvp P3
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
klasolsson81/jobbliggaren#1788 ·