diff options
Diffstat (limited to 'src/Ryujinx.Common')
| -rw-r--r-- | src/Ryujinx.Common/Configuration/Multiplayer/MultiplayerMode.cs | 7 | ||||
| -rw-r--r-- | src/Ryujinx.Common/Memory/StructArrayHelpers.cs | 29 | ||||
| -rw-r--r-- | src/Ryujinx.Common/Utilities/NetworkHelpers.cs | 14 |
3 files changed, 49 insertions, 1 deletions
diff --git a/src/Ryujinx.Common/Configuration/Multiplayer/MultiplayerMode.cs b/src/Ryujinx.Common/Configuration/Multiplayer/MultiplayerMode.cs new file mode 100644 index 00000000..16742943 --- /dev/null +++ b/src/Ryujinx.Common/Configuration/Multiplayer/MultiplayerMode.cs @@ -0,0 +1,7 @@ +namespace Ryujinx.Common.Configuration.Multiplayer +{ + public enum MultiplayerMode + { + Disabled, + } +} diff --git a/src/Ryujinx.Common/Memory/StructArrayHelpers.cs b/src/Ryujinx.Common/Memory/StructArrayHelpers.cs index 1e8976ca..65956ed3 100644 --- a/src/Ryujinx.Common/Memory/StructArrayHelpers.cs +++ b/src/Ryujinx.Common/Memory/StructArrayHelpers.cs @@ -791,5 +791,34 @@ namespace Ryujinx.Common.Memory [Pure] public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + + public struct Array140<T> : IArray<T> where T : unmanaged + { + T _e0; + Array64<T> _other; + Array64<T> _other2; + Array11<T> _other3; + public readonly int Length => 140; + public ref T this[int index] => ref AsSpan()[index]; + + [Pure] + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); + } + + public struct Array384<T> : IArray<T> where T : unmanaged + { + T _e0; + Array64<T> _other; + Array64<T> _other2; + Array64<T> _other3; + Array64<T> _other4; + Array64<T> _other5; + Array63<T> _other6; + public readonly int Length => 384; + public ref T this[int index] => ref AsSpan()[index]; + + [Pure] + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); + } } #pragma warning restore CS0169, IDE0051 diff --git a/src/Ryujinx.Common/Utilities/NetworkHelpers.cs b/src/Ryujinx.Common/Utilities/NetworkHelpers.cs index e48ff269..78fb342b 100644 --- a/src/Ryujinx.Common/Utilities/NetworkHelpers.cs +++ b/src/Ryujinx.Common/Utilities/NetworkHelpers.cs @@ -1,4 +1,6 @@ -using System.Net.NetworkInformation; +using System.Buffers.Binary; +using System.Net; +using System.Net.NetworkInformation; namespace Ryujinx.Common.Utilities { @@ -62,5 +64,15 @@ namespace Ryujinx.Common.Utilities return (targetProperties, targetAddressInfo); } + + public static uint ConvertIpv4Address(IPAddress ipAddress) + { + return BinaryPrimitives.ReadUInt32BigEndian(ipAddress.GetAddressBytes()); + } + + public static uint ConvertIpv4Address(string ipAddress) + { + return ConvertIpv4Address(IPAddress.Parse(ipAddress)); + } } } |
