Skip to content

Commit 46051e4

Browse files
fix: exposing way to set ip and port for Unity Transport Adapter (#1208)
1 parent dc2094d commit 46051e4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

com.unity.netcode.adapter.utp/Runtime/UnityTransport.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,15 @@ public void SetRelayServerData(string ipv4Address, ushort port, byte[] allocatio
299299
m_RelayServerData.ComputeNewNonce();
300300
}
301301

302+
/// <summary>
303+
/// Sets IP and Port information. This will be ignored if using the Unity Relay and you should call <see cref="SetRelayServerData"/>
304+
/// </summary>
305+
public void SetConnectionData(string ipv4Address, ushort port)
306+
{
307+
m_ServerAddress = ipv4Address;
308+
m_ServerPort = port;
309+
}
310+
302311
private IEnumerator StartRelayServer(SocketTask task)
303312
{
304313
//This comparison is currently slow since RelayServerData does not implement a custom comparison operator that doesn't use

0 commit comments

Comments
 (0)