Build 0.21.1.0

This commit is contained in:
Markus Isberg
2023-01-13 18:10:35 +02:00
parent 2f7205fb4b
commit 697ec52120
155 changed files with 2423 additions and 1237 deletions
@@ -192,6 +192,22 @@ namespace Steamworks.Ugc
}
}
/// <summary>
/// If installed, the time and date of installation
/// </summary>
public DateTime? InstallTime
{
get
{
ulong size = 0;
uint ts = 0;
if ( !SteamUGC.Internal.GetItemInstallInfo( Id, ref size, out _, ref ts ) )
return null;
return Epoch.ToDateTime(ts);
}
}
/// <summary>
/// File size as returned by Steamworks,
/// no download/install required
+24 -3
View File
@@ -124,7 +124,24 @@ namespace Lidgren.Network
m_lastSocketBind = now;
if (m_socket == null)
m_socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Dgram, ProtocolType.Udp);
{
try
{
m_socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Dgram, ProtocolType.Udp);
}
catch (SocketException socketException)
{
if (socketException.SocketErrorCode == SocketError.AddressFamilyNotSupported)
{
// Fall back to IPv4 if IPv6 is unsupported
m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
}
else
{
throw;
}
}
}
if (reBind)
m_socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, (int)1);
@@ -132,9 +149,9 @@ namespace Lidgren.Network
m_socket.ReceiveBufferSize = m_configuration.ReceiveBufferSize;
m_socket.SendBufferSize = m_configuration.SendBufferSize;
m_socket.Blocking = false;
m_socket.DualMode = m_configuration.UseDualModeSockets;
if (m_socket.AddressFamily == AddressFamily.InterNetworkV6) { m_socket.DualMode = m_configuration.UseDualModeSockets; }
var ep = (EndPoint)new NetEndPoint(m_configuration.LocalAddress.MapToIPv6(), reBind ? m_listenPort : m_configuration.Port);
var ep = (EndPoint)new NetEndPoint(m_configuration.LocalAddress.MapToFamily(m_socket.AddressFamily), reBind ? m_listenPort : m_configuration.Port);
m_socket.Bind(ep);
try
@@ -413,6 +430,10 @@ namespace Lidgren.Network
int bytesReceived = 0;
try
{
if (m_senderRemote is IPEndPoint ipEndpoint && ipEndpoint.AddressFamily != m_socket.AddressFamily)
{
m_senderRemote = ipEndpoint.MapToFamily(m_socket.AddressFamily);
}
bytesReceived = m_socket.ReceiveFrom(m_receiveBuffer, 0, m_receiveBuffer.Length, SocketFlags.None, ref m_senderRemote);
}
catch (SocketException sx)
@@ -136,7 +136,7 @@ namespace Lidgren.Network
{
connectionReset = false;
target = NetUtility.MapToIPv6(target);
target = target.MapToFamily(m_socket.AddressFamily);
IPAddress ba = default(IPAddress);
try
+1 -1
View File
@@ -293,7 +293,7 @@ namespace Lidgren.Network
if (remoteEndPoint == null)
throw new ArgumentNullException("remoteEndPoint");
remoteEndPoint = NetUtility.MapToIPv6(remoteEndPoint);
remoteEndPoint = remoteEndPoint.MapToFamily(m_socket.AddressFamily);
lock (m_connections)
{
+19 -11
View File
@@ -454,16 +454,24 @@ namespace Lidgren.Network
return ComputeSHAHash(bytes, 0, bytes.Length);
}
/// <summary>
/// Maps the IPEndPoint object to an IPv6 address, if it is currently mapped to an IPv4 address.
/// </summary>
internal static IPEndPoint MapToIPv6(IPEndPoint endPoint)
{
if (endPoint.AddressFamily == AddressFamily.InterNetwork)
{
return new IPEndPoint(endPoint.Address.MapToIPv6(), endPoint.Port);
}
return endPoint;
}
internal static IPAddress MapToFamily(this IPAddress address, AddressFamily family)
{
switch (family)
{
case AddressFamily.InterNetworkV6:
return address.MapToIPv6();
case AddressFamily.InterNetwork:
return address.MapToIPv4();
default:
throw new Exception($"Unsupported address family: {family}");
}
}
internal static IPEndPoint MapToFamily(this IPEndPoint endpoint, AddressFamily family)
{
return endpoint.Address.AddressFamily == family
? endpoint
: new IPEndPoint(endpoint.Address.MapToFamily(family), endpoint.Port);
}
}
}
@@ -12,15 +12,22 @@ namespace Microsoft.Xna.Framework.Graphics
{
public interface ISpriteBatch
{
public void Draw(Texture2D texture,
Vector2 position,
Rectangle? sourceRectangle,
Color color,
float rotation,
Vector2 origin,
Vector2 scale,
SpriteEffects effects,
float layerDepth);
public void Draw(
Texture2D texture,
Vector2 position,
Rectangle? sourceRectangle,
Color color,
float rotation,
Vector2 origin,
Vector2 scale,
SpriteEffects effects,
float layerDepth);
public void Draw(
Texture2D texture,
VertexPositionColorTexture[] vertices,
float layerDepth,
int? count = null);
}
/// <summary>