Open ayaazki opened 4 months ago
Still investigating,
I can reproduce the bug with 16 prefabs but different conditions :
Also to note, the following log is coming from the client :
Started to load addressable with GUID: 05ea0814e604c4acf8ae3b7e0a5dfb07
Loaded prefab has been assigned to NetworkManager's PlayerPrefab
StartClient
ConnectionManager: Changed connection state from OfflineState to ClientConnectingState.
[Netcode] NetworkPrefab cannot be null (NetworkPrefab at index: -1)
[Netcode] Removing invalid prefabs from Network Prefab registration: {SourceHash: 0, TargetHash: 0}
ConnectionManager: Changed connection state from ClientConnectingState to OfflineState.
Disconnect
The connection approval workflow from ConnectionApprovalCallback is only run at Host startup, but doesn't get executed when a new client connects.
@Ufabsther Can you reproduce this using v1.9.1?
Yes, it does reproduce with the last release 1.9.1 as well .
After further investigation on the Netcode for GameObject 1.9.1 and , using parallel sync, I was able to determine the issue was just related to an oversized Disconnection Reason.
[Netcode] Disconnect reason didn't fit. Disconnected without sending a reason. Consider shortening the reason string.
Thus there is nothing to fix on the SDK BUT we should either put a disclaimer on the Sample, or present a more practical exemple of this feature without using DisconnectionReason.
I am getting the same error when trying to preload prefabs before starting the server. After calling LoadAssetAsync and assigning the loaded GameObject to the NetworkPrefabs list I'm getting the NetworkPrefab cannot be null, even though it's definitely working fine later when I instantiate it.
Netcode 1.9.1
Description
I am trying to Preload Network prefabs from addressables without spawning, the sequence of the process is that I run the server, invoke preload, then run the client.
The issue is that the client connection is denied immediately. It only happens if the server invokes a preload for more than 17 prefabs, then:
It works only in two cases:
Reproduce Steps
Iam testing on the (Dynamic prefab sample) project. https://docs-multiplayer.unity3d.com/netcode/current/learn/bitesize/bitesize-dynamicPrefabs/
Actual Outcome
The client connection is denied, the disconnects.
Expected Outcome
The client connects and preload all prefabs that the server has loaded.
Environment