mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Ensure LocationResolverSet is updated for 13.1.0
This commit is contained in:
parent
e0deb7ea54
commit
04a2e51cfa
1 changed files with 8 additions and 10 deletions
|
@ -39,7 +39,7 @@ internal struct LocationResolverSetGlobals
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Manages resolving the location of NCAs via the <c>lr</c> service.
|
/// Manages resolving the location of NCAs via the <c>lr</c> service.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Based on FS 12.1.0 (nnSdk 12.3.1)</remarks>
|
/// <remarks>Based on FS 13.1.0 (nnSdk 13.4.0)</remarks>
|
||||||
internal class LocationResolverSet : IDisposable
|
internal class LocationResolverSet : IDisposable
|
||||||
{
|
{
|
||||||
private Array5<Optional<LocationResolver>> _resolvers;
|
private Array5<Optional<LocationResolver>> _resolvers;
|
||||||
|
@ -52,7 +52,7 @@ internal class LocationResolverSet : IDisposable
|
||||||
|
|
||||||
public LocationResolverSet(FileSystemServer fsServer)
|
public LocationResolverSet(FileSystemServer fsServer)
|
||||||
{
|
{
|
||||||
_mutex.Initialize();
|
_mutex = new SdkMutexType();
|
||||||
_fsServer = fsServer;
|
_fsServer = fsServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,6 +129,8 @@ internal class LocationResolverSet : IDisposable
|
||||||
|
|
||||||
private Result GetAddOnContentLocationResolver(out AddOnContentLocationResolver resolver)
|
private Result GetAddOnContentLocationResolver(out AddOnContentLocationResolver resolver)
|
||||||
{
|
{
|
||||||
|
UnsafeHelpers.SkipParamInit(out resolver);
|
||||||
|
|
||||||
_fsServer.InitializeLocationResolverSet();
|
_fsServer.InitializeLocationResolverSet();
|
||||||
|
|
||||||
using ScopedLock<SdkMutexType> scopedLock = ScopedLock.Lock(ref _mutex);
|
using ScopedLock<SdkMutexType> scopedLock = ScopedLock.Lock(ref _mutex);
|
||||||
|
@ -136,13 +138,9 @@ internal class LocationResolverSet : IDisposable
|
||||||
if (!_aocResolver.HasValue)
|
if (!_aocResolver.HasValue)
|
||||||
{
|
{
|
||||||
Result rc = Hos.Lr.OpenAddOnContentLocationResolver(out AddOnContentLocationResolver lr);
|
Result rc = Hos.Lr.OpenAddOnContentLocationResolver(out AddOnContentLocationResolver lr);
|
||||||
if (rc.IsFailure())
|
if (rc.IsFailure()) return rc.Miss();
|
||||||
{
|
|
||||||
UnsafeHelpers.SkipParamInit(out resolver);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
_aocResolver = lr;
|
_aocResolver.Set(in lr);
|
||||||
}
|
}
|
||||||
|
|
||||||
resolver = _aocResolver.Value;
|
resolver = _aocResolver.Value;
|
||||||
|
@ -283,11 +281,11 @@ internal class LocationResolverSet : IDisposable
|
||||||
|
|
||||||
return id switch
|
return id switch
|
||||||
{
|
{
|
||||||
StorageId.Host => 2,
|
|
||||||
StorageId.GameCard => 4,
|
|
||||||
StorageId.BuiltInSystem => 0,
|
StorageId.BuiltInSystem => 0,
|
||||||
StorageId.BuiltInUser => 1,
|
StorageId.BuiltInUser => 1,
|
||||||
|
StorageId.Host => 2,
|
||||||
StorageId.SdCard => 3,
|
StorageId.SdCard => 3,
|
||||||
|
StorageId.GameCard => 4,
|
||||||
_ => -1
|
_ => -1
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue