Skip to content

Commit 00684be

Browse files
Get rid of unnecessary UTP_TRANSPORT_2_4_ABOVE define
1 parent e7b14c2 commit 00684be

File tree

6 files changed

+8
-23
lines changed

6 files changed

+8
-23
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
using System;
99
using System.Collections.Generic;
10-
#if HOSTNAME_RESOLUTION_AVAILABLE && UTP_TRANSPORT_2_4_ABOVE
10+
#if HOSTNAME_RESOLUTION_AVAILABLE
1111
using System.Text.RegularExpressions;
1212
#endif
1313
using Unity.Burst;
@@ -260,7 +260,7 @@ public NetworkEndpoint ServerEndPoint
260260
var networkEndpoint = ParseNetworkEndpoint(Address, Port);
261261
if (networkEndpoint == default)
262262
{
263-
#if HOSTNAME_RESOLUTION_AVAILABLE && UTP_TRANSPORT_2_4_ABOVE
263+
#if HOSTNAME_RESOLUTION_AVAILABLE
264264
if (!IsValidFqdn(Address))
265265
#endif
266266
{
@@ -667,7 +667,7 @@ private NetworkPipeline SelectSendPipeline(NetworkDelivery delivery)
667667
}
668668
}
669669

670-
#if HOSTNAME_RESOLUTION_AVAILABLE && UTP_TRANSPORT_2_4_ABOVE
670+
#if HOSTNAME_RESOLUTION_AVAILABLE
671671
private static bool IsValidFqdn(string fqdn)
672672
{
673673
// Regular expression to validate FQDN
@@ -693,7 +693,7 @@ private bool ClientBindAndConnect()
693693
// Verify the endpoint is valid before proceeding
694694
if (serverEndpoint.Family == NetworkFamily.Invalid)
695695
{
696-
#if HOSTNAME_RESOLUTION_AVAILABLE && UTP_TRANSPORT_2_4_ABOVE
696+
#if HOSTNAME_RESOLUTION_AVAILABLE
697697

698698
// If it's not valid, assure it meets FQDN standards
699699
if (IsValidFqdn(ConnectionData.Address))
@@ -745,7 +745,7 @@ private bool ServerBindAndListen(NetworkEndpoint endPoint)
745745
// Verify the endpoint is valid before proceeding
746746
if (endPoint.Family == NetworkFamily.Invalid)
747747
{
748-
#if HOSTNAME_RESOLUTION_AVAILABLE && UTP_TRANSPORT_2_4_ABOVE
748+
#if HOSTNAME_RESOLUTION_AVAILABLE
749749
// If it's not valid, assure it meets FQDN standards
750750
if (!IsValidFqdn(ConnectionData.Address))
751751
{

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@
6868
"expression": "6000.0.11f1",
6969
"define": "COM_UNITY_MODULES_PHYSICS2D_LINEAR"
7070
},
71-
{
72-
"name": "com.unity.transport",
73-
"expression": "2.4.0",
74-
"define": "UTP_TRANSPORT_2_4_ABOVE"
75-
},
7671
{
7772
"name": "Unity",
7873
"expression": "6000.1.0a1",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public void UnityTransport_RestartSucceedsAfterFailure()
132132
Assert.False(transport.StartServer());
133133
LogAssert.Expect(LogType.Error, "Invalid network endpoint: 127.0.0.:4242.");
134134

135-
#if HOSTNAME_RESOLUTION_AVAILABLE && UTP_TRANSPORT_2_4_ABOVE
135+
#if HOSTNAME_RESOLUTION_AVAILABLE
136136
LogAssert.Expect(LogType.Error, "Listen network address (127.0.0.) is not a valid Ipv4 or Ipv6 address!");
137137
#else
138138
LogAssert.Expect(LogType.Error, "Network listen address (127.0.0.) is Invalid!");
@@ -166,7 +166,7 @@ public void UnityTransport_StartClientFailsWithBadAddress()
166166
transport.SetConnectionData("foobar", 4242);
167167
Assert.False(transport.StartClient());
168168
LogAssert.Expect(LogType.Error, "Invalid network endpoint: foobar:4242.");
169-
#if HOSTNAME_RESOLUTION_AVAILABLE && UTP_TRANSPORT_2_4_ABOVE
169+
#if HOSTNAME_RESOLUTION_AVAILABLE
170170
LogAssert.Expect(LogType.Error, "Target server network address (foobar) is not a valid Fully Qualified Domain Name!");
171171
#else
172172
LogAssert.Expect(LogType.Error, "Target server network address (foobar) is Invalid!");

com.unity.netcode.gameobjects/Tests/Editor/Unity.Netcode.Editor.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.transport",
43-
"expression": "2.4.0",
44-
"define": "UTP_TRANSPORT_2_4_ABOVE"
45-
},
4641
{
4742
"name": "Unity",
4843
"expression": "6000.1.0a1",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void DetectInvalidEndpoint()
6767
m_Clients[0].ConnectionData.Address = "MoreFubar";
6868
Assert.False(m_Server.StartServer(), "Server failed to detect invalid endpoint!");
6969
Assert.False(m_Clients[0].StartClient(), "Client failed to detect invalid endpoint!");
70-
#if HOSTNAME_RESOLUTION_AVAILABLE && UTP_TRANSPORT_2_4_ABOVE
70+
#if HOSTNAME_RESOLUTION_AVAILABLE
7171
LogAssert.Expect(LogType.Error, $"Listen network address ({m_Server.ConnectionData.Address}) is not a valid {Networking.Transport.NetworkFamily.Ipv4} or {Networking.Transport.NetworkFamily.Ipv6} address!");
7272
LogAssert.Expect(LogType.Error, $"Target server network address ({m_Clients[0].ConnectionData.Address}) is not a valid Fully Qualified Domain Name!");
7373

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
@@ -48,11 +48,6 @@
4848
"expression": "",
4949
"define": "COM_UNITY_MODULES_PHYSICS"
5050
},
51-
{
52-
"name": "com.unity.transport",
53-
"expression": "2.4.0",
54-
"define": "UTP_TRANSPORT_2_4_ABOVE"
55-
},
5651
{
5752
"name": "Unity",
5853
"expression": "6000.1.0a1",

0 commit comments

Comments
 (0)