diff options
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Services/Account')
26 files changed, 112 insertions, 106 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs index f5364329..a6dde3c5 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc { public class AccountManager { - public static readonly UserId DefaultUserId = new UserId("00000000000000010000000000000000"); + public static readonly UserId DefaultUserId = new("00000000000000010000000000000000"); private readonly AccountSaveDataManager _accountSaveDataManager; @@ -51,7 +51,9 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc { commandLineUserProfileOverride = _profiles.Values.FirstOrDefault(x => x.Name == initialProfileName)?.UserId ?? default; if (commandLineUserProfileOverride.IsNull) + { Logger.Warning?.Print(LogClass.Application, $"The command line specified profile named '{initialProfileName}' was not found"); + } } OpenUser(commandLineUserProfileOverride.IsNull ? _accountSaveDataManager.LastOpened : commandLineUserProfileOverride); } @@ -64,7 +66,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc userId = new UserId(Guid.NewGuid().ToString().Replace("-", "")); } - UserProfile profile = new UserProfile(userId, name, image); + UserProfile profile = new(userId, name, image); _profiles.AddOrUpdate(userId.ToString(), profile, (key, old) => profile); @@ -238,4 +240,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc return _profiles.First().Value; } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountSaveDataManager.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountSaveDataManager.cs index 535779d2..c2ae0119 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountSaveDataManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountSaveDataManager.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc { private readonly string _profilesJsonPath = Path.Join(AppDataManager.BaseDirPath, "system", "Profiles.json"); - private static readonly ProfilesJsonSerializerContext SerializerContext = new(JsonHelper.GetDefaultSerializerOptions()); + private static readonly ProfilesJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions()); public UserId LastOpened { get; set; } @@ -23,22 +23,22 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc if (File.Exists(_profilesJsonPath)) { - try + try { - ProfilesJson profilesJson = JsonHelper.DeserializeFromFile(_profilesJsonPath, SerializerContext.ProfilesJson); + ProfilesJson profilesJson = JsonHelper.DeserializeFromFile(_profilesJsonPath, _serializerContext.ProfilesJson); foreach (var profile in profilesJson.Profiles) { - UserProfile addedProfile = new UserProfile(new UserId(profile.UserId), profile.Name, profile.Image, profile.LastModifiedTimestamp); + UserProfile addedProfile = new(new UserId(profile.UserId), profile.Name, profile.Image, profile.LastModifiedTimestamp); profiles.AddOrUpdate(profile.UserId, addedProfile, (key, old) => addedProfile); } LastOpened = new UserId(profilesJson.LastOpened); } - catch (Exception e) + catch (Exception ex) { - Logger.Error?.Print(LogClass.Application, $"Failed to parse {_profilesJsonPath}: {e.Message} Loading default profile!"); + Logger.Error?.Print(LogClass.Application, $"Failed to parse {_profilesJsonPath}: {ex.Message} Loading default profile!"); LastOpened = AccountManager.DefaultUserId; } @@ -51,26 +51,26 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc public void Save(ConcurrentDictionary<string, UserProfile> profiles) { - ProfilesJson profilesJson = new ProfilesJson() + ProfilesJson profilesJson = new() { - Profiles = new List<UserProfileJson>(), - LastOpened = LastOpened.ToString() + Profiles = new List<UserProfileJson>(), + LastOpened = LastOpened.ToString(), }; foreach (var profile in profiles) { profilesJson.Profiles.Add(new UserProfileJson() { - UserId = profile.Value.UserId.ToString(), - Name = profile.Value.Name, - AccountState = profile.Value.AccountState, - OnlinePlayState = profile.Value.OnlinePlayState, + UserId = profile.Value.UserId.ToString(), + Name = profile.Value.Name, + AccountState = profile.Value.AccountState, + OnlinePlayState = profile.Value.OnlinePlayState, LastModifiedTimestamp = profile.Value.LastModifiedTimestamp, - Image = profile.Value.Image, + Image = profile.Value.Image, }); } - JsonHelper.SerializeToFile(_profilesJsonPath, profilesJson, SerializerContext.ProfilesJson); + JsonHelper.SerializeToFile(_profilesJsonPath, profilesJson, _serializerContext.ProfilesJson); } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IManagerForApplication.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IManagerForApplication.cs index 9c058cb5..3cb46d20 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IManagerForApplication.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IManagerForApplication.cs @@ -2,7 +2,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService { class IManagerForApplication : IpcService { - private ManagerServer _managerServer; + private readonly ManagerServer _managerServer; public IManagerForApplication(UserId userId) { @@ -72,4 +72,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService return resultCode; } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IManagerForSystemService.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IManagerForSystemService.cs index ecd51687..8510837b 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IManagerForSystemService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IManagerForSystemService.cs @@ -2,7 +2,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService { class IManagerForSystemService : IpcService { - private ManagerServer _managerServer; + private readonly ManagerServer _managerServer; public IManagerForSystemService(UserId userId) { @@ -44,4 +44,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService return _managerServer.LoadIdTokenCache(context); } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IProfile.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IProfile.cs index 14911dfb..a0021917 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IProfile.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IProfile.cs @@ -2,7 +2,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService { class IProfile : IpcService { - private ProfileServer _profileServer; + private readonly ProfileServer _profileServer; public IProfile(UserProfile profile) { @@ -37,4 +37,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService return _profileServer.LoadImage(context); } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IProfileEditor.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IProfileEditor.cs index 64b6070f..5d5d0dd6 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IProfileEditor.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/IProfileEditor.cs @@ -2,7 +2,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService { class IProfileEditor : IpcService { - private ProfileServer _profileServer; + private readonly ProfileServer _profileServer; public IProfileEditor(UserProfile profile) { @@ -51,4 +51,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService return _profileServer.StoreWithImage(context); } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ManagerServer.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ManagerServer.cs index 97240311..c43186de 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ManagerServer.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ManagerServer.cs @@ -16,7 +16,9 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService // TODO: Determine where and how NetworkServiceAccountId is set. private const long NetworkServiceAccountId = 0xcafe; - private UserId _userId; +#pragma warning disable IDE0052 // Remove unread private member + private readonly UserId _userId; +#pragma warning restore IDE0052 public ManagerServer(UserId userId) { @@ -29,15 +31,15 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService RSAParameters parameters = provider.ExportParameters(true); - RsaSecurityKey secKey = new RsaSecurityKey(parameters); + RsaSecurityKey secKey = new(parameters); - SigningCredentials credentials = new SigningCredentials(secKey, "RS256"); + SigningCredentials credentials = new(secKey, "RS256"); credentials.Key.KeyId = parameters.ToString(); var header = new JwtHeader(credentials) { - { "jku", "https://e0d67c509fb203858ebcb2fe3f88c2aa.baas.nintendo.com/1.0.0/certificates" } + { "jku", "https://e0d67c509fb203858ebcb2fe3f88c2aa.baas.nintendo.com/1.0.0/certificates" }, }; byte[] rawUserId = new byte[0x10]; @@ -60,10 +62,10 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService { "typ", "id_token" }, { "iat", DateTimeOffset.UtcNow.ToUnixTimeSeconds() }, { "jti", Guid.NewGuid().ToString() }, - { "exp", (DateTimeOffset.UtcNow + TimeSpan.FromHours(3)).ToUnixTimeSeconds() } + { "exp", (DateTimeOffset.UtcNow + TimeSpan.FromHours(3)).ToUnixTimeSeconds() }, }; - JwtSecurityToken securityToken = new JwtSecurityToken(header, payload); + JwtSecurityToken securityToken = new(header, payload); return new JwtSecurityTokenHandler().WriteToken(securityToken); } @@ -94,8 +96,8 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService public ResultCode EnsureIdTokenCacheAsync(ServiceCtx context, out IAsyncContext asyncContext) { - KEvent asyncEvent = new KEvent(context.Device.System.KernelContext); - AsyncExecution asyncExecution = new AsyncExecution(asyncEvent); + KEvent asyncEvent = new(context.Device.System.KernelContext); + AsyncExecution asyncExecution = new(asyncEvent); asyncExecution.Initialize(1000, EnsureIdTokenCacheAsyncImpl); @@ -123,7 +125,9 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService public ResultCode LoadIdTokenCache(ServiceCtx context) { ulong bufferPosition = context.Request.ReceiveBuff[0].Position; - ulong bufferSize = context.Request.ReceiveBuff[0].Size; +#pragma warning disable IDE0059 // Remove unnecessary value assignment + ulong bufferSize = context.Request.ReceiveBuff[0].Size; +#pragma warning restore IDE0059 // NOTE: This opens the file at "su/cache/USERID_IN_UUID_STRING.dat" (where USERID_IN_UUID_STRING is formatted as "%08x-%04x-%04x-%02x%02x-%08x%04x") // in the "account:/" savedata and writes some data in the buffer. @@ -169,8 +173,8 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService public ResultCode LoadNetworkServiceLicenseKindAsync(ServiceCtx context, out IAsyncNetworkServiceLicenseKindContext asyncContext) { - KEvent asyncEvent = new KEvent(context.Device.System.KernelContext); - AsyncExecution asyncExecution = new AsyncExecution(asyncEvent); + KEvent asyncEvent = new(context.Device.System.KernelContext); + AsyncExecution asyncExecution = new(asyncEvent); Logger.Stub?.PrintStub(LogClass.ServiceAcc); @@ -184,4 +188,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService return ResultCode.Success; } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ProfileServer.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ProfileServer.cs index 8e29f94b..08400baf 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ProfileServer.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ProfileServer.cs @@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService { class ProfileServer { - private UserProfile _profile; + private readonly UserProfile _profile; public ProfileServer(UserProfile profile) { @@ -23,8 +23,8 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService MemoryHelper.FillWithZeros(context.Memory, bufferPosition, 0x80); // TODO: Determine the struct. - context.Memory.Write(bufferPosition, 0); // Unknown - context.Memory.Write(bufferPosition + 4, 1); // Icon ID. 0 = Mii, the rest are character icon IDs. + context.Memory.Write(bufferPosition, 0); // Unknown + context.Memory.Write(bufferPosition + 4, 1); // Icon ID. 0 = Mii, the rest are character icon IDs. context.Memory.Write(bufferPosition + 8, (byte)1); // Profile icon background color ID // 0x07 bytes - Unknown // 0x10 bytes - Some ID related to the Mii? All zeros when a character icon is used. @@ -58,7 +58,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService public ResultCode LoadImage(ServiceCtx context) { ulong bufferPosition = context.Request.ReceiveBuff[0].Position; - ulong bufferLen = context.Request.ReceiveBuff[0].Size; + ulong bufferLen = context.Request.ReceiveBuff[0].Size; if ((ulong)_profile.Image.Length > bufferLen) { @@ -75,7 +75,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService public ResultCode Store(ServiceCtx context) { ulong userDataPosition = context.Request.PtrBuff[0].Position; - ulong userDataSize = context.Request.PtrBuff[0].Size; + ulong userDataSize = context.Request.PtrBuff[0].Size; byte[] userData = new byte[userDataSize]; @@ -91,14 +91,14 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService public ResultCode StoreWithImage(ServiceCtx context) { ulong userDataPosition = context.Request.PtrBuff[0].Position; - ulong userDataSize = context.Request.PtrBuff[0].Size; + ulong userDataSize = context.Request.PtrBuff[0].Size; byte[] userData = new byte[userDataSize]; context.Memory.Read(userDataPosition, userData); ulong profileImagePosition = context.Request.SendBuff[0].Position; - ulong profileImageSize = context.Request.SendBuff[0].Size; + ulong profileImageSize = context.Request.SendBuff[0].Size; byte[] profileImageData = new byte[profileImageSize]; @@ -111,4 +111,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService return ResultCode.Success; } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/ApplicationServiceServer.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/ApplicationServiceServer.cs index d9f9864a..b30a81e9 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/ApplicationServiceServer.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/ApplicationServiceServer.cs @@ -58,7 +58,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc } ulong outputPosition = context.Request.RecvListBuff[0].Position; - ulong outputSize = context.Request.RecvListBuff[0].Size; + ulong outputSize = context.Request.RecvListBuff[0].Size; MemoryHelper.FillWithZeros(context.Memory, outputPosition, (int)outputSize); @@ -71,7 +71,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc break; } - context.Memory.Write(outputPosition + offset, userProfile.UserId.High); + context.Memory.Write(outputPosition + offset, userProfile.UserId.High); context.Memory.Write(outputPosition + offset + 8, userProfile.UserId.Low); offset += 0x10; @@ -148,7 +148,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc public ResultCode CheckNetworkServiceAvailabilityAsync(ServiceCtx context, out IAsyncContext asyncContext) { - KEvent asyncEvent = new(context.Device.System.KernelContext); + KEvent asyncEvent = new(context.Device.System.KernelContext); AsyncExecution asyncExecution = new(asyncEvent); asyncExecution.Initialize(1000, CheckNetworkServiceAvailabilityAsyncImpl); @@ -183,7 +183,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc } ulong inputPosition = context.Request.SendBuff[0].Position; - ulong inputSize = context.Request.SendBuff[0].Size; + ulong inputSize = context.Request.SendBuff[0].Size; if (inputSize != 0x24000) { @@ -251,4 +251,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc return ResultCode.Success; } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AsyncContext/AsyncExecution.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AsyncContext/AsyncExecution.cs index 2ea92b11..c5f3d91e 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AsyncContext/AsyncExecution.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AsyncContext/AsyncExecution.cs @@ -1,4 +1,4 @@ -using Ryujinx.Common.Logging; +using Ryujinx.Common.Logging; using Ryujinx.HLE.HOS.Kernel.Threading; using System; using System.Threading; @@ -9,18 +9,18 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AsyncContext class AsyncExecution { private readonly CancellationTokenSource _tokenSource; - private readonly CancellationToken _token; + private readonly CancellationToken _token; - public KEvent SystemEvent { get; } - public bool IsInitialized { get; private set; } - public bool IsRunning { get; private set; } + public KEvent SystemEvent { get; } + public bool IsInitialized { get; private set; } + public bool IsRunning { get; private set; } public AsyncExecution(KEvent asyncEvent) { SystemEvent = asyncEvent; _tokenSource = new CancellationTokenSource(); - _token = _tokenSource.Token; + _token = _tokenSource.Token; } public void Initialize(int timeout, Func<CancellationToken, Task> taskAsync) @@ -53,4 +53,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AsyncContext _tokenSource.Cancel(); } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForAdministrator.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForAdministrator.cs index 6a457f04..121b7937 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForAdministrator.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForAdministrator.cs @@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc [Service("acc:su", AccountServiceFlag.Administrator)] // Max Sessions: 8 class IAccountServiceForAdministrator : IpcService { - private ApplicationServiceServer _applicationServiceServer; + private readonly ApplicationServiceServer _applicationServiceServer; public IAccountServiceForAdministrator(ServiceCtx context, AccountServiceFlag serviceFlag) { @@ -126,4 +126,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc return ResultCode.Success; } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs index 8ec83e5c..98af1069 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs @@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc [Service("acc:u0", AccountServiceFlag.Application)] // Max Sessions: 4 class IAccountServiceForApplication : IpcService { - private ApplicationServiceServer _applicationServiceServer; + private readonly ApplicationServiceServer _applicationServiceServer; public IAccountServiceForApplication(ServiceCtx context, AccountServiceFlag serviceFlag) { @@ -197,4 +197,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc return ResultCode.Success; } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForSystemService.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForSystemService.cs index 3b5f3b03..a586d21c 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForSystemService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForSystemService.cs @@ -6,7 +6,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc [Service("acc:u1", AccountServiceFlag.SystemService)] // Max Sessions: 16 class IAccountServiceForSystemService : IpcService { - private ApplicationServiceServer _applicationServiceServer; + private readonly ApplicationServiceServer _applicationServiceServer; public IAccountServiceForSystemService(ServiceCtx context, AccountServiceFlag serviceFlag) { @@ -104,4 +104,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc return _applicationServiceServer.ListQualifiedUsers(context); } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAsyncContext.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAsyncContext.cs index c9af0727..2fa354b1 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAsyncContext.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAsyncContext.cs @@ -1,4 +1,4 @@ -using Ryujinx.HLE.HOS.Ipc; +using Ryujinx.HLE.HOS.Ipc; using Ryujinx.HLE.HOS.Services.Account.Acc.AsyncContext; using Ryujinx.Horizon.Common; using System; @@ -18,12 +18,12 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc // GetSystemEvent() -> handle<copy> public ResultCode GetSystemEvent(ServiceCtx context) { - if (context.Process.HandleTable.GenerateHandle(AsyncExecution.SystemEvent.ReadableEvent, out int _systemEventHandle) != Result.Success) + if (context.Process.HandleTable.GenerateHandle(AsyncExecution.SystemEvent.ReadableEvent, out int systemEventHandle) != Result.Success) { throw new InvalidOperationException("Out of handles!"); } - context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_systemEventHandle); + context.Response.HandleDesc = IpcHandleDesc.MakeCopy(systemEventHandle); return ResultCode.Success; } @@ -76,4 +76,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc return ResultCode.Success; } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAsyncNetworkServiceLicenseKindContext.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAsyncNetworkServiceLicenseKindContext.cs index 1fa5cf2a..a7b0c063 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAsyncNetworkServiceLicenseKindContext.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAsyncNetworkServiceLicenseKindContext.cs @@ -4,7 +4,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc { class IAsyncNetworkServiceLicenseKindContext : IAsyncContext { - private NetworkServiceLicenseKind? _serviceLicenseKind; + private readonly NetworkServiceLicenseKind? _serviceLicenseKind; public IAsyncNetworkServiceLicenseKindContext(AsyncExecution asyncExecution, NetworkServiceLicenseKind? serviceLicenseKind) : base(asyncExecution) { diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/IBaasAccessTokenAccessor.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/IBaasAccessTokenAccessor.cs index 223be2f5..f86e3074 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/IBaasAccessTokenAccessor.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/IBaasAccessTokenAccessor.cs @@ -5,4 +5,4 @@ { public IBaasAccessTokenAccessor(ServiceCtx context) { } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/ProfilesJsonSerializerContext.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/ProfilesJsonSerializerContext.cs index 6b54898e..d6446e73 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/ProfilesJsonSerializerContext.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/ProfilesJsonSerializerContext.cs @@ -8,4 +8,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc internal partial class ProfilesJsonSerializerContext : JsonSerializerContext { } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/AccountServiceFlag.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/AccountServiceFlag.cs index a991f977..5dbf9a67 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/AccountServiceFlag.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/AccountServiceFlag.cs @@ -2,9 +2,9 @@ { enum AccountServiceFlag { - Administrator = 100, - SystemService = 101, - Application = 102, - BaasAccessTokenAccessor = 200 + Administrator = 100, + SystemService = 101, + Application = 102, + BaasAccessTokenAccessor = 200, } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/AccountState.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/AccountState.cs index 1699abfb..0e35b481 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/AccountState.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/AccountState.cs @@ -7,6 +7,6 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc public enum AccountState { Closed, - Open + Open, } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/NetworkServiceLicenseKind.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/NetworkServiceLicenseKind.cs index a33e2670..a766edef 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/NetworkServiceLicenseKind.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/NetworkServiceLicenseKind.cs @@ -3,6 +3,6 @@ enum NetworkServiceLicenseKind : uint { NoSubscription, - Subscribed + Subscribed, } } diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/ProfilesJson.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/ProfilesJson.cs index 09f9d142..4e22f434 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/ProfilesJson.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/ProfilesJson.cs @@ -7,4 +7,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.Types public List<UserProfileJson> Profiles { get; set; } public string LastOpened { get; set; } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserId.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserId.cs index e5577a94..ed7bf4e5 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserId.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserId.cs @@ -15,18 +15,18 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc public bool IsNull => (Low | High) == 0; - public static UserId Null => new UserId(0, 0); + public static UserId Null => new(0, 0); public UserId(long low, long high) { - Low = low; + Low = low; High = high; } public UserId(byte[] bytes) { High = BitConverter.ToInt64(bytes, 0); - Low = BitConverter.ToInt64(bytes, 8); + Low = BitConverter.ToInt64(bytes, 8); } public UserId(string hex) @@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc throw new ArgumentException("Invalid Hex value!", nameof(hex)); } - Low = long.Parse(hex.AsSpan(16), NumberStyles.HexNumber); + Low = long.Parse(hex.AsSpan(16), NumberStyles.HexNumber); High = long.Parse(hex.AsSpan(0, 16), NumberStyles.HexNumber); } @@ -61,4 +61,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc return new UInt128((ulong)High, (ulong)Low); } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserProfile.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserProfile.cs index 210b369c..4482de2d 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserProfile.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserProfile.cs @@ -47,7 +47,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc } } - public AccountState _onlinePlayState; + private AccountState _onlinePlayState; public AccountState OnlinePlayState { @@ -63,10 +63,10 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc public UserProfile(UserId userId, string name, byte[] image, long lastModifiedTimestamp = 0) { UserId = userId; - Name = name; - Image = image; + Name = name; + Image = image; - AccountState = AccountState.Closed; + AccountState = AccountState.Closed; OnlinePlayState = AccountState.Closed; if (lastModifiedTimestamp != 0) @@ -84,4 +84,4 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc LastModifiedTimestamp = (long)(DateTime.Now - DateTime.UnixEpoch).TotalSeconds; } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserProfileJson.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserProfileJson.cs index 06ff4833..e51aa8d1 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserProfileJson.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserProfileJson.cs @@ -9,4 +9,4 @@ public long LastModifiedTimestamp { get; set; } public byte[] Image { get; set; } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Dauth/IService.cs b/src/Ryujinx.HLE/HOS/Services/Account/Dauth/IService.cs index 72301349..698c01a4 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Dauth/IService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Dauth/IService.cs @@ -5,4 +5,4 @@ { public IService(ServiceCtx context) { } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Account/ResultCode.cs b/src/Ryujinx.HLE/HOS/Services/Account/ResultCode.cs index 34114ec9..6bd3cce8 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/ResultCode.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/ResultCode.cs @@ -2,23 +2,23 @@ namespace Ryujinx.HLE.HOS.Services.Account { enum ResultCode { - ModuleId = 124, + ModuleId = 124, ErrorCodeShift = 9, Success = 0, - NullArgument = (20 << ErrorCodeShift) | ModuleId, - InvalidArgument = (22 << ErrorCodeShift) | ModuleId, - NullInputBuffer = (30 << ErrorCodeShift) | ModuleId, - InvalidBufferSize = (31 << ErrorCodeShift) | ModuleId, - InvalidBuffer = (32 << ErrorCodeShift) | ModuleId, - AsyncExecutionNotInitialized = (40 << ErrorCodeShift) | ModuleId, - Unknown41 = (41 << ErrorCodeShift) | ModuleId, - InternetRequestDenied = (59 << ErrorCodeShift) | ModuleId, - UserNotFound = (100 << ErrorCodeShift) | ModuleId, - NullObject = (302 << ErrorCodeShift) | ModuleId, - Unknown341 = (341 << ErrorCodeShift) | ModuleId, + NullArgument = (20 << ErrorCodeShift) | ModuleId, + InvalidArgument = (22 << ErrorCodeShift) | ModuleId, + NullInputBuffer = (30 << ErrorCodeShift) | ModuleId, + InvalidBufferSize = (31 << ErrorCodeShift) | ModuleId, + InvalidBuffer = (32 << ErrorCodeShift) | ModuleId, + AsyncExecutionNotInitialized = (40 << ErrorCodeShift) | ModuleId, + Unknown41 = (41 << ErrorCodeShift) | ModuleId, + InternetRequestDenied = (59 << ErrorCodeShift) | ModuleId, + UserNotFound = (100 << ErrorCodeShift) | ModuleId, + NullObject = (302 << ErrorCodeShift) | ModuleId, + Unknown341 = (341 << ErrorCodeShift) | ModuleId, MissingNetworkServiceLicenseKind = (400 << ErrorCodeShift) | ModuleId, - InvalidIdTokenCacheBufferSize = (451 << ErrorCodeShift) | ModuleId + InvalidIdTokenCacheBufferSize = (451 << ErrorCodeShift) | ModuleId, } } |