com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

feat(NetworkManager): expose methods for clientId to transportId mappings

Open patrickexe opened this issue 2 years ago • 3 comments

This feature gives access to 2 new get methods in NetworkManager that allow the user to convert between clientId and transportId and vice versa.

Our use case for this feature was using Facepunch.Steamworks and our own twist on the community transport that pairs with it. We need to be able to get the SteamId of any connected client from their clientId for various reasons, one being server-side saving of client specific data that is then identified via SteamId.

This feature resolves #2359.

Changelog

  • Added: A getter function in NetworkManager that can convert from clientId to transportId and vice versa.

Testing and Documentation

  • No tests have been added.

patrickexe avatar Aug 20 '23 14:08 patrickexe

CLA assistant check
All committers have signed the CLA.

unity-cla-assistant avatar Aug 20 '23 14:08 unity-cla-assistant

Yeah, I hit this too, this is a must. Considering even UnityTransport uses this in its Send method, it is obvious these needs to be public as other transports (and users) definitely might use this.

kulkalkul avatar Nov 08 '23 17:11 kulkalkul

Yeah, I hit this too, this is a must. Considering even UnityTransport uses this in its Send method, it is obvious these needs to be public as other transports (and users) definitely might use this.

Yeah I'm currently running on a forked version of this repo, with this change implemented. It's slightly out of sync with main but feel free to use or just fork your own copy if you need this feature soon 👍🏼

patrickexe avatar Nov 08 '23 17:11 patrickexe