revert transient mdl/mtrl/tex
This commit is contained in:
@@ -16,7 +16,7 @@ public sealed class TransientResourceManager : DisposableMediatorSubscriberBase
|
||||
private readonly HashSet<string> _cachedHandledPaths = new(StringComparer.Ordinal);
|
||||
private readonly TransientConfigService _configurationService;
|
||||
private readonly DalamudUtilService _dalamudUtil;
|
||||
private readonly string[] _fileTypesToHandle = ["tmb", "pap", "avfx", "atex", "sklb", "eid", "phyb", "scd", "skp", "shpk", "mdl", "mtrl", "tex"];
|
||||
private readonly string[] _fileTypesToHandle = ["tmb", "pap", "avfx", "atex", "sklb", "eid", "phyb", "scd", "skp", "shpk"];
|
||||
private readonly HashSet<GameObjectHandler> _playerRelatedPointers = [];
|
||||
private ConcurrentDictionary<IntPtr, ObjectKind> _cachedFrameAddresses = [];
|
||||
private ConcurrentDictionary<ObjectKind, HashSet<string>>? _semiTransientResources = null;
|
||||
|
||||
@@ -6,11 +6,16 @@ using Newtonsoft.Json;
|
||||
|
||||
namespace MareSynchronos.MareConfiguration;
|
||||
|
||||
public class ConfigurationMigrator(ILogger<ConfigurationMigrator> logger, IDalamudPluginInterface pi) : IHostedService
|
||||
public class ConfigurationMigrator(ILogger<ConfigurationMigrator> logger, TransientConfigService transientConfigService) : IHostedService
|
||||
{
|
||||
public void Migrate()
|
||||
{
|
||||
// currently nothing to migrate
|
||||
if (transientConfigService.Current.Version == 0)
|
||||
{
|
||||
transientConfigService.Current.TransientConfigs.Clear();
|
||||
transientConfigService.Current.Version = 1;
|
||||
transientConfigService.Save();
|
||||
}
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
@@ -23,11 +28,4 @@ public class ConfigurationMigrator(ILogger<ConfigurationMigrator> logger, IDalam
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private static void SaveConfig(IMareConfiguration config, string path)
|
||||
{
|
||||
File.WriteAllText(path, JsonConvert.SerializeObject(config, Formatting.Indented));
|
||||
}
|
||||
|
||||
private string ConfigurationPath(string configName) => Path.Combine(pi.ConfigDirectory.FullName, configName);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
public class TransientConfig : IMareConfiguration
|
||||
{
|
||||
public Dictionary<string, TransientPlayerConfig> TransientConfigs { get; set; } = [];
|
||||
public int Version { get; set; } = 0;
|
||||
public int Version { get; set; } = 1;
|
||||
|
||||
public class TransientPlayerConfig
|
||||
{
|
||||
|
||||
@@ -182,7 +182,7 @@ public sealed class Plugin : IDalamudPlugin
|
||||
collection.AddSingleton<IConfigService<IMareConfiguration>>(s => s.GetRequiredService<XivDataStorageService>());
|
||||
collection.AddSingleton<IConfigService<IMareConfiguration>>(s => s.GetRequiredService<PlayerPerformanceConfigService>());
|
||||
collection.AddSingleton<IConfigService<IMareConfiguration>>(s => s.GetRequiredService<CharaDataConfigService>());
|
||||
collection.AddSingleton((s) => new ConfigurationMigrator(s.GetRequiredService<ILogger<ConfigurationMigrator>>(), pluginInterface));
|
||||
collection.AddSingleton<ConfigurationMigrator>();
|
||||
collection.AddSingleton<ConfigurationSaveService>();
|
||||
|
||||
collection.AddSingleton<HubFactory>();
|
||||
|
||||
Reference in New Issue
Block a user