Skip to content

Commit 428ba49

Browse files
committed
Merge branch 'feature/clientId-to-transportId-helpers' of https://github.com/patrickexe/com.unity.netcode.gameobjects into fix/transportId-to-clientId
2 parents c13c93d + c7285e2 commit 428ba49

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
@@ -1145,6 +1145,20 @@ private void HostServerInitialize()
11451145
ConnectionManager.InvokeOnClientConnectedCallback(LocalClientId);
11461146
}
11471147

1148+
/// <summary>
1149+
/// Get the transportId from the associated clientId.
1150+
/// </summary>
1151+
/// <param name="clientId">The ClientId to get the TransportId from</param>
1152+
/// <returns></returns>
1153+
public ulong GetTransportIdFromClientId(ulong clientId) => ConnectionManager.ClientIdToTransportId(clientId);
1154+
1155+
/// <summary>
1156+
/// Get the clientId from the associated transportId.
1157+
/// </summary>
1158+
/// <param name="clientId">The TransportId to get the ClientId from</param>
1159+
/// <returns></returns>
1160+
public ulong GetClientIdFromTransportId(ulong transportId) => ConnectionManager.TransportIdToClientId(transportId);
1161+
11481162
/// <summary>
11491163
/// Disconnects the remote client.
11501164
/// </summary>

0 commit comments

Comments
 (0)