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

DisconnectReason is empty when using Facepunch Transport #210

Open
cantaspinar opened this issue Mar 22, 2023 · 1 comment
Open

DisconnectReason is empty when using Facepunch Transport #210

cantaspinar opened this issue Mar 22, 2023 · 1 comment

Comments

@cantaspinar
Copy link

cantaspinar commented Mar 22, 2023

Unity 2021.3.14f1
Netcode for GameObjects 1.2.0

NetworkManager.Singleton.DisconnectReason returns an empty string when using response.Reason in the ApprovalCheck or NetworkManager.Singleton.DisconnectClient(clientId, "reason").

Also, after 10 seconds from the client rejection, I get this error:

KeyNotFoundException: The given key '1' was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <d6232873609549b8a045fa15811a5bd3>:0)
Unity.Netcode.NetworkManager.ClientIdToTransportId (System.UInt64 clientId) (at Library/PackageCache/[email protected]/Runtime/Core/NetworkManager.cs:1781)
Unity.Netcode.NetworkManager.DisconnectRemoteClient (System.UInt64 clientId) (at Library/PackageCache/[email protected]/Runtime/Core/NetworkManager.cs:1361)
Unity.Netcode.NetworkManager.DisconnectClient (System.UInt64 clientId, System.String reason) (at Library/PackageCache/[email protected]/Runtime/Core/NetworkManager.cs:2063)
Unity.Netcode.NetworkManager.DisconnectClient (System.UInt64 clientId) (at Library/PackageCache/[email protected]/Runtime/Core/NetworkManager.cs:2038)
Unity.Netcode.NetworkManager+<ApprovalTimeout>d__180.MoveNext () (at Library/PackageCache/[email protected]/Runtime/Core/NetworkManager.cs:1765)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <bae255e3e08e46f7bc2fbd23dde96338>:0)
@cantaspinar
Copy link
Author

Thanks to @NoelStephensUnity , a quick fix is here for getting the DisconnectReason on the client side.

Also, there is a pr on the way to handle the timeout exception.

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

No branches or pull requests

1 participant