Skip to content

Commit 664b122

Browse files
committed
Removed MULTIPLAYER_TOOLS_1_0_0_PRE_7 define usage
1 parent 4b99f27 commit 664b122

File tree

5 files changed

+0
-40
lines changed

5 files changed

+0
-40
lines changed

com.unity.netcode.gameobjects/Runtime/Metrics/NetworkMetrics.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ private static string GetSceneEventTypeName(uint typeCode)
6363
private readonly EventMetric<SceneEventMetric> m_SceneEventSentEvent = new EventMetric<SceneEventMetric>(NetworkMetricTypes.SceneEventSent.Id);
6464
private readonly EventMetric<SceneEventMetric> m_SceneEventReceivedEvent = new EventMetric<SceneEventMetric>(NetworkMetricTypes.SceneEventReceived.Id);
6565

66-
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
6766
private readonly Counter m_PacketSentCounter = new Counter(NetworkMetricTypes.PacketsSent.Id)
6867
{
6968
ShouldResetOnDispatch = true,
@@ -85,7 +84,6 @@ private static string GetSceneEventTypeName(uint typeCode)
8584
ShouldResetOnDispatch = true,
8685
};
8786
private readonly Gauge m_PacketLossGauge = new Gauge(NetworkMetricTypes.PacketLoss.Id);
88-
#endif
8987

9088
private ulong m_NumberOfMetricsThisFrame;
9189

@@ -103,13 +101,11 @@ public NetworkMetrics()
103101
.WithMetricEvents(m_RpcSentEvent, m_RpcReceivedEvent)
104102
.WithMetricEvents(m_ServerLogSentEvent, m_ServerLogReceivedEvent)
105103
.WithMetricEvents(m_SceneEventSentEvent, m_SceneEventReceivedEvent)
106-
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
107104
.WithCounters(m_PacketSentCounter, m_PacketReceivedCounter)
108105
.WithGauges(m_RttToServerGauge)
109106
.WithGauges(m_NetworkObjectsGauge)
110107
.WithGauges(m_ConnectionsGauge)
111108
.WithGauges(m_PacketLossGauge)
112-
#endif
113109
.Build();
114110

115111
Dispatcher.RegisterObserver(NetcodeObserver.Observer);
@@ -437,76 +433,64 @@ public void TrackSceneEventReceived(ulong senderClientId, uint sceneEventType, s
437433

438434
public void TrackPacketSent(uint packetCount)
439435
{
440-
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
441436
if (!CanSendMetrics)
442437
{
443438
return;
444439
}
445440

446441
m_PacketSentCounter.Increment(packetCount);
447442
IncrementMetricCount();
448-
#endif
449443
}
450444

451445
public void TrackPacketReceived(uint packetCount)
452446
{
453-
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
454447
if (!CanSendMetrics)
455448
{
456449
return;
457450
}
458451

459452
m_PacketReceivedCounter.Increment(packetCount);
460453
IncrementMetricCount();
461-
#endif
462454
}
463455

464456
public void UpdateRttToServer(int rttMilliseconds)
465457
{
466-
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
467458
if (!CanSendMetrics)
468459
{
469460
return;
470461
}
471462
var rttSeconds = rttMilliseconds * 1e-3;
472463
m_RttToServerGauge.Set(rttSeconds);
473-
#endif
474464
}
475465

476466
public void UpdateNetworkObjectsCount(int count)
477467
{
478-
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
479468
if (!CanSendMetrics)
480469
{
481470
return;
482471
}
483472

484473
m_NetworkObjectsGauge.Set(count);
485-
#endif
486474
}
487475

488476
public void UpdateConnectionsCount(int count)
489477
{
490-
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
491478
if (!CanSendMetrics)
492479
{
493480
return;
494481
}
495482

496483
m_ConnectionsGauge.Set(count);
497-
#endif
498484
}
499485

500486
public void UpdatePacketLoss(float packetLoss)
501487
{
502-
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
503488
if (!CanSendMetrics)
504489
{
505490
return;
506491
}
507492

508493
m_PacketLossGauge.Set(packetLoss);
509-
#endif
510494
}
511495

512496
public void DispatchFrame()

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#if MULTIPLAYER_TOOLS
2-
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
32
using AOT;
43
using Unity.Burst;
54
using Unity.Collections.LowLevel.Unsafe;
@@ -66,4 +65,3 @@ private static void InitializeConnection(byte* staticInstanceBuffer, int staticI
6665
}
6766
}
6867
#endif
69-
#endif

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,7 @@ public void GetDefaultPipelineConfigurations(
597597
#if UNITY_MP_TOOLS_NETSIM_IMPLEMENTATION_ENABLED
598598
NetworkPipelineStageId.Get<SimulatorPipelineStage>(),
599599
#endif
600-
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
601600
NetworkPipelineStageId.Get<NetworkMetricsPipelineStage>(),
602-
#endif
603601
};
604602

605603
var unreliableSequencedFragmented = new NetworkPipelineStageId[]
@@ -609,9 +607,7 @@ public void GetDefaultPipelineConfigurations(
609607
#if UNITY_MP_TOOLS_NETSIM_IMPLEMENTATION_ENABLED
610608
NetworkPipelineStageId.Get<SimulatorPipelineStage>(),
611609
#endif
612-
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
613610
NetworkPipelineStageId.Get<NetworkMetricsPipelineStage>(),
614-
#endif
615611
};
616612

617613
var reliableSequenced = new NetworkPipelineStageId[]
@@ -620,9 +616,7 @@ public void GetDefaultPipelineConfigurations(
620616
#if UNITY_MP_TOOLS_NETSIM_IMPLEMENTATION_ENABLED
621617
NetworkPipelineStageId.Get<SimulatorPipelineStage>(),
622618
#endif
623-
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
624619
NetworkPipelineStageId.Get<NetworkMetricsPipelineStage>(),
625-
#endif
626620
};
627621

628622
unreliableFragmentedPipelineStages = new(unreliableFragmented, Allocator.Temp);
@@ -1084,12 +1078,10 @@ protected override void OnPostLateUpdate()
10841078
// current frame.
10851079
m_Driver.ScheduleFlushSend(default).Complete();
10861080

1087-
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
10881081
if (m_NetworkManager)
10891082
{
10901083
ExtractNetworkMetrics();
10911084
}
1092-
#endif
10931085
}
10941086
base.OnPostLateUpdate();
10951087
}
@@ -1099,7 +1091,6 @@ private void OnDestroy()
10991091
DisposeInternals();
11001092
}
11011093

1102-
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
11031094
private void ExtractNetworkMetrics()
11041095
{
11051096
if (m_NetworkManager.IsServer)
@@ -1167,7 +1158,6 @@ private void ExtractNetworkMetricsFromPipeline(NetworkPipeline pipeline, Network
11671158
networkMetricsContext->PacketReceivedCount = 0;
11681159
}
11691160
}
1170-
#endif
11711161

11721162
private int ExtractRtt(NetworkConnection networkConnection)
11731163
{
@@ -1713,9 +1703,7 @@ public void CreateDriver(
17131703
#endif
17141704
}
17151705

1716-
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
17171706
driver.RegisterPipelineStage(new NetworkMetricsPipelineStage());
1718-
#endif
17191707

17201708
GetDefaultPipelineConfigurations(
17211709
out var unreliableFragmentedPipelineStages,

com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@
3333
"expression": "(0,2022.2.0a5)",
3434
"define": "UNITY_UNET_PRESENT"
3535
},
36-
{
37-
"name": "com.unity.multiplayer.tools",
38-
"expression": "1.0.0-pre.7",
39-
"define": "MULTIPLAYER_TOOLS_1_0_0_PRE_7"
40-
},
4136
{
4237
"name": "Unity",
4338
"expression": "2023",

com.unity.netcode.gameobjects/Tests/Runtime/Unity.Netcode.Runtime.Tests.asmdef

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@
3838
"expression": "(0,2022.2.0a5)",
3939
"define": "UNITY_UNET_PRESENT"
4040
},
41-
{
42-
"name": "com.unity.multiplayer.tools",
43-
"expression": "1.0.0-pre.7",
44-
"define": "MULTIPLAYER_TOOLS_1_0_0_PRE_7"
45-
},
4641
{
4742
"name": "com.unity.modules.physics",
4843
"expression": "",

0 commit comments

Comments
 (0)