You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-15 06:36:30 +09:00
First iteration improved multiplatform support
This commit is contained in:
@@ -4,6 +4,10 @@ using System.Text;
|
||||
using System.Reflection;
|
||||
using System.Net;
|
||||
|
||||
#if !__NOIPENDPOINT__
|
||||
using NetEndPoint = System.Net.IPEndPoint;
|
||||
#endif
|
||||
|
||||
namespace Lidgren.Network
|
||||
{
|
||||
/// <summary>
|
||||
@@ -638,14 +642,14 @@ namespace Lidgren.Network
|
||||
/// <summary>
|
||||
/// Reads a stored IPv4 endpoint description
|
||||
/// </summary>
|
||||
public IPEndPoint ReadIPEndPoint()
|
||||
public NetEndPoint ReadIPEndPoint()
|
||||
{
|
||||
byte len = ReadByte();
|
||||
byte[] addressBytes = ReadBytes(len);
|
||||
int port = (int)ReadUInt16();
|
||||
|
||||
IPAddress address = new IPAddress(addressBytes);
|
||||
return new IPEndPoint(address, port);
|
||||
var address = NetUtility.CreateAddressFromBytes(addressBytes);
|
||||
return new NetEndPoint(address, port);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user