Skip to content

Commit c7285e2

Browse files
committed
feat(NetworkManager): expose methods for clientId to transportId mappings
1 parent cbc2d72 commit c7285e2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,20 @@ private void HostServerInitialize()
903903
ConnectionManager.InvokeOnClientConnectedCallback(LocalClientId);
904904
}
905905

906+
/// <summary>
907+
/// Get the transportId from the associated clientId.
908+
/// </summary>
909+
/// <param name="clientId">The ClientId to get the TransportId from</param>
910+
/// <returns></returns>
911+
public ulong GetTransportIdFromClientId(ulong clientId) => ConnectionManager.ClientIdToTransportId(clientId);
912+
913+
/// <summary>
914+
/// Get the clientId from the associated transportId.
915+
/// </summary>
916+
/// <param name="clientId">The TransportId to get the ClientId from</param>
917+
/// <returns></returns>
918+
public ulong GetClientIdFromTransportId(ulong transportId) => ConnectionManager.TransportIdToClientId(transportId);
919+
906920
/// <summary>
907921
/// Disconnects the remote client.
908922
/// </summary>

0 commit comments

Comments
 (0)