Skip to content

Commit 87bc3c7

Browse files
authored
Merge pull request #389 from AlexHolderDeveloper/patch-1
Modify NetSocket to support Nintendo Switch
2 parents e4c94b4 + f299c9e commit 87bc3c7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

LiteNetLib/NetSocket.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,22 @@ public short Ttl
8585
{
8686
get
8787
{
88+
#if UNITY_SWITCH
89+
return 0;
90+
#else
8891
if (_udpSocketv4.AddressFamily == AddressFamily.InterNetworkV6)
8992
return (short)_udpSocketv4.GetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.HopLimit);
9093
return _udpSocketv4.Ttl;
94+
#endif
9195
}
9296
set
9397
{
98+
#if !UNITY_SWITCH
9499
if (_udpSocketv4.AddressFamily == AddressFamily.InterNetworkV6)
95100
_udpSocketv4.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.HopLimit, value);
96101
else
97102
_udpSocketv4.Ttl = value;
103+
#endif
98104
}
99105
}
100106

0 commit comments

Comments
 (0)