Skip to content

Commit 752ddd7

Browse files
committed
Deprecate SetDebugSimulatorParameters on UTP1
1 parent 3093b22 commit 752ddd7

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,11 +666,13 @@ public void SetConnectionData(NetworkEndpoint endPoint, NetworkEndpoint listenEn
666666
SetConnectionData(serverAddress, endPoint.Port, listenAddress);
667667
}
668668

669-
#if !UTP_TRANSPORT_2_0_ABOVE
670669
/// <summary>Set the parameters for the debug simulator.</summary>
671670
/// <param name="packetDelay">Packet delay in milliseconds.</param>
672671
/// <param name="packetJitter">Packet jitter in milliseconds.</param>
673672
/// <param name="dropRate">Packet drop percentage.</param>
673+
#if UTP_TRANSPORT_2_0_ABOVE
674+
[Obsolete("SetDebugSimulatorParameters is no longer supported and has no effect.")]
675+
#endif
674676
public void SetDebugSimulatorParameters(int packetDelay, int packetJitter, int dropRate)
675677
{
676678
if (m_Driver.IsCreated)
@@ -686,7 +688,6 @@ public void SetDebugSimulatorParameters(int packetDelay, int packetJitter, int d
686688
PacketDropRate = dropRate
687689
};
688690
}
689-
#endif
690691

691692
private bool StartRelayServer()
692693
{

com.unity.netcode.gameobjects/Tests/Runtime/Metrics/PacketLossMetricsTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ protected override void OnServerAndClientsCreated()
3030
{
3131
var clientTransport = (UnityTransport)m_ClientNetworkManagers[0].NetworkConfig.NetworkTransport;
3232
#if !UTP_TRANSPORT_2_0_ABOVE
33+
#pragma warning disable CS0618
3334
clientTransport.SetDebugSimulatorParameters(0, 0, m_PacketLossRate);
35+
#pragma warning restore CS0618
3436
#endif
3537

3638
// Determined through trial and error. With both UTP 1.2 and 2.0, this random seed

com.unity.netcode.gameobjects/Tests/Runtime/Transports/UnityTransportTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ public IEnumerator SendCompletesOnUnreliableSendQueueOverflow()
341341
}
342342

343343
#if !UTP_TRANSPORT_2_0_ABOVE
344+
#pragma warning disable CS0618
344345
// Check that simulator parameters are effective. We only check with the drop rate, because
345346
// that's easy to check and we only really want to make sure the simulator parameters are
346347
// configured properly (the simulator pipeline stage is already well-tested in UTP).
@@ -395,6 +396,7 @@ public IEnumerator CurrentRttReportedCorrectly()
395396

396397
yield return null;
397398
}
399+
#pragma warning restore CS0618
398400
#endif
399401

400402
[UnityTest]

0 commit comments

Comments
 (0)