Skip to content

Commit e46f3dd

Browse files
patrickexeEmandM
authored andcommitted
feat(NetworkManager): expose methods for clientId to transportId mappings
1 parent f966e07 commit e46f3dd

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
@@ -1467,6 +1467,20 @@ private void HostServerInitialize()
14671467
ConnectionManager.InvokeOnClientConnectedCallback(LocalClientId);
14681468
}
14691469

1470+
/// <summary>
1471+
/// Get the transportId from the associated clientId.
1472+
/// </summary>
1473+
/// <param name="clientId">The ClientId to get the TransportId from</param>
1474+
/// <returns></returns>
1475+
public ulong GetTransportIdFromClientId(ulong clientId) => ConnectionManager.ClientIdToTransportId(clientId);
1476+
1477+
/// <summary>
1478+
/// Get the clientId from the associated transportId.
1479+
/// </summary>
1480+
/// <param name="clientId">The TransportId to get the ClientId from</param>
1481+
/// <returns></returns>
1482+
public ulong GetClientIdFromTransportId(ulong transportId) => ConnectionManager.TransportIdToClientId(transportId);
1483+
14701484
/// <summary>
14711485
/// Disconnects the remote client.
14721486
/// </summary>

0 commit comments

Comments
 (0)