Unity-Technologies / com.unity.netcode.gameobjects

Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.
MIT License
2.16k stars 435 forks source link

A ConnectionRequestMessage was received from the server on the client side. #2802

Closed IamCitrus closed 4 weeks ago

IamCitrus commented 11 months ago

Description

    I cannot make a peer-to-peer local connection because of this trouble. This issue also happenes with another errors:

1) NullReferenceException: Object reference not set to an instance of an object (Related to Unity.Netcode.Components.NetworkTransform.OnNetworkObjectParentChanged and Unity.Netcode.NetworkObject.ApplyNetworkParenting) 2) Error sending message: Connection ID is invalid. Likely caused by sending on stale connection 0. Screenshots are below

Reproduce Steps

  1. Use NetworkManager.Singleton.StartHost() in UnityEditor and NetworkManager.Singleton.StartClient() in ParrelSync's clone of UnityEditor
  2. See error in Host's console

Actual Outcome

Client and hosts connect to each other but host has an NullReferenceException: Object reference not set to an instance of an object error on "Initialize" step and 2 other errors after "Connected" step.

Expected Outcome

Client and host connect to each other without any errors. Client Network Transform synchronize and the game works as intended

Screenshots

Other errors Снимок экрана (358) Снимок экрана (357) First error Снимок экрана (356)

Environment

Additional Context

Message Size: 90. Message Content: 02 01 7d 9a e2 a5 01 b2 36 17 b3 01 46 c4 ca 04 01 39 3b e8 2c 01 ab c9 50 60 01 53 a3 38 44 01 d3 f6 1c b8 01 a6 22 89 97 01 b5 fe 01 74 01 be 97 be 73 01 9d 9a 5c 01 01 e9 51 97 17 01 8a f7 e7 83 01 42 7f 88 c6 01 97 a3 f5 46 01 00 00 00 00 01 90 d8 6b 37 1b b2 9e df Снимок экрана (356)

michalChrobot commented 1 month ago

Hi, this should be fixed in com.unity.transport 2.3.0 as well as in 1.5.0. Please let us know If after updating to one of those versions (or higher one) it will still not work correctly, otherwise we will be slowly closing issues related to this bug. If you will still experience this problem feel free to reopen the issue.