mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-11 05:57:21 +01:00
potentially fix pet transient file removal
This commit is contained in:
parent
b4bd804ad1
commit
c8d5b14aba
2 changed files with 22 additions and 9 deletions
|
|
@ -92,8 +92,7 @@ public sealed class TransientResourceManager : DisposableMediatorSubscriberBase
|
|||
int removedPaths = 0;
|
||||
foreach (var replacement in fileReplacement.Where(p => !p.HasFileReplacement).SelectMany(p => p.GamePaths).ToList())
|
||||
{
|
||||
removedPaths++;
|
||||
PlayerConfig.RemovePath(replacement);
|
||||
removedPaths += PlayerConfig.RemovePath(replacement, objectKind);
|
||||
value.Remove(replacement);
|
||||
}
|
||||
|
||||
|
|
@ -172,7 +171,7 @@ public sealed class TransientResourceManager : DisposableMediatorSubscriberBase
|
|||
resources.RemoveWhere(f => string.Equals(path, f, StringComparison.Ordinal));
|
||||
if (objectKind == ObjectKind.Player)
|
||||
{
|
||||
PlayerConfig.RemovePath(path);
|
||||
PlayerConfig.RemovePath(path, objectKind);
|
||||
Logger.LogTrace("Saving transient.json from {method}", nameof(RemoveTransientResource));
|
||||
_configurationService.Save();
|
||||
}
|
||||
|
|
@ -219,7 +218,7 @@ public sealed class TransientResourceManager : DisposableMediatorSubscriberBase
|
|||
foreach (var file in semiset.Where(p => list.Contains(p, StringComparer.OrdinalIgnoreCase)))
|
||||
{
|
||||
Logger.LogTrace("Removing From SemiTransient: {file}", file);
|
||||
PlayerConfig.RemovePath(file);
|
||||
PlayerConfig.RemovePath(file, objectKind);
|
||||
}
|
||||
|
||||
int removed = semiset.RemoveWhere(p => list.Contains(p, StringComparer.OrdinalIgnoreCase));
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
namespace MareSynchronos.MareConfiguration.Configurations;
|
||||
using MareSynchronos.API.Data.Enum;
|
||||
|
||||
namespace MareSynchronos.MareConfiguration.Configurations;
|
||||
|
||||
public class TransientConfig : IMareConfiguration
|
||||
{
|
||||
|
|
@ -35,14 +37,26 @@ public class TransientConfig : IMareConfiguration
|
|||
return false;
|
||||
}
|
||||
|
||||
public void RemovePath(string gamePath)
|
||||
public int RemovePath(string gamePath, ObjectKind objectKind)
|
||||
{
|
||||
GlobalPersistentCache.Remove(gamePath);
|
||||
int removedEntries = 0;
|
||||
if (objectKind == ObjectKind.Player)
|
||||
{
|
||||
if (GlobalPersistentCache.Remove(gamePath)) removedEntries++;
|
||||
foreach (var kvp in JobSpecificCache)
|
||||
{
|
||||
kvp.Value.Remove(gamePath);
|
||||
if (kvp.Value.Remove(gamePath)) removedEntries++;
|
||||
}
|
||||
}
|
||||
if (objectKind == ObjectKind.Pet)
|
||||
{
|
||||
foreach (var kvp in JobSpecificPetCache)
|
||||
{
|
||||
if (kvp.Value.Remove(gamePath)) removedEntries++;
|
||||
}
|
||||
}
|
||||
return removedEntries;
|
||||
}
|
||||
|
||||
public void AddOrElevate(uint jobId, string gamePath)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue