remove zero userid check
This commit is contained in:
parent
263bb21dbb
commit
1746983adc
5 changed files with 8 additions and 18 deletions
|
@ -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))
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace Ryujinx.HLE.HOS.SystemState
|
|||
|
||||
Profiles = new ConcurrentDictionary<string, UserProfile>();
|
||||
|
||||
UserId DefaultUuid = new UserId("00000000000000000000000000000001", true);
|
||||
UserId DefaultUuid = new UserId("00000000000000000000000000000001");
|
||||
|
||||
AddUser(DefaultUuid, "Player");
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue