From 1746983adcb0421fb78d9f5b33f78d9a42ad780b Mon Sep 17 00:00:00 2001 From: emmaus Date: Thu, 27 Sep 2018 10:14:46 +0000 Subject: [PATCH] remove zero userid check --- Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs | 4 ++-- Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs | 4 ++-- .../HOS/Services/FspSrv/IFileSystemProxy.cs | 2 +- Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs | 2 +- Ryujinx.HLE/HOS/SystemState/UserId.cs | 14 ++------------ 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs b/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs index 0fd02659ce..8fd7bfeafd 100644 --- a/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs +++ b/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs @@ -39,7 +39,7 @@ namespace Ryujinx.HLE.HOS.Services.Acc { UserId Uuid = new UserId( Context.RequestData.ReadInt64(), - Context.RequestData.ReadInt64(), false); + Context.RequestData.ReadInt64()); Context.ResponseData.Write(Context.Device.System.State.TryGetUser(Uuid, out _) ? 1 : 0); @@ -94,7 +94,7 @@ namespace Ryujinx.HLE.HOS.Services.Acc { UserId Uuid = new UserId( Context.RequestData.ReadInt64(), - Context.RequestData.ReadInt64(), false); + Context.RequestData.ReadInt64()); if (!Context.Device.System.State.TryGetUser(Uuid, out UserProfile Profile)) { diff --git a/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs b/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs index 3ba8306aee..d476f5d027 100644 --- a/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs +++ b/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs @@ -63,7 +63,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend { UserId Uuid = new UserId( Context.RequestData.ReadInt64(), - Context.RequestData.ReadInt64(), false); + Context.RequestData.ReadInt64()); if (Context.Device.System.State.TryGetUser(Uuid, out UserProfile Profile)) { @@ -81,7 +81,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend { UserId Uuid = new UserId( Context.RequestData.ReadInt64(), - Context.RequestData.ReadInt64(), false); + Context.RequestData.ReadInt64()); long Unknown0 = Context.RequestData.ReadInt64(); diff --git a/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs b/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs index e6738b8f04..937ea6d6bf 100644 --- a/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs +++ b/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs @@ -80,7 +80,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv UserId UserId = new UserId( Context.RequestData.ReadInt64(), - Context.RequestData.ReadInt64(), false); + Context.RequestData.ReadInt64()); long SaveId = Context.RequestData.ReadInt64(); diff --git a/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs b/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs index 71c211968b..e928fa5d51 100644 --- a/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs +++ b/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs @@ -57,7 +57,7 @@ namespace Ryujinx.HLE.HOS.SystemState Profiles = new ConcurrentDictionary(); - UserId DefaultUuid = new UserId("00000000000000000000000000000001", true); + UserId DefaultUuid = new UserId("00000000000000000000000000000001"); AddUser(DefaultUuid, "Player"); diff --git a/Ryujinx.HLE/HOS/SystemState/UserId.cs b/Ryujinx.HLE/HOS/SystemState/UserId.cs index b1b1bfed01..118af385ad 100644 --- a/Ryujinx.HLE/HOS/SystemState/UserId.cs +++ b/Ryujinx.HLE/HOS/SystemState/UserId.cs @@ -11,13 +11,8 @@ namespace Ryujinx.HLE.HOS.SystemState public byte[] Bytes { get; private set; } - public UserId(long Low, long High, bool Verify) + public UserId(long Low, long High) { - if ((Low | High) == 0 && Verify) - { - throw new ArgumentException("Zero is not a valid user id!"); - } - byte[] Bytes = new byte[16]; int Index = Bytes.Length; @@ -43,18 +38,13 @@ namespace Ryujinx.HLE.HOS.SystemState this.Bytes = Bytes; } - public UserId(string UserIdHex, bool Verify) + public UserId(string UserIdHex) { if (UserIdHex == null || UserIdHex.Length != 32 || !UserIdHex.All("0123456789abcdefABCDEF".Contains)) { throw new ArgumentException("Invalid user id!", nameof(UserIdHex)); } - if (UserIdHex == "00000000000000000000000000000000" && Verify) - { - throw new ArgumentException("Zero is not a valid user id!", nameof(UserIdHex)); - } - this.UserIdHex = UserIdHex.ToUpper(); Bytes = StringUtils.HexToBytes(UserIdHex);