changed lightless references from you know what
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using LightlessSync.Interop.Ipc;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.Services;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Utils;
|
||||
@@ -11,7 +11,7 @@ namespace LightlessSync.FileCache;
|
||||
|
||||
public sealed class CacheMonitor : DisposableMediatorSubscriberBase
|
||||
{
|
||||
private readonly MareConfigService _configService;
|
||||
private readonly LightlessConfigService _configService;
|
||||
private readonly DalamudUtilService _dalamudUtil;
|
||||
private readonly FileCompactor _fileCompactor;
|
||||
private readonly FileCacheManager _fileDbManager;
|
||||
@@ -22,8 +22,8 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase
|
||||
private readonly CancellationTokenSource _periodicCalculationTokenSource = new();
|
||||
public static readonly IImmutableList<string> AllowedFileExtensions = [".mdl", ".tex", ".mtrl", ".tmb", ".pap", ".avfx", ".atex", ".sklb", ".eid", ".phyb", ".pbd", ".scd", ".skp", ".shpk"];
|
||||
|
||||
public CacheMonitor(ILogger<CacheMonitor> logger, IpcManager ipcManager, MareConfigService configService,
|
||||
FileCacheManager fileDbManager, MareMediator mediator, PerformanceCollectorService performanceCollector, DalamudUtilService dalamudUtil,
|
||||
public CacheMonitor(ILogger<CacheMonitor> logger, IpcManager ipcManager, LightlessConfigService configService,
|
||||
FileCacheManager fileDbManager, LightlessMediator mediator, PerformanceCollectorService performanceCollector, DalamudUtilService dalamudUtil,
|
||||
FileCompactor fileCompactor) : base(logger, mediator)
|
||||
{
|
||||
_ipcManager = ipcManager;
|
||||
@@ -35,14 +35,14 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase
|
||||
Mediator.Subscribe<PenumbraInitializedMessage>(this, (_) =>
|
||||
{
|
||||
StartPenumbraWatcher(_ipcManager.Penumbra.ModDirectory);
|
||||
StartMareWatcher(configService.Current.CacheFolder);
|
||||
StartLightlessWatcher(configService.Current.CacheFolder);
|
||||
InvokeScan();
|
||||
});
|
||||
Mediator.Subscribe<HaltScanMessage>(this, (msg) => HaltScan(msg.Source));
|
||||
Mediator.Subscribe<ResumeScanMessage>(this, (msg) => ResumeScan(msg.Source));
|
||||
Mediator.Subscribe<DalamudLoginMessage>(this, (_) =>
|
||||
{
|
||||
StartMareWatcher(configService.Current.CacheFolder);
|
||||
StartLightlessWatcher(configService.Current.CacheFolder);
|
||||
StartPenumbraWatcher(_ipcManager.Penumbra.ModDirectory);
|
||||
InvokeScan();
|
||||
});
|
||||
@@ -57,7 +57,7 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase
|
||||
}
|
||||
if (configService.Current.HasValidSetup())
|
||||
{
|
||||
StartMareWatcher(configService.Current.CacheFolder);
|
||||
StartLightlessWatcher(configService.Current.CacheFolder);
|
||||
InvokeScan();
|
||||
}
|
||||
|
||||
@@ -102,37 +102,37 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase
|
||||
|
||||
record WatcherChange(WatcherChangeTypes ChangeType, string? OldPath = null);
|
||||
private readonly Dictionary<string, WatcherChange> _watcherChanges = new Dictionary<string, WatcherChange>(StringComparer.OrdinalIgnoreCase);
|
||||
private readonly Dictionary<string, WatcherChange> _mareChanges = new Dictionary<string, WatcherChange>(StringComparer.OrdinalIgnoreCase);
|
||||
private readonly Dictionary<string, WatcherChange> _lightlessChanges = new Dictionary<string, WatcherChange>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
public void StopMonitoring()
|
||||
{
|
||||
Logger.LogInformation("Stopping monitoring of Penumbra and Mare storage folders");
|
||||
MareWatcher?.Dispose();
|
||||
Logger.LogInformation("Stopping monitoring of Penumbra and Lightless storage folders");
|
||||
LightlessWatcher?.Dispose();
|
||||
PenumbraWatcher?.Dispose();
|
||||
MareWatcher = null;
|
||||
LightlessWatcher = null;
|
||||
PenumbraWatcher = null;
|
||||
}
|
||||
|
||||
public bool StorageisNTFS { get; private set; } = false;
|
||||
|
||||
public void StartMareWatcher(string? marePath)
|
||||
public void StartLightlessWatcher(string? lightlessPath)
|
||||
{
|
||||
MareWatcher?.Dispose();
|
||||
if (string.IsNullOrEmpty(marePath) || !Directory.Exists(marePath))
|
||||
LightlessWatcher?.Dispose();
|
||||
if (string.IsNullOrEmpty(lightlessPath) || !Directory.Exists(lightlessPath))
|
||||
{
|
||||
MareWatcher = null;
|
||||
Logger.LogWarning("Mare file path is not set, cannot start the FSW for Mare.");
|
||||
LightlessWatcher = null;
|
||||
Logger.LogWarning("Lightless file path is not set, cannot start the FSW for Lightless.");
|
||||
return;
|
||||
}
|
||||
|
||||
DriveInfo di = new(new DirectoryInfo(_configService.Current.CacheFolder).Root.FullName);
|
||||
StorageisNTFS = string.Equals("NTFS", di.DriveFormat, StringComparison.OrdinalIgnoreCase);
|
||||
Logger.LogInformation("Mare Storage is on NTFS drive: {isNtfs}", StorageisNTFS);
|
||||
Logger.LogInformation("Lightless Storage is on NTFS drive: {isNtfs}", StorageisNTFS);
|
||||
|
||||
Logger.LogDebug("Initializing Mare FSW on {path}", marePath);
|
||||
MareWatcher = new()
|
||||
Logger.LogDebug("Initializing Lightless FSW on {path}", lightlessPath);
|
||||
LightlessWatcher = new()
|
||||
{
|
||||
Path = marePath,
|
||||
Path = lightlessPath,
|
||||
InternalBufferSize = 8388608,
|
||||
NotifyFilter = NotifyFilters.CreationTime
|
||||
| NotifyFilters.LastWrite
|
||||
@@ -143,23 +143,23 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase
|
||||
IncludeSubdirectories = false,
|
||||
};
|
||||
|
||||
MareWatcher.Deleted += MareWatcher_FileChanged;
|
||||
MareWatcher.Created += MareWatcher_FileChanged;
|
||||
MareWatcher.EnableRaisingEvents = true;
|
||||
LightlessWatcher.Deleted += LightlessWatcher_FileChanged;
|
||||
LightlessWatcher.Created += LightlessWatcher_FileChanged;
|
||||
LightlessWatcher.EnableRaisingEvents = true;
|
||||
}
|
||||
|
||||
private void MareWatcher_FileChanged(object sender, FileSystemEventArgs e)
|
||||
private void LightlessWatcher_FileChanged(object sender, FileSystemEventArgs e)
|
||||
{
|
||||
Logger.LogTrace("Mare FSW: FileChanged: {change} => {path}", e.ChangeType, e.FullPath);
|
||||
Logger.LogTrace("Lightless FSW: FileChanged: {change} => {path}", e.ChangeType, e.FullPath);
|
||||
|
||||
if (!AllowedFileExtensions.Any(ext => e.FullPath.EndsWith(ext, StringComparison.OrdinalIgnoreCase))) return;
|
||||
|
||||
lock (_watcherChanges)
|
||||
{
|
||||
_mareChanges[e.FullPath] = new(e.ChangeType);
|
||||
_lightlessChanges[e.FullPath] = new(e.ChangeType);
|
||||
}
|
||||
|
||||
_ = MareWatcherExecution();
|
||||
_ = LightlessWatcherExecution();
|
||||
}
|
||||
|
||||
public void StartPenumbraWatcher(string? penumbraPath)
|
||||
@@ -247,18 +247,18 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase
|
||||
}
|
||||
|
||||
private CancellationTokenSource _penumbraFswCts = new();
|
||||
private CancellationTokenSource _mareFswCts = new();
|
||||
private CancellationTokenSource _lightlessFswCts = new();
|
||||
public FileSystemWatcher? PenumbraWatcher { get; private set; }
|
||||
public FileSystemWatcher? MareWatcher { get; private set; }
|
||||
public FileSystemWatcher? LightlessWatcher { get; private set; }
|
||||
|
||||
private async Task MareWatcherExecution()
|
||||
private async Task LightlessWatcherExecution()
|
||||
{
|
||||
_mareFswCts = _mareFswCts.CancelRecreate();
|
||||
var token = _mareFswCts.Token;
|
||||
_lightlessFswCts = _lightlessFswCts.CancelRecreate();
|
||||
var token = _lightlessFswCts.Token;
|
||||
var delay = TimeSpan.FromSeconds(5);
|
||||
Dictionary<string, WatcherChange> changes;
|
||||
lock (_mareChanges)
|
||||
changes = _mareChanges.ToDictionary(t => t.Key, t => t.Value, StringComparer.Ordinal);
|
||||
lock (_lightlessChanges)
|
||||
changes = _lightlessChanges.ToDictionary(t => t.Key, t => t.Value, StringComparer.Ordinal);
|
||||
try
|
||||
{
|
||||
do
|
||||
@@ -271,11 +271,11 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase
|
||||
return;
|
||||
}
|
||||
|
||||
lock (_mareChanges)
|
||||
lock (_lightlessChanges)
|
||||
{
|
||||
foreach (var key in changes.Keys)
|
||||
{
|
||||
_mareChanges.Remove(key);
|
||||
_lightlessChanges.Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,9 +458,9 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase
|
||||
base.Dispose(disposing);
|
||||
_scanCancellationTokenSource?.Cancel();
|
||||
PenumbraWatcher?.Dispose();
|
||||
MareWatcher?.Dispose();
|
||||
LightlessWatcher?.Dispose();
|
||||
_penumbraFswCts?.CancelDispose();
|
||||
_mareFswCts?.CancelDispose();
|
||||
_lightlessFswCts?.CancelDispose();
|
||||
_periodicCalculationTokenSource?.CancelDispose();
|
||||
}
|
||||
|
||||
@@ -478,7 +478,7 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase
|
||||
if (string.IsNullOrEmpty(_configService.Current.CacheFolder) || !Directory.Exists(_configService.Current.CacheFolder))
|
||||
{
|
||||
cacheDirExists = false;
|
||||
Logger.LogWarning("Mare Cache directory is not set or does not exist.");
|
||||
Logger.LogWarning("Lightless Cache directory is not set or does not exist.");
|
||||
}
|
||||
if (!penDirExists || !cacheDirExists)
|
||||
{
|
||||
@@ -681,7 +681,7 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase
|
||||
{
|
||||
_configService.Current.InitialScanComplete = true;
|
||||
_configService.Save();
|
||||
StartMareWatcher(_configService.Current.CacheFolder);
|
||||
StartLightlessWatcher(_configService.Current.CacheFolder);
|
||||
StartPenumbraWatcher(penumbraDir);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using K4os.Compression.LZ4.Legacy;
|
||||
using LightlessSync.Interop.Ipc;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Utils;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
@@ -16,8 +16,8 @@ public sealed class FileCacheManager : IHostedService
|
||||
public const string CachePrefix = "{cache}";
|
||||
public const string CsvSplit = "|";
|
||||
public const string PenumbraPrefix = "{penumbra}";
|
||||
private readonly MareConfigService _configService;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessConfigService _configService;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
private readonly string _csvPath;
|
||||
private readonly ConcurrentDictionary<string, List<FileCacheEntity>> _fileCaches = new(StringComparer.Ordinal);
|
||||
private readonly SemaphoreSlim _getCachesByPathsSemaphore = new(1, 1);
|
||||
@@ -26,12 +26,12 @@ public sealed class FileCacheManager : IHostedService
|
||||
private readonly ILogger<FileCacheManager> _logger;
|
||||
public string CacheFolder => _configService.Current.CacheFolder;
|
||||
|
||||
public FileCacheManager(ILogger<FileCacheManager> logger, IpcManager ipcManager, MareConfigService configService, MareMediator mareMediator)
|
||||
public FileCacheManager(ILogger<FileCacheManager> logger, IpcManager ipcManager, LightlessConfigService configService, LightlessMediator lightlessMediator)
|
||||
{
|
||||
_logger = logger;
|
||||
_ipcManager = ipcManager;
|
||||
_configService = configService;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
_csvPath = Path.Combine(configService.ConfigurationDirectory, "FileCache.csv");
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public sealed class FileCacheManager : IHostedService
|
||||
|
||||
public Task<List<FileCacheEntity>> ValidateLocalIntegrity(IProgress<(int, int, FileCacheEntity)> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
_mareMediator.Publish(new HaltScanMessage(nameof(ValidateLocalIntegrity)));
|
||||
_lightlessMediator.Publish(new HaltScanMessage(nameof(ValidateLocalIntegrity)));
|
||||
_logger.LogInformation("Validating local storage");
|
||||
var cacheEntries = _fileCaches.SelectMany(v => v.Value).Where(v => v.IsCacheEntry).ToList();
|
||||
List<FileCacheEntity> brokenEntities = [];
|
||||
@@ -131,7 +131,7 @@ public sealed class FileCacheManager : IHostedService
|
||||
}
|
||||
}
|
||||
|
||||
_mareMediator.Publish(new ResumeScanMessage(nameof(ValidateLocalIntegrity)));
|
||||
_lightlessMediator.Publish(new ResumeScanMessage(nameof(ValidateLocalIntegrity)));
|
||||
return Task.FromResult(brokenEntities);
|
||||
}
|
||||
|
||||
@@ -417,9 +417,9 @@ public sealed class FileCacheManager : IHostedService
|
||||
{
|
||||
if (!_ipcManager.Penumbra.APIAvailable || string.IsNullOrEmpty(_ipcManager.Penumbra.ModDirectory))
|
||||
{
|
||||
_mareMediator.Publish(new NotificationMessage("Penumbra not connected",
|
||||
"Could not load local file cache data. Penumbra is not connected or not properly set up. Please enable and/or configure Penumbra properly to use Mare. After, reload Mare in the Plugin installer.",
|
||||
MareConfiguration.Models.NotificationType.Error));
|
||||
_lightlessMediator.Publish(new NotificationMessage("Penumbra not connected",
|
||||
"Could not load local file cache data. Penumbra is not connected or not properly set up. Please enable and/or configure Penumbra properly to use Lightless. After, reload Lightless in the Plugin installer.",
|
||||
LightlessConfiguration.Models.NotificationType.Error));
|
||||
}
|
||||
|
||||
_logger.LogInformation("{csvPath} found, parsing", _csvPath);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.Services;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -15,14 +15,14 @@ public sealed class FileCompactor
|
||||
private readonly WOF_FILE_COMPRESSION_INFO_V1 _efInfo;
|
||||
private readonly ILogger<FileCompactor> _logger;
|
||||
|
||||
private readonly MareConfigService _mareConfigService;
|
||||
private readonly LightlessConfigService _lightlessConfigService;
|
||||
private readonly DalamudUtilService _dalamudUtilService;
|
||||
|
||||
public FileCompactor(ILogger<FileCompactor> logger, MareConfigService mareConfigService, DalamudUtilService dalamudUtilService)
|
||||
public FileCompactor(ILogger<FileCompactor> logger, LightlessConfigService lightlessConfigService, DalamudUtilService dalamudUtilService)
|
||||
{
|
||||
_clusterSizes = new(StringComparer.Ordinal);
|
||||
_logger = logger;
|
||||
_mareConfigService = mareConfigService;
|
||||
_lightlessConfigService = lightlessConfigService;
|
||||
_dalamudUtilService = dalamudUtilService;
|
||||
_efInfo = new WOF_FILE_COMPRESSION_INFO_V1
|
||||
{
|
||||
@@ -50,7 +50,7 @@ public sealed class FileCompactor
|
||||
MassCompactRunning = true;
|
||||
|
||||
int currentFile = 1;
|
||||
var allFiles = Directory.EnumerateFiles(_mareConfigService.Current.CacheFolder).ToList();
|
||||
var allFiles = Directory.EnumerateFiles(_lightlessConfigService.Current.CacheFolder).ToList();
|
||||
int allFilesCount = allFiles.Count;
|
||||
foreach (var file in allFiles)
|
||||
{
|
||||
@@ -82,7 +82,7 @@ public sealed class FileCompactor
|
||||
{
|
||||
await File.WriteAllBytesAsync(filePath, decompressedFile, token).ConfigureAwait(false);
|
||||
|
||||
if (_dalamudUtilService.IsWine || !_mareConfigService.Current.UseCompactor)
|
||||
if (_dalamudUtilService.IsWine || !_lightlessConfigService.Current.UseCompactor)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using LightlessSync.API.Data.Enum;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.MareConfiguration.Configurations;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.LightlessConfiguration.Configurations;
|
||||
using LightlessSync.PlayerData.Data;
|
||||
using LightlessSync.PlayerData.Handlers;
|
||||
using LightlessSync.Services;
|
||||
@@ -26,7 +26,7 @@ public sealed class TransientResourceManager : DisposableMediatorSubscriberBase
|
||||
public bool IsTransientRecording { get; private set; } = false;
|
||||
|
||||
public TransientResourceManager(ILogger<TransientResourceManager> logger, TransientConfigService configurationService,
|
||||
DalamudUtilService dalamudUtil, MareMediator mediator) : base(logger, mediator)
|
||||
DalamudUtilService dalamudUtil, LightlessMediator mediator) : base(logger, mediator)
|
||||
{
|
||||
_configurationService = configurationService;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Dalamud.Plugin.Services;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Text;
|
||||
|
||||
@@ -7,15 +7,15 @@ namespace LightlessSync.Interop;
|
||||
|
||||
internal sealed class DalamudLogger : ILogger
|
||||
{
|
||||
private readonly MareConfigService _mareConfigService;
|
||||
private readonly LightlessConfigService _lightlessConfigService;
|
||||
private readonly string _name;
|
||||
private readonly IPluginLog _pluginLog;
|
||||
private readonly bool _hasModifiedGameFiles;
|
||||
|
||||
public DalamudLogger(string name, MareConfigService mareConfigService, IPluginLog pluginLog, bool hasModifiedGameFiles)
|
||||
public DalamudLogger(string name, LightlessConfigService lightlessConfigService, IPluginLog pluginLog, bool hasModifiedGameFiles)
|
||||
{
|
||||
_name = name;
|
||||
_mareConfigService = mareConfigService;
|
||||
_lightlessConfigService = lightlessConfigService;
|
||||
_pluginLog = pluginLog;
|
||||
_hasModifiedGameFiles = hasModifiedGameFiles;
|
||||
}
|
||||
@@ -24,7 +24,7 @@ internal sealed class DalamudLogger : ILogger
|
||||
|
||||
public bool IsEnabled(LogLevel logLevel)
|
||||
{
|
||||
return (int)_mareConfigService.Current.LogLevel <= (int)logLevel;
|
||||
return (int)_lightlessConfigService.Current.LogLevel <= (int)logLevel;
|
||||
}
|
||||
|
||||
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Dalamud.Plugin.Services;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
using System.Collections.Concurrent;
|
||||
@@ -12,13 +12,13 @@ public sealed class DalamudLoggingProvider : ILoggerProvider
|
||||
private readonly ConcurrentDictionary<string, DalamudLogger> _loggers =
|
||||
new(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
private readonly MareConfigService _mareConfigService;
|
||||
private readonly LightlessConfigService _lightlessConfigService;
|
||||
private readonly IPluginLog _pluginLog;
|
||||
private readonly bool _hasModifiedGameFiles;
|
||||
|
||||
public DalamudLoggingProvider(MareConfigService mareConfigService, IPluginLog pluginLog, bool hasModifiedGameFiles)
|
||||
public DalamudLoggingProvider(LightlessConfigService lightlessConfigService, IPluginLog pluginLog, bool hasModifiedGameFiles)
|
||||
{
|
||||
_mareConfigService = mareConfigService;
|
||||
_lightlessConfigService = lightlessConfigService;
|
||||
_pluginLog = pluginLog;
|
||||
_hasModifiedGameFiles = hasModifiedGameFiles;
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public sealed class DalamudLoggingProvider : ILoggerProvider
|
||||
catName = string.Join("", Enumerable.Range(0, 15 - catName.Length).Select(_ => " ")) + catName;
|
||||
}
|
||||
|
||||
return _loggers.GetOrAdd(catName, name => new DalamudLogger(name, _mareConfigService, _pluginLog, _hasModifiedGameFiles));
|
||||
return _loggers.GetOrAdd(catName, name => new DalamudLogger(name, _lightlessConfigService, _pluginLog, _hasModifiedGameFiles));
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Dalamud.Plugin.Services;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -13,7 +13,7 @@ public static class DalamudLoggingProviderExtensions
|
||||
builder.ClearProviders();
|
||||
|
||||
builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, DalamudLoggingProvider>
|
||||
(b => new DalamudLoggingProvider(b.GetRequiredService<MareConfigService>(), pluginLog, hasModifiedGameFiles)));
|
||||
(b => new DalamudLoggingProvider(b.GetRequiredService<LightlessConfigService>(), pluginLog, hasModifiedGameFiles)));
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
@@ -20,10 +20,10 @@ public sealed class IpcCallerCustomize : IIpcCaller
|
||||
private readonly ICallGateSubscriber<Guid, int> _customizePlusDeleteByUniqueId;
|
||||
private readonly ILogger<IpcCallerCustomize> _logger;
|
||||
private readonly DalamudUtilService _dalamudUtil;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
|
||||
public IpcCallerCustomize(ILogger<IpcCallerCustomize> logger, IDalamudPluginInterface dalamudPluginInterface,
|
||||
DalamudUtilService dalamudUtil, MareMediator mareMediator)
|
||||
DalamudUtilService dalamudUtil, LightlessMediator lightlessMediator)
|
||||
{
|
||||
_customizePlusApiVersion = dalamudPluginInterface.GetIpcSubscriber<(int, int)>("CustomizePlus.General.GetApiVersion");
|
||||
_customizePlusGetActiveProfile = dalamudPluginInterface.GetIpcSubscriber<ushort, (int, Guid?)>("CustomizePlus.Profile.GetActiveProfileIdOnCharacter");
|
||||
@@ -36,7 +36,7 @@ public sealed class IpcCallerCustomize : IIpcCaller
|
||||
_customizePlusOnScaleUpdate.Subscribe(OnCustomizePlusScaleChange);
|
||||
_logger = logger;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
|
||||
CheckAPI();
|
||||
}
|
||||
@@ -129,7 +129,7 @@ public sealed class IpcCallerCustomize : IIpcCaller
|
||||
private void OnCustomizePlusScaleChange(ushort c, Guid g)
|
||||
{
|
||||
var obj = _dalamudUtil.GetCharacterFromObjectTableByIndex(c);
|
||||
_mareMediator.Publish(new CustomizePlusMessage(obj?.Address ?? null));
|
||||
_lightlessMediator.Publish(new CustomizePlusMessage(obj?.Address ?? null));
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using Dalamud.Plugin;
|
||||
using Glamourer.Api.Helpers;
|
||||
using Glamourer.Api.IpcSubscribers;
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.PlayerData.Handlers;
|
||||
using LightlessSync.Services;
|
||||
using LightlessSync.Services.Mediator;
|
||||
@@ -15,7 +15,7 @@ public sealed class IpcCallerGlamourer : DisposableMediatorSubscriberBase, IIpcC
|
||||
private readonly ILogger<IpcCallerGlamourer> _logger;
|
||||
private readonly IDalamudPluginInterface _pi;
|
||||
private readonly DalamudUtilService _dalamudUtil;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
private readonly RedrawManager _redrawManager;
|
||||
|
||||
private readonly ApiVersion _glamourerApiVersions;
|
||||
@@ -30,8 +30,8 @@ public sealed class IpcCallerGlamourer : DisposableMediatorSubscriberBase, IIpcC
|
||||
private bool _shownGlamourerUnavailable = false;
|
||||
private readonly uint LockCode = 0x6D617265;
|
||||
|
||||
public IpcCallerGlamourer(ILogger<IpcCallerGlamourer> logger, IDalamudPluginInterface pi, DalamudUtilService dalamudUtil, MareMediator mareMediator,
|
||||
RedrawManager redrawManager) : base(logger, mareMediator)
|
||||
public IpcCallerGlamourer(ILogger<IpcCallerGlamourer> logger, IDalamudPluginInterface pi, DalamudUtilService dalamudUtil, LightlessMediator lightlessMediator,
|
||||
RedrawManager redrawManager) : base(logger, lightlessMediator)
|
||||
{
|
||||
_glamourerApiVersions = new ApiVersion(pi);
|
||||
_glamourerGetAllCustomization = new GetStateBase64(pi);
|
||||
@@ -44,7 +44,7 @@ public sealed class IpcCallerGlamourer : DisposableMediatorSubscriberBase, IIpcC
|
||||
_logger = logger;
|
||||
_pi = pi;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
_redrawManager = redrawManager;
|
||||
CheckAPI();
|
||||
|
||||
@@ -97,7 +97,7 @@ public sealed class IpcCallerGlamourer : DisposableMediatorSubscriberBase, IIpcC
|
||||
if (!apiAvailable && !_shownGlamourerUnavailable)
|
||||
{
|
||||
_shownGlamourerUnavailable = true;
|
||||
_mareMediator.Publish(new NotificationMessage("Glamourer inactive", "Your Glamourer installation is not active or out of date. Update Glamourer to continue to use Mare. If you just updated Glamourer, ignore this message.",
|
||||
_lightlessMediator.Publish(new NotificationMessage("Glamourer inactive", "Your Glamourer installation is not active or out of date. Update Glamourer to continue to use Lightless. If you just updated Glamourer, ignore this message.",
|
||||
NotificationType.Error));
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ public sealed class IpcCallerGlamourer : DisposableMediatorSubscriberBase, IIpcC
|
||||
_glamourerRevert.Invoke(chara.ObjectIndex, LockCode);
|
||||
logger.LogDebug("[{appid}] Calling On IPC: PenumbraRedraw", applicationId);
|
||||
|
||||
_mareMediator.Publish(new PenumbraRedrawCharacterMessage(chara));
|
||||
_lightlessMediator.Publish(new PenumbraRedrawCharacterMessage(chara));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -212,6 +212,6 @@ public sealed class IpcCallerGlamourer : DisposableMediatorSubscriberBase, IIpcC
|
||||
|
||||
private void GlamourerChanged(nint address)
|
||||
{
|
||||
_mareMediator.Publish(new GlamourerChangedMessage(address));
|
||||
_lightlessMediator.Publish(new GlamourerChangedMessage(address));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace LightlessSync.Interop.Ipc;
|
||||
public sealed class IpcCallerHeels : IIpcCaller
|
||||
{
|
||||
private readonly ILogger<IpcCallerHeels> _logger;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
private readonly DalamudUtilService _dalamudUtil;
|
||||
private readonly ICallGateSubscriber<(int, int)> _heelsGetApiVersion;
|
||||
private readonly ICallGateSubscriber<string> _heelsGetOffset;
|
||||
@@ -17,10 +17,10 @@ public sealed class IpcCallerHeels : IIpcCaller
|
||||
private readonly ICallGateSubscriber<int, string, object?> _heelsRegisterPlayer;
|
||||
private readonly ICallGateSubscriber<int, object?> _heelsUnregisterPlayer;
|
||||
|
||||
public IpcCallerHeels(ILogger<IpcCallerHeels> logger, IDalamudPluginInterface pi, DalamudUtilService dalamudUtil, MareMediator mareMediator)
|
||||
public IpcCallerHeels(ILogger<IpcCallerHeels> logger, IDalamudPluginInterface pi, DalamudUtilService dalamudUtil, LightlessMediator lightlessMediator)
|
||||
{
|
||||
_logger = logger;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
_heelsGetApiVersion = pi.GetIpcSubscriber<(int, int)>("SimpleHeels.ApiVersion");
|
||||
_heelsGetOffset = pi.GetIpcSubscriber<string>("SimpleHeels.GetLocalPlayer");
|
||||
@@ -37,7 +37,7 @@ public sealed class IpcCallerHeels : IIpcCaller
|
||||
|
||||
private void HeelsOffsetChange(string offset)
|
||||
{
|
||||
_mareMediator.Publish(new HeelsOffsetMessage());
|
||||
_lightlessMediator.Publish(new HeelsOffsetMessage());
|
||||
}
|
||||
|
||||
public async Task<string> GetOffsetAsync()
|
||||
|
||||
@@ -18,14 +18,14 @@ public sealed class IpcCallerHonorific : IIpcCaller
|
||||
private readonly ICallGateSubscriber<object> _honorificReady;
|
||||
private readonly ICallGateSubscriber<int, string, object> _honorificSetCharacterTitle;
|
||||
private readonly ILogger<IpcCallerHonorific> _logger;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
private readonly DalamudUtilService _dalamudUtil;
|
||||
|
||||
public IpcCallerHonorific(ILogger<IpcCallerHonorific> logger, IDalamudPluginInterface pi, DalamudUtilService dalamudUtil,
|
||||
MareMediator mareMediator)
|
||||
LightlessMediator lightlessMediator)
|
||||
{
|
||||
_logger = logger;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
_honorificApiVersion = pi.GetIpcSubscriber<(uint, uint)>("Honorific.ApiVersion");
|
||||
_honorificGetLocalCharacterTitle = pi.GetIpcSubscriber<string>("Honorific.GetLocalCharacterTitle");
|
||||
@@ -115,18 +115,18 @@ public sealed class IpcCallerHonorific : IIpcCaller
|
||||
|
||||
private void OnHonorificDisposing()
|
||||
{
|
||||
_mareMediator.Publish(new HonorificMessage(string.Empty));
|
||||
_lightlessMediator.Publish(new HonorificMessage(string.Empty));
|
||||
}
|
||||
|
||||
private void OnHonorificLocalCharacterTitleChanged(string titleJson)
|
||||
{
|
||||
string titleData = string.IsNullOrEmpty(titleJson) ? string.Empty : Convert.ToBase64String(Encoding.UTF8.GetBytes(titleJson));
|
||||
_mareMediator.Publish(new HonorificMessage(titleData));
|
||||
_lightlessMediator.Publish(new HonorificMessage(titleData));
|
||||
}
|
||||
|
||||
private void OnHonorificReady()
|
||||
{
|
||||
CheckAPI();
|
||||
_mareMediator.Publish(new HonorificReadyMessage());
|
||||
_lightlessMediator.Publish(new HonorificReadyMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@ public sealed class IpcCallerMoodles : IIpcCaller
|
||||
private readonly ICallGateSubscriber<nint, object> _moodlesRevertStatus;
|
||||
private readonly ILogger<IpcCallerMoodles> _logger;
|
||||
private readonly DalamudUtilService _dalamudUtil;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
|
||||
public IpcCallerMoodles(ILogger<IpcCallerMoodles> logger, IDalamudPluginInterface pi, DalamudUtilService dalamudUtil,
|
||||
MareMediator mareMediator)
|
||||
LightlessMediator lightlessMediator)
|
||||
{
|
||||
_logger = logger;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
|
||||
_moodlesApiVersion = pi.GetIpcSubscriber<int>("Moodles.Version");
|
||||
_moodlesOnChange = pi.GetIpcSubscriber<IPlayerCharacter, object>("Moodles.StatusManagerModified");
|
||||
@@ -38,7 +38,7 @@ public sealed class IpcCallerMoodles : IIpcCaller
|
||||
|
||||
private void OnMoodlesChange(IPlayerCharacter character)
|
||||
{
|
||||
_mareMediator.Publish(new MoodlesMessage(character.Address));
|
||||
_lightlessMediator.Publish(new MoodlesMessage(character.Address));
|
||||
}
|
||||
|
||||
public bool APIAvailable { get; private set; } = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Dalamud.Plugin;
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.PlayerData.Handlers;
|
||||
using LightlessSync.Services;
|
||||
using LightlessSync.Services.Mediator;
|
||||
@@ -15,7 +15,7 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
{
|
||||
private readonly IDalamudPluginInterface _pi;
|
||||
private readonly DalamudUtilService _dalamudUtil;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
private readonly RedrawManager _redrawManager;
|
||||
private bool _shownPenumbraUnavailable = false;
|
||||
private string? _penumbraModDirectory;
|
||||
@@ -27,7 +27,7 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
if (!string.Equals(_penumbraModDirectory, value, StringComparison.Ordinal))
|
||||
{
|
||||
_penumbraModDirectory = value;
|
||||
_mareMediator.Publish(new PenumbraDirectoryChangedMessage(_penumbraModDirectory));
|
||||
_lightlessMediator.Publish(new PenumbraDirectoryChangedMessage(_penumbraModDirectory));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,11 +54,11 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
private readonly GetGameObjectResourcePaths _penumbraResourcePaths;
|
||||
|
||||
public IpcCallerPenumbra(ILogger<IpcCallerPenumbra> logger, IDalamudPluginInterface pi, DalamudUtilService dalamudUtil,
|
||||
MareMediator mareMediator, RedrawManager redrawManager) : base(logger, mareMediator)
|
||||
LightlessMediator lightlessMediator, RedrawManager redrawManager) : base(logger, lightlessMediator)
|
||||
{
|
||||
_pi = pi;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
_redrawManager = redrawManager;
|
||||
_penumbraInit = Initialized.Subscriber(pi, PenumbraInit);
|
||||
_penumbraDispose = Disposed.Subscriber(pi, PenumbraDispose);
|
||||
@@ -76,7 +76,7 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
_penumbraModSettingChanged = ModSettingChanged.Subscriber(pi, (change, arg1, arg, b) =>
|
||||
{
|
||||
if (change == ModSettingChange.EnableState)
|
||||
_mareMediator.Publish(new PenumbraModSettingChangedMessage());
|
||||
_lightlessMediator.Publish(new PenumbraModSettingChangedMessage());
|
||||
});
|
||||
_penumbraConvertTextureFile = new ConvertTextureFile(pi);
|
||||
_penumbraResourcePaths = new GetGameObjectResourcePaths(pi);
|
||||
@@ -125,8 +125,8 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
if (!penumbraAvailable && !_shownPenumbraUnavailable)
|
||||
{
|
||||
_shownPenumbraUnavailable = true;
|
||||
_mareMediator.Publish(new NotificationMessage("Penumbra inactive",
|
||||
"Your Penumbra installation is not active or out of date. Update Penumbra and/or the Enable Mods setting in Penumbra to continue to use Mare. If you just updated Penumbra, ignore this message.",
|
||||
_lightlessMediator.Publish(new NotificationMessage("Penumbra inactive",
|
||||
"Your Penumbra installation is not active or out of date. Update Penumbra and/or the Enable Mods setting in Penumbra to continue to use Lightless. If you just updated Penumbra, ignore this message.",
|
||||
NotificationType.Error));
|
||||
}
|
||||
}
|
||||
@@ -173,7 +173,7 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
{
|
||||
if (!APIAvailable) return;
|
||||
|
||||
_mareMediator.Publish(new HaltScanMessage(nameof(ConvertTextureFiles)));
|
||||
_lightlessMediator.Publish(new HaltScanMessage(nameof(ConvertTextureFiles)));
|
||||
int currentTexture = 0;
|
||||
foreach (var texture in textures)
|
||||
{
|
||||
@@ -200,7 +200,7 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
}
|
||||
}
|
||||
}
|
||||
_mareMediator.Publish(new ResumeScanMessage(nameof(ConvertTextureFiles)));
|
||||
_lightlessMediator.Publish(new ResumeScanMessage(nameof(ConvertTextureFiles)));
|
||||
|
||||
await _dalamudUtil.RunOnFrameworkThread(async () =>
|
||||
{
|
||||
@@ -215,7 +215,7 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
|
||||
return await _dalamudUtil.RunOnFrameworkThread(() =>
|
||||
{
|
||||
var collName = "Mare_" + uid;
|
||||
var collName = "Lightless_" + uid;
|
||||
var collId = _penumbraCreateNamedTemporaryCollection.Invoke(collName);
|
||||
logger.LogTrace("Creating Temp Collection {collName}, GUID: {collId}", collName, collId);
|
||||
return collId;
|
||||
@@ -284,7 +284,7 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
await _dalamudUtil.RunOnFrameworkThread(() =>
|
||||
{
|
||||
logger.LogTrace("[{applicationId}] Manip: {data}", applicationId, manipulationData);
|
||||
var retAdd = _penumbraAddTemporaryMod.Invoke("MareChara_Meta", collId, [], manipulationData, 0);
|
||||
var retAdd = _penumbraAddTemporaryMod.Invoke("LightlessChara_Meta", collId, [], manipulationData, 0);
|
||||
logger.LogTrace("[{applicationId}] Setting temp meta mod for {collId}, Success: {ret}", applicationId, collId, retAdd);
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
@@ -299,9 +299,9 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
{
|
||||
logger.LogTrace("[{applicationId}] Change: {from} => {to}", applicationId, mod.Key, mod.Value);
|
||||
}
|
||||
var retRemove = _penumbraRemoveTemporaryMod.Invoke("MareChara_Files", collId, 0);
|
||||
var retRemove = _penumbraRemoveTemporaryMod.Invoke("LightlessChara_Files", collId, 0);
|
||||
logger.LogTrace("[{applicationId}] Removing temp files mod for {collId}, Success: {ret}", applicationId, collId, retRemove);
|
||||
var retAdd = _penumbraAddTemporaryMod.Invoke("MareChara_Files", collId, modPaths, string.Empty, 0);
|
||||
var retAdd = _penumbraAddTemporaryMod.Invoke("LightlessChara_Files", collId, modPaths, string.Empty, 0);
|
||||
logger.LogTrace("[{applicationId}] Setting temp files mod for {collId}, Success: {ret}", applicationId, collId, retAdd);
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
@@ -315,7 +315,7 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
}
|
||||
else
|
||||
{
|
||||
_mareMediator.Publish(new PenumbraRedrawMessage(objectAddress, objectTableIndex, wasRequested));
|
||||
_lightlessMediator.Publish(new PenumbraRedrawMessage(objectAddress, objectTableIndex, wasRequested));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,21 +323,21 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
{
|
||||
if (ptr != IntPtr.Zero && string.Compare(arg1, arg2, ignoreCase: true, System.Globalization.CultureInfo.InvariantCulture) != 0)
|
||||
{
|
||||
_mareMediator.Publish(new PenumbraResourceLoadMessage(ptr, arg1, arg2));
|
||||
_lightlessMediator.Publish(new PenumbraResourceLoadMessage(ptr, arg1, arg2));
|
||||
}
|
||||
}
|
||||
|
||||
private void PenumbraDispose()
|
||||
{
|
||||
_redrawManager.Cancel();
|
||||
_mareMediator.Publish(new PenumbraDisposedMessage());
|
||||
_lightlessMediator.Publish(new PenumbraDisposedMessage());
|
||||
}
|
||||
|
||||
private void PenumbraInit()
|
||||
{
|
||||
APIAvailable = true;
|
||||
ModDirectory = _penumbraResolveModDir.Invoke();
|
||||
_mareMediator.Publish(new PenumbraInitializedMessage());
|
||||
_lightlessMediator.Publish(new PenumbraInitializedMessage());
|
||||
_penumbraRedraw!.Invoke(0, setting: RedrawType.Redraw);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ public sealed class IpcCallerPetNames : IIpcCaller
|
||||
{
|
||||
private readonly ILogger<IpcCallerPetNames> _logger;
|
||||
private readonly DalamudUtilService _dalamudUtil;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
|
||||
private readonly ICallGateSubscriber<object> _petnamesReady;
|
||||
private readonly ICallGateSubscriber<object> _petnamesDisposing;
|
||||
@@ -24,11 +24,11 @@ public sealed class IpcCallerPetNames : IIpcCaller
|
||||
private readonly ICallGateSubscriber<ushort, object> _clearPlayerData;
|
||||
|
||||
public IpcCallerPetNames(ILogger<IpcCallerPetNames> logger, IDalamudPluginInterface pi, DalamudUtilService dalamudUtil,
|
||||
MareMediator mareMediator)
|
||||
LightlessMediator lightlessMediator)
|
||||
{
|
||||
_logger = logger;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
|
||||
_petnamesReady = pi.GetIpcSubscriber<object>("PetRenamer.Ready");
|
||||
_petnamesDisposing = pi.GetIpcSubscriber<object>("PetRenamer.Disposing");
|
||||
@@ -68,12 +68,12 @@ public sealed class IpcCallerPetNames : IIpcCaller
|
||||
private void OnPetNicknamesReady()
|
||||
{
|
||||
CheckAPI();
|
||||
_mareMediator.Publish(new PetNamesReadyMessage());
|
||||
_lightlessMediator.Publish(new PetNamesReadyMessage());
|
||||
}
|
||||
|
||||
private void OnPetNicknamesDispose()
|
||||
{
|
||||
_mareMediator.Publish(new PetNamesMessage(string.Empty));
|
||||
_lightlessMediator.Publish(new PetNamesMessage(string.Empty));
|
||||
}
|
||||
|
||||
public string GetLocalNames()
|
||||
@@ -146,7 +146,7 @@ public sealed class IpcCallerPetNames : IIpcCaller
|
||||
|
||||
private void OnLocalPetNicknamesDataChange(string data)
|
||||
{
|
||||
_mareMediator.Publish(new PetNamesMessage(data));
|
||||
_lightlessMediator.Publish(new PetNamesMessage(data));
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace LightlessSync.Interop.Ipc;
|
||||
|
||||
public sealed partial class IpcManager : DisposableMediatorSubscriberBase
|
||||
{
|
||||
public IpcManager(ILogger<IpcManager> logger, MareMediator mediator,
|
||||
public IpcManager(ILogger<IpcManager> logger, LightlessMediator mediator,
|
||||
IpcCallerPenumbra penumbraIpc, IpcCallerGlamourer glamourerIpc, IpcCallerCustomize customizeIpc, IpcCallerHeels heelsIpc,
|
||||
IpcCallerHonorific honorificIpc, IpcCallerMoodles moodlesIpc, IpcCallerPetNames ipcCallerPetNames, IpcCallerBrio ipcCallerBrio) : base(logger, mediator)
|
||||
{
|
||||
|
||||
@@ -19,15 +19,15 @@ public class IpcProvider : IHostedService, IMediatorSubscriber
|
||||
private ICallGateProvider<List<nint>>? _handledGameAddresses;
|
||||
private readonly List<GameObjectHandler> _activeGameObjectHandlers = [];
|
||||
|
||||
public MareMediator Mediator { get; init; }
|
||||
public LightlessMediator Mediator { get; init; }
|
||||
|
||||
public IpcProvider(ILogger<IpcProvider> logger, IDalamudPluginInterface pi,
|
||||
CharaDataManager charaDataManager, MareMediator mareMediator)
|
||||
CharaDataManager charaDataManager, LightlessMediator lightlessMediator)
|
||||
{
|
||||
_logger = logger;
|
||||
_pi = pi;
|
||||
_charaDataManager = charaDataManager;
|
||||
Mediator = mareMediator;
|
||||
Mediator = lightlessMediator;
|
||||
|
||||
Mediator.Subscribe<GameObjectHandlerCreatedMessage>(this, (msg) =>
|
||||
{
|
||||
|
||||
@@ -10,22 +10,22 @@ namespace LightlessSync.Interop.Ipc;
|
||||
|
||||
public class RedrawManager
|
||||
{
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
private readonly DalamudUtilService _dalamudUtil;
|
||||
private readonly ConcurrentDictionary<nint, bool> _penumbraRedrawRequests = [];
|
||||
private CancellationTokenSource _disposalCts = new();
|
||||
|
||||
public SemaphoreSlim RedrawSemaphore { get; init; } = new(2, 2);
|
||||
|
||||
public RedrawManager(MareMediator mareMediator, DalamudUtilService dalamudUtil)
|
||||
public RedrawManager(LightlessMediator lightlessMediator, DalamudUtilService dalamudUtil)
|
||||
{
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
}
|
||||
|
||||
public async Task PenumbraRedrawInternalAsync(ILogger logger, GameObjectHandler handler, Guid applicationId, Action<ICharacter> action, CancellationToken token)
|
||||
{
|
||||
_mareMediator.Publish(new PenumbraStartRedrawMessage(handler.Address));
|
||||
_lightlessMediator.Publish(new PenumbraStartRedrawMessage(handler.Address));
|
||||
|
||||
_penumbraRedrawRequests[handler.Address] = true;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class RedrawManager
|
||||
finally
|
||||
{
|
||||
_penumbraRedrawRequests[handler.Address] = false;
|
||||
_mareMediator.Publish(new PenumbraEndRedrawMessage(handler.Address));
|
||||
_lightlessMediator.Publish(new PenumbraEndRedrawMessage(handler.Address));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,23 +25,23 @@ public unsafe class VfxSpawnManager : DisposableMediatorSubscriberBase
|
||||
[Signature("40 53 48 83 EC 20 48 8B D9 48 8B 89 ?? ?? ?? ?? 48 85 C9 74 28 33 D2 E8 ?? ?? ?? ?? 48 8B 8B ?? ?? ?? ?? 48 85 C9")]
|
||||
private readonly delegate* unmanaged<VfxStruct*, nint> _staticVfxRemove;
|
||||
|
||||
public VfxSpawnManager(ILogger<VfxSpawnManager> logger, IGameInteropProvider gameInteropProvider, MareMediator mareMediator)
|
||||
: base(logger, mareMediator)
|
||||
public VfxSpawnManager(ILogger<VfxSpawnManager> logger, IGameInteropProvider gameInteropProvider, LightlessMediator lightlessMediator)
|
||||
: base(logger, lightlessMediator)
|
||||
{
|
||||
gameInteropProvider.InitializeFromAttributes(this);
|
||||
mareMediator.Subscribe<GposeStartMessage>(this, (msg) =>
|
||||
lightlessMediator.Subscribe<GposeStartMessage>(this, (msg) =>
|
||||
{
|
||||
ChangeSpawnVisibility(0f);
|
||||
});
|
||||
mareMediator.Subscribe<GposeEndMessage>(this, (msg) =>
|
||||
lightlessMediator.Subscribe<GposeEndMessage>(this, (msg) =>
|
||||
{
|
||||
RestoreSpawnVisiblity();
|
||||
});
|
||||
mareMediator.Subscribe<CutsceneStartMessage>(this, (msg) =>
|
||||
lightlessMediator.Subscribe<CutsceneStartMessage>(this, (msg) =>
|
||||
{
|
||||
ChangeSpawnVisibility(0f);
|
||||
});
|
||||
mareMediator.Subscribe<CutsceneEndMessage>(this, (msg) =>
|
||||
lightlessMediator.Subscribe<CutsceneEndMessage>(this, (msg) =>
|
||||
{
|
||||
RestoreSpawnVisiblity();
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using LightlessSync.MareConfiguration.Configurations;
|
||||
using LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
namespace LightlessSync.MareConfiguration;
|
||||
namespace LightlessSync.LightlessConfiguration;
|
||||
|
||||
public class CharaDataConfigService : ConfigurationServiceBase<CharaDataConfig>
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using LightlessSync.MareConfiguration.Configurations;
|
||||
using LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
namespace LightlessSync.MareConfiguration;
|
||||
namespace LightlessSync.LightlessConfiguration;
|
||||
|
||||
public static class ConfigurationExtensions
|
||||
{
|
||||
public static bool HasValidSetup(this MareConfig configuration)
|
||||
public static bool HasValidSetup(this LightlessConfig configuration)
|
||||
{
|
||||
return configuration.AcceptedAgreement && configuration.InitialScanComplete
|
||||
&& !string.IsNullOrEmpty(configuration.CacheFolder)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace LightlessSync.MareConfiguration;
|
||||
namespace LightlessSync.LightlessConfiguration;
|
||||
|
||||
public class ConfigurationMigrator(ILogger<ConfigurationMigrator> logger, TransientConfigService transientConfigService,
|
||||
ServerConfigService serverConfigService) : IHostedService
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using LightlessSync.MareConfiguration.Configurations;
|
||||
using LightlessSync.LightlessConfiguration.Configurations;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace LightlessSync.MareConfiguration;
|
||||
namespace LightlessSync.LightlessConfiguration;
|
||||
|
||||
public class ConfigurationSaveService : IHostedService
|
||||
{
|
||||
@@ -15,7 +16,7 @@ public class ConfigurationSaveService : IHostedService
|
||||
public const string BackupFolder = "config_backup";
|
||||
private readonly MethodInfo _saveMethod;
|
||||
|
||||
public ConfigurationSaveService(ILogger<ConfigurationSaveService> logger, IEnumerable<IConfigService<IMareConfiguration>> configs)
|
||||
public ConfigurationSaveService(ILogger<ConfigurationSaveService> logger, IEnumerable<IConfigService<ILightlessConfiguration>> configs)
|
||||
{
|
||||
foreach (var config in configs)
|
||||
{
|
||||
@@ -68,7 +69,7 @@ public class ConfigurationSaveService : IHostedService
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SaveConfig<T>(IConfigService<T> config) where T : IMareConfiguration
|
||||
private async Task SaveConfig<T>(IConfigService<T> config) where T : ILightlessConfiguration
|
||||
{
|
||||
_logger.LogTrace("Saving {configName}", config.ConfigurationName);
|
||||
var configDir = config.ConfigurationPath.Replace(config.ConfigurationName, string.Empty);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using LightlessSync.MareConfiguration.Configurations;
|
||||
using LightlessSync.LightlessConfiguration.Configurations;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace LightlessSync.MareConfiguration;
|
||||
namespace LightlessSync.LightlessConfiguration;
|
||||
|
||||
public abstract class ConfigurationServiceBase<T> : IConfigService<T> where T : IMareConfiguration
|
||||
public abstract class ConfigurationServiceBase<T> : IConfigService<T> where T : ILightlessConfiguration
|
||||
{
|
||||
private readonly CancellationTokenSource _periodicCheckCts = new();
|
||||
private DateTime _configLastWriteTime;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
|
||||
namespace LightlessSync.MareConfiguration.Configurations;
|
||||
namespace LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
public class CharaDataConfig : IMareConfiguration
|
||||
public class CharaDataConfig : ILightlessConfiguration
|
||||
{
|
||||
public bool OpenMareHubOnGposeStart { get; set; } = false;
|
||||
public bool OpenLightlessHubOnGposeStart { get; set; } = false;
|
||||
public string LastSavedCharaDataLocation { get; set; } = string.Empty;
|
||||
public Dictionary<string, CharaDataFavorite> FavoriteCodes { get; set; } = [];
|
||||
public bool DownloadMcdDataOnConnection { get; set; } = true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace LightlessSync.MareConfiguration.Configurations;
|
||||
namespace LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
public interface IMareConfiguration
|
||||
public interface ILightlessConfiguration
|
||||
{
|
||||
int Version { get; set; }
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.UI;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace LightlessSync.MareConfiguration.Configurations;
|
||||
namespace LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
[Serializable]
|
||||
public class MareConfig : IMareConfiguration
|
||||
public class LightlessConfig : ILightlessConfiguration
|
||||
{
|
||||
public bool AcceptedAgreement { get; set; } = false;
|
||||
public string CacheFolder { get; set; } = string.Empty;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace LightlessSync.MareConfiguration.Configurations;
|
||||
namespace LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
public class PlayerPerformanceConfig : IMareConfiguration
|
||||
public class PlayerPerformanceConfig : ILightlessConfiguration
|
||||
{
|
||||
public int Version { get; set; } = 1;
|
||||
public bool ShowPerformanceIndicator { get; set; } = true;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.WebAPI;
|
||||
|
||||
namespace LightlessSync.MareConfiguration.Configurations;
|
||||
namespace LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
[Serializable]
|
||||
public class ServerConfig : IMareConfiguration
|
||||
public class ServerConfig : ILightlessConfiguration
|
||||
{
|
||||
public int CurrentServer { get; set; } = 0;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
|
||||
namespace LightlessSync.MareConfiguration.Configurations;
|
||||
namespace LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
public class ServerTagConfig : IMareConfiguration
|
||||
public class ServerTagConfig : ILightlessConfiguration
|
||||
{
|
||||
public Dictionary<string, ServerTagStorage> ServerTagStorage { get; set; } = new(StringComparer.OrdinalIgnoreCase);
|
||||
public int Version { get; set; } = 0;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using LightlessSync.API.Data.Enum;
|
||||
using LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
namespace LightlessSync.MareConfiguration.Configurations;
|
||||
namespace LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
public class TransientConfig : IMareConfiguration
|
||||
public class TransientConfig : ILightlessConfiguration
|
||||
{
|
||||
public Dictionary<string, TransientPlayerConfig> TransientConfigs { get; set; } = [];
|
||||
public int Version { get; set; } = 1;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
|
||||
namespace LightlessSync.MareConfiguration.Configurations;
|
||||
namespace LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
public class UidNotesConfig : IMareConfiguration
|
||||
public class UidNotesConfig : ILightlessConfiguration
|
||||
{
|
||||
public Dictionary<string, ServerNotesStorage> ServerNotes { get; set; } = new(StringComparer.Ordinal);
|
||||
public int Version { get; set; } = 0;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace LightlessSync.MareConfiguration.Configurations;
|
||||
namespace LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
public class XivDataStorageConfig : IMareConfiguration
|
||||
public class XivDataStorageConfig : ILightlessConfiguration
|
||||
{
|
||||
public ConcurrentDictionary<string, long> TriangleDictionary { get; set; } = new(StringComparer.OrdinalIgnoreCase);
|
||||
public ConcurrentDictionary<string, Dictionary<string, List<ushort>>> BonesDictionary { get; set; } = new(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using LightlessSync.MareConfiguration.Configurations;
|
||||
using LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
namespace LightlessSync.MareConfiguration;
|
||||
namespace LightlessSync.LightlessConfiguration;
|
||||
|
||||
public interface IConfigService<out T> : IDisposable where T : IMareConfiguration
|
||||
public interface IConfigService<out T> : IDisposable where T : ILightlessConfiguration
|
||||
{
|
||||
T Current { get; }
|
||||
string ConfigurationName { get; }
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using LightlessSync.MareConfiguration.Configurations;
|
||||
using LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
namespace LightlessSync.MareConfiguration;
|
||||
namespace LightlessSync.LightlessConfiguration;
|
||||
|
||||
public class MareConfigService : ConfigurationServiceBase<MareConfig>
|
||||
public class LightlessConfigService : ConfigurationServiceBase<LightlessConfig>
|
||||
{
|
||||
public const string ConfigName = "config.json";
|
||||
|
||||
public MareConfigService(string configDir) : base(configDir)
|
||||
public LightlessConfigService(string configDir) : base(configDir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace LightlessSync.MareConfiguration.Models;
|
||||
namespace LightlessSync.LightlessConfiguration.Models;
|
||||
|
||||
[Serializable]
|
||||
public record Authentication
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace LightlessSync.MareConfiguration.Models;
|
||||
namespace LightlessSync.LightlessConfiguration.Models;
|
||||
|
||||
[Serializable]
|
||||
public class CharaDataFavorite
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace LightlessSync.MareConfiguration.Models;
|
||||
namespace LightlessSync.LightlessConfiguration.Models;
|
||||
|
||||
public enum DownloadSpeeds
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace LightlessSync.MareConfiguration.Models;
|
||||
namespace LightlessSync.LightlessConfiguration.Models;
|
||||
|
||||
public enum NotificationLocation
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace LightlessSync.MareConfiguration.Models.Obsolete;
|
||||
namespace LightlessSync.LightlessConfiguration.Models.Obsolete;
|
||||
|
||||
[Serializable]
|
||||
[Obsolete("Deprecated, use ServerStorage")]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace LightlessSync.MareConfiguration.Models;
|
||||
namespace LightlessSync.LightlessConfiguration.Models;
|
||||
|
||||
[Serializable]
|
||||
public class SecretKey
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace LightlessSync.MareConfiguration.Models;
|
||||
namespace LightlessSync.LightlessConfiguration.Models;
|
||||
|
||||
public class ServerNotesStorage
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Http.Connections;
|
||||
|
||||
namespace LightlessSync.MareConfiguration.Models;
|
||||
namespace LightlessSync.LightlessConfiguration.Models;
|
||||
|
||||
[Serializable]
|
||||
public class ServerStorage
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace LightlessSync.MareConfiguration.Models;
|
||||
namespace LightlessSync.LightlessConfiguration.Models;
|
||||
|
||||
[Serializable]
|
||||
public class ServerTagStorage
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using LightlessSync.MareConfiguration.Configurations;
|
||||
using LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
namespace LightlessSync.MareConfiguration;
|
||||
namespace LightlessSync.LightlessConfiguration;
|
||||
|
||||
public class NotesConfigService : ConfigurationServiceBase<UidNotesConfig>
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using LightlessSync.MareConfiguration.Configurations;
|
||||
using LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
namespace LightlessSync.MareConfiguration;
|
||||
namespace LightlessSync.LightlessConfiguration;
|
||||
|
||||
public class PlayerPerformanceConfigService : ConfigurationServiceBase<PlayerPerformanceConfig>
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using LightlessSync.MareConfiguration.Configurations;
|
||||
using LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
namespace LightlessSync.MareConfiguration;
|
||||
namespace LightlessSync.LightlessConfiguration;
|
||||
|
||||
public class ServerConfigService : ConfigurationServiceBase<ServerConfig>
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using LightlessSync.MareConfiguration.Configurations;
|
||||
using LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
namespace LightlessSync.MareConfiguration;
|
||||
namespace LightlessSync.LightlessConfiguration;
|
||||
|
||||
public class ServerTagConfigService : ConfigurationServiceBase<ServerTagConfig>
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using LightlessSync.MareConfiguration.Configurations;
|
||||
using LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
namespace LightlessSync.MareConfiguration;
|
||||
namespace LightlessSync.LightlessConfiguration;
|
||||
|
||||
public class TransientConfigService : ConfigurationServiceBase<TransientConfig>
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using LightlessSync.MareConfiguration.Configurations;
|
||||
using LightlessSync.LightlessConfiguration.Configurations;
|
||||
|
||||
namespace LightlessSync.MareConfiguration;
|
||||
namespace LightlessSync.LightlessConfiguration;
|
||||
|
||||
public class XivDataStorageService : ConfigurationServiceBase<XivDataStorageConfig>
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using LightlessSync.FileCache;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
using LightlessSync.PlayerData.Services;
|
||||
using LightlessSync.Services;
|
||||
@@ -67,21 +67,21 @@ namespace LightlessSync;
|
||||
#pragma warning restore S125 // Sections of code should not be commented out
|
||||
// thank you dark 🙏
|
||||
|
||||
public class MarePlugin : MediatorSubscriberBase, IHostedService
|
||||
public class LightlessPlugin : MediatorSubscriberBase, IHostedService
|
||||
{
|
||||
private readonly DalamudUtilService _dalamudUtil;
|
||||
private readonly MareConfigService _mareConfigService;
|
||||
private readonly LightlessConfigService _lightlessConfigService;
|
||||
private readonly ServerConfigurationManager _serverConfigurationManager;
|
||||
private readonly IServiceScopeFactory _serviceScopeFactory;
|
||||
private IServiceScope? _runtimeServiceScope;
|
||||
private Task? _launchTask = null;
|
||||
|
||||
public MarePlugin(ILogger<MarePlugin> logger, MareConfigService mareConfigService,
|
||||
public LightlessPlugin(ILogger<LightlessPlugin> logger, LightlessConfigService lightlessConfigService,
|
||||
ServerConfigurationManager serverConfigurationManager,
|
||||
DalamudUtilService dalamudUtil,
|
||||
IServiceScopeFactory serviceScopeFactory, MareMediator mediator) : base(logger, mediator)
|
||||
IServiceScopeFactory serviceScopeFactory, LightlessMediator mediator) : base(logger, mediator)
|
||||
{
|
||||
_mareConfigService = mareConfigService;
|
||||
_lightlessConfigService = lightlessConfigService;
|
||||
_serverConfigurationManager = serverConfigurationManager;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
_serviceScopeFactory = serviceScopeFactory;
|
||||
@@ -91,7 +91,7 @@ public class MarePlugin : MediatorSubscriberBase, IHostedService
|
||||
{
|
||||
var version = Assembly.GetExecutingAssembly().GetName().Version!;
|
||||
Logger.LogInformation("Launching {name} {major}.{minor}.{build}", "Lightless Sync", version.Major, version.Minor, version.Build);
|
||||
Mediator.Publish(new EventMessage(new Services.Events.Event(nameof(MarePlugin), Services.Events.EventSeverity.Informational,
|
||||
Mediator.Publish(new EventMessage(new Services.Events.Event(nameof(LightlessPlugin), Services.Events.EventSeverity.Informational,
|
||||
$"Starting Lightless Sync {version.Major}.{version.Minor}.{version.Build}")));
|
||||
|
||||
Mediator.Subscribe<SwitchToMainUiMessage>(this, (msg) => { if (_launchTask == null || _launchTask.IsCompleted) _launchTask = Task.Run(WaitForPlayerAndLaunchCharacterManager); });
|
||||
@@ -109,7 +109,7 @@ public class MarePlugin : MediatorSubscriberBase, IHostedService
|
||||
|
||||
DalamudUtilOnLogOut();
|
||||
|
||||
Logger.LogDebug("Halting MarePlugin");
|
||||
Logger.LogDebug("Halting LightlessPlugin");
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
@@ -142,7 +142,7 @@ public class MarePlugin : MediatorSubscriberBase, IHostedService
|
||||
_runtimeServiceScope = _serviceScopeFactory.CreateScope();
|
||||
_runtimeServiceScope.ServiceProvider.GetRequiredService<UiService>();
|
||||
_runtimeServiceScope.ServiceProvider.GetRequiredService<CommandManagerService>();
|
||||
if (!_mareConfigService.Current.HasValidSetup() || !_serverConfigurationManager.HasValidConfig())
|
||||
if (!_lightlessConfigService.Current.HasValidSetup() || !_serverConfigurationManager.HasValidConfig())
|
||||
{
|
||||
Mediator.Publish(new SwitchToIntroUiMessage());
|
||||
return;
|
||||
@@ -153,11 +153,11 @@ public class MarePlugin : MediatorSubscriberBase, IHostedService
|
||||
_runtimeServiceScope.ServiceProvider.GetRequiredService<NotificationService>();
|
||||
|
||||
#if !DEBUG
|
||||
if (_mareConfigService.Current.LogLevel != LogLevel.Information)
|
||||
if (_lightlessConfigService.Current.LogLevel != LogLevel.Information)
|
||||
{
|
||||
Mediator.Publish(new NotificationMessage("Abnormal Log Level",
|
||||
$"Your log level is set to '{_mareConfigService.Current.LogLevel}' which is not recommended for normal usage. Set it to '{LogLevel.Information}' in \"Mare Settings -> Debug\" unless instructed otherwise.",
|
||||
MareConfiguration.Models.NotificationType.Error, TimeSpan.FromSeconds(15000)));
|
||||
$"Your log level is set to '{_lightlessConfigService.Current.LogLevel}' which is not recommended for normal usage. Set it to '{LogLevel.Information}' in \"Lightless Settings -> Debug\" unless instructed otherwise.",
|
||||
LightlessConfiguration.Models.NotificationType.Error, TimeSpan.FromSeconds(15000)));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -11,13 +11,13 @@ public class FileDownloadManagerFactory
|
||||
private readonly FileCompactor _fileCompactor;
|
||||
private readonly FileTransferOrchestrator _fileTransferOrchestrator;
|
||||
private readonly ILoggerFactory _loggerFactory;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
|
||||
public FileDownloadManagerFactory(ILoggerFactory loggerFactory, MareMediator mareMediator, FileTransferOrchestrator fileTransferOrchestrator,
|
||||
public FileDownloadManagerFactory(ILoggerFactory loggerFactory, LightlessMediator lightlessMediator, FileTransferOrchestrator fileTransferOrchestrator,
|
||||
FileCacheManager fileCacheManager, FileCompactor fileCompactor)
|
||||
{
|
||||
_loggerFactory = loggerFactory;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
_fileTransferOrchestrator = fileTransferOrchestrator;
|
||||
_fileCacheManager = fileCacheManager;
|
||||
_fileCompactor = fileCompactor;
|
||||
@@ -25,6 +25,6 @@ public class FileDownloadManagerFactory
|
||||
|
||||
public FileDownloadManager Create()
|
||||
{
|
||||
return new FileDownloadManager(_loggerFactory.CreateLogger<FileDownloadManager>(), _mareMediator, _fileTransferOrchestrator, _fileCacheManager, _fileCompactor);
|
||||
return new FileDownloadManager(_loggerFactory.CreateLogger<FileDownloadManager>(), _lightlessMediator, _fileTransferOrchestrator, _fileCacheManager, _fileCompactor);
|
||||
}
|
||||
}
|
||||
@@ -10,21 +10,21 @@ public class GameObjectHandlerFactory
|
||||
{
|
||||
private readonly DalamudUtilService _dalamudUtilService;
|
||||
private readonly ILoggerFactory _loggerFactory;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
private readonly PerformanceCollectorService _performanceCollectorService;
|
||||
|
||||
public GameObjectHandlerFactory(ILoggerFactory loggerFactory, PerformanceCollectorService performanceCollectorService, MareMediator mareMediator,
|
||||
public GameObjectHandlerFactory(ILoggerFactory loggerFactory, PerformanceCollectorService performanceCollectorService, LightlessMediator lightlessMediator,
|
||||
DalamudUtilService dalamudUtilService)
|
||||
{
|
||||
_loggerFactory = loggerFactory;
|
||||
_performanceCollectorService = performanceCollectorService;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
_dalamudUtilService = dalamudUtilService;
|
||||
}
|
||||
|
||||
public async Task<GameObjectHandler> Create(ObjectKind objectKind, Func<nint> getAddressFunc, bool isWatched = false)
|
||||
{
|
||||
return await _dalamudUtilService.RunOnFrameworkThread(() => new GameObjectHandler(_loggerFactory.CreateLogger<GameObjectHandler>(),
|
||||
_performanceCollectorService, _mareMediator, _dalamudUtilService, objectKind, getAddressFunc, isWatched)).ConfigureAwait(false);
|
||||
_performanceCollectorService, _lightlessMediator, _dalamudUtilService, objectKind, getAddressFunc, isWatched)).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
@@ -10,26 +10,26 @@ public class PairFactory
|
||||
{
|
||||
private readonly PairHandlerFactory _cachedPlayerFactory;
|
||||
private readonly ILoggerFactory _loggerFactory;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
private readonly ServerConfigurationManager _serverConfigurationManager;
|
||||
|
||||
public PairFactory(ILoggerFactory loggerFactory, PairHandlerFactory cachedPlayerFactory,
|
||||
MareMediator mareMediator, ServerConfigurationManager serverConfigurationManager)
|
||||
LightlessMediator lightlessMediator, ServerConfigurationManager serverConfigurationManager)
|
||||
{
|
||||
_loggerFactory = loggerFactory;
|
||||
_cachedPlayerFactory = cachedPlayerFactory;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
_serverConfigurationManager = serverConfigurationManager;
|
||||
}
|
||||
|
||||
public Pair Create(UserFullPairDto userPairDto)
|
||||
{
|
||||
return new Pair(_loggerFactory.CreateLogger<Pair>(), userPairDto, _cachedPlayerFactory, _mareMediator, _serverConfigurationManager);
|
||||
return new Pair(_loggerFactory.CreateLogger<Pair>(), userPairDto, _cachedPlayerFactory, _lightlessMediator, _serverConfigurationManager);
|
||||
}
|
||||
|
||||
public Pair Create(UserPairDto userPairDto)
|
||||
{
|
||||
return new Pair(_loggerFactory.CreateLogger<Pair>(), new(userPairDto.User, userPairDto.IndividualPairStatus, [], userPairDto.OwnPermissions, userPairDto.OtherPermissions),
|
||||
_cachedPlayerFactory, _mareMediator, _serverConfigurationManager);
|
||||
_cachedPlayerFactory, _lightlessMediator, _serverConfigurationManager);
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class PairHandlerFactory
|
||||
private readonly IHostApplicationLifetime _hostApplicationLifetime;
|
||||
private readonly IpcManager _ipcManager;
|
||||
private readonly ILoggerFactory _loggerFactory;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
private readonly PlayerPerformanceService _playerPerformanceService;
|
||||
private readonly ServerConfigurationManager _serverConfigManager;
|
||||
private readonly PluginWarningNotificationService _pluginWarningNotificationManager;
|
||||
@@ -27,7 +27,7 @@ public class PairHandlerFactory
|
||||
public PairHandlerFactory(ILoggerFactory loggerFactory, GameObjectHandlerFactory gameObjectHandlerFactory, IpcManager ipcManager,
|
||||
FileDownloadManagerFactory fileDownloadManagerFactory, DalamudUtilService dalamudUtilService,
|
||||
PluginWarningNotificationService pluginWarningNotificationManager, IHostApplicationLifetime hostApplicationLifetime,
|
||||
FileCacheManager fileCacheManager, MareMediator mareMediator, PlayerPerformanceService playerPerformanceService,
|
||||
FileCacheManager fileCacheManager, LightlessMediator lightlessMediator, PlayerPerformanceService playerPerformanceService,
|
||||
ServerConfigurationManager serverConfigManager)
|
||||
{
|
||||
_loggerFactory = loggerFactory;
|
||||
@@ -38,7 +38,7 @@ public class PairHandlerFactory
|
||||
_pluginWarningNotificationManager = pluginWarningNotificationManager;
|
||||
_hostApplicationLifetime = hostApplicationLifetime;
|
||||
_fileCacheManager = fileCacheManager;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
_playerPerformanceService = playerPerformanceService;
|
||||
_serverConfigManager = serverConfigManager;
|
||||
}
|
||||
@@ -47,6 +47,6 @@ public class PairHandlerFactory
|
||||
{
|
||||
return new PairHandler(_loggerFactory.CreateLogger<PairHandler>(), pair, _gameObjectHandlerFactory,
|
||||
_ipcManager, _fileDownloadManagerFactory.Create(), _pluginWarningNotificationManager, _dalamudUtilService, _hostApplicationLifetime,
|
||||
_fileCacheManager, _mareMediator, _playerPerformanceService, _serverConfigManager);
|
||||
_fileCacheManager, _lightlessMediator, _playerPerformanceService, _serverConfigManager);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
using LightlessSync.API.Data.Enum;
|
||||
using LightlessSync.FileCache;
|
||||
using LightlessSync.Interop.Ipc;
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.PlayerData.Data;
|
||||
using LightlessSync.PlayerData.Handlers;
|
||||
using LightlessSync.Services;
|
||||
@@ -20,12 +20,12 @@ public class PlayerDataFactory
|
||||
private readonly ILogger<PlayerDataFactory> _logger;
|
||||
private readonly PerformanceCollectorService _performanceCollector;
|
||||
private readonly XivDataAnalyzer _modelAnalyzer;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
private readonly TransientResourceManager _transientResourceManager;
|
||||
|
||||
public PlayerDataFactory(ILogger<PlayerDataFactory> logger, DalamudUtilService dalamudUtil, IpcManager ipcManager,
|
||||
TransientResourceManager transientResourceManager, FileCacheManager fileReplacementFactory,
|
||||
PerformanceCollectorService performanceCollector, XivDataAnalyzer modelAnalyzer, MareMediator mareMediator)
|
||||
PerformanceCollectorService performanceCollector, XivDataAnalyzer modelAnalyzer, LightlessMediator lightlessMediator)
|
||||
{
|
||||
_logger = logger;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
@@ -34,7 +34,7 @@ public class PlayerDataFactory
|
||||
_fileCacheManager = fileReplacementFactory;
|
||||
_performanceCollector = performanceCollector;
|
||||
_modelAnalyzer = modelAnalyzer;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
_logger.LogTrace("Creating {this}", nameof(PlayerDataFactory));
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ public class PlayerDataFactory
|
||||
|
||||
if (noValidationFailed > 0)
|
||||
{
|
||||
_mareMediator.Publish(new NotificationMessage("Invalid Skeleton Setup",
|
||||
_lightlessMediator.Publish(new NotificationMessage("Invalid Skeleton Setup",
|
||||
$"Your client is attempting to send {noValidationFailed} animation files with invalid bone data. Those animation files have been removed from your sent data. " +
|
||||
$"Verify that you are using the correct skeleton for those animation files (Check /xllog for more information).",
|
||||
NotificationType.Warning, TimeSpan.FromSeconds(10)));
|
||||
|
||||
@@ -21,7 +21,7 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase, IHighP
|
||||
private CancellationTokenSource _zoningCts = new();
|
||||
|
||||
public GameObjectHandler(ILogger<GameObjectHandler> logger, PerformanceCollectorService performanceCollector,
|
||||
MareMediator mediator, DalamudUtilService dalamudUtil, ObjectKind objectKind, Func<IntPtr> getAddress, bool ownedObject = true) : base(logger, mediator)
|
||||
LightlessMediator mediator, DalamudUtilService dalamudUtil, ObjectKind objectKind, Func<IntPtr> getAddress, bool ownedObject = true) : base(logger, mediator)
|
||||
{
|
||||
_performanceCollector = performanceCollector;
|
||||
ObjectKind = objectKind;
|
||||
|
||||
@@ -48,7 +48,7 @@ public sealed class PairHandler : DisposableMediatorSubscriberBase
|
||||
IpcManager ipcManager, FileDownloadManager transferManager,
|
||||
PluginWarningNotificationService pluginWarningNotificationManager,
|
||||
DalamudUtilService dalamudUtil, IHostApplicationLifetime lifetime,
|
||||
FileCacheManager fileDbManager, MareMediator mediator,
|
||||
FileCacheManager fileDbManager, LightlessMediator mediator,
|
||||
PlayerPerformanceService playerPerformanceService,
|
||||
ServerConfigurationManager serverConfigManager) : base(logger, mediator)
|
||||
{
|
||||
|
||||
@@ -18,13 +18,13 @@ public class Pair
|
||||
private readonly PairHandlerFactory _cachedPlayerFactory;
|
||||
private readonly SemaphoreSlim _creationSemaphore = new(1);
|
||||
private readonly ILogger<Pair> _logger;
|
||||
private readonly MareMediator _mediator;
|
||||
private readonly LightlessMediator _mediator;
|
||||
private readonly ServerConfigurationManager _serverConfigurationManager;
|
||||
private CancellationTokenSource _applicationCts = new();
|
||||
private OnlineUserIdentDto? _onlineUserIdentDto = null;
|
||||
|
||||
public Pair(ILogger<Pair> logger, UserFullPairDto userPair, PairHandlerFactory cachedPlayerFactory,
|
||||
MareMediator mediator, ServerConfigurationManager serverConfigurationManager)
|
||||
LightlessMediator mediator, ServerConfigurationManager serverConfigurationManager)
|
||||
{
|
||||
_logger = logger;
|
||||
UserPair = userPair;
|
||||
|
||||
@@ -4,8 +4,8 @@ using LightlessSync.API.Data.Comparer;
|
||||
using LightlessSync.API.Data.Extensions;
|
||||
using LightlessSync.API.Dto.Group;
|
||||
using LightlessSync.API.Dto.User;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.PlayerData.Factories;
|
||||
using LightlessSync.Services.Events;
|
||||
using LightlessSync.Services.Mediator;
|
||||
@@ -18,7 +18,7 @@ public sealed class PairManager : DisposableMediatorSubscriberBase
|
||||
{
|
||||
private readonly ConcurrentDictionary<UserData, Pair> _allClientPairs = new(UserDataComparer.Instance);
|
||||
private readonly ConcurrentDictionary<GroupData, GroupFullInfoDto> _allGroups = new(GroupDataComparer.Instance);
|
||||
private readonly MareConfigService _configurationService;
|
||||
private readonly LightlessConfigService _configurationService;
|
||||
private readonly IContextMenu _dalamudContextMenu;
|
||||
private readonly PairFactory _pairFactory;
|
||||
private Lazy<List<Pair>> _directPairsInternal;
|
||||
@@ -26,7 +26,7 @@ public sealed class PairManager : DisposableMediatorSubscriberBase
|
||||
private Lazy<Dictionary<Pair, List<GroupFullInfoDto>>> _pairsWithGroupsInternal;
|
||||
|
||||
public PairManager(ILogger<PairManager> logger, PairFactory pairFactory,
|
||||
MareConfigService configurationService, MareMediator mediator,
|
||||
LightlessConfigService configurationService, LightlessMediator mediator,
|
||||
IContextMenu dalamudContextMenu) : base(logger, mediator)
|
||||
{
|
||||
_pairFactory = pairFactory;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class VisibleUserDataDistributor : DisposableMediatorSubscriberBase
|
||||
|
||||
|
||||
public VisibleUserDataDistributor(ILogger<VisibleUserDataDistributor> logger, ApiController apiController, DalamudUtilService dalamudUtil,
|
||||
PairManager pairManager, MareMediator mediator, FileUploadManager fileTransferManager) : base(logger, mediator)
|
||||
PairManager pairManager, LightlessMediator mediator, FileUploadManager fileTransferManager) : base(logger, mediator)
|
||||
{
|
||||
_apiController = apiController;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
|
||||
@@ -23,7 +23,7 @@ public sealed class CacheCreationService : DisposableMediatorSubscriberBase
|
||||
private bool _haltCharaDataCreation;
|
||||
private bool _isZoning = false;
|
||||
|
||||
public CacheCreationService(ILogger<CacheCreationService> logger, MareMediator mediator, GameObjectHandlerFactory gameObjectHandlerFactory,
|
||||
public CacheCreationService(ILogger<CacheCreationService> logger, LightlessMediator mediator, GameObjectHandlerFactory gameObjectHandlerFactory,
|
||||
PlayerDataFactory characterDataFactory, DalamudUtilService dalamudUtil) : base(logger, mediator)
|
||||
{
|
||||
_characterDataFactory = characterDataFactory;
|
||||
|
||||
@@ -6,8 +6,8 @@ using Dalamud.Plugin.Services;
|
||||
using LightlessSync.FileCache;
|
||||
using LightlessSync.Interop;
|
||||
using LightlessSync.Interop.Ipc;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.MareConfiguration.Configurations;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.LightlessConfiguration.Configurations;
|
||||
using LightlessSync.PlayerData.Factories;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
using LightlessSync.PlayerData.Services;
|
||||
@@ -76,7 +76,7 @@ public sealed class Plugin : IDalamudPlugin
|
||||
{
|
||||
lb.ClearProviders();
|
||||
lb.AddDalamudLogging(pluginLog, gameData.HasModifiedGameDataFiles);
|
||||
lb.AddFile(Path.Combine(traceDir, $"mare-trace-{DateTime.Now:yyyy-MM-dd-HH-mm-ss}.log"), (opt) =>
|
||||
lb.AddFile(Path.Combine(traceDir, $"lightless-trace-{DateTime.Now:yyyy-MM-dd-HH-mm-ss}.log"), (opt) =>
|
||||
{
|
||||
opt.Append = true;
|
||||
opt.RollingFilesConvention = FileLoggerOptions.FileRollingConvention.Ascending;
|
||||
@@ -91,8 +91,8 @@ public sealed class Plugin : IDalamudPlugin
|
||||
collection.AddSingleton<FileDialogManager>();
|
||||
collection.AddSingleton(new Dalamud.Localization("LightlessSync.Localization.", "", useEmbedded: true));
|
||||
|
||||
// add mare related singletons
|
||||
collection.AddSingleton<MareMediator>();
|
||||
// add lightless related singletons
|
||||
collection.AddSingleton<LightlessMediator>();
|
||||
collection.AddSingleton<FileCacheManager>();
|
||||
collection.AddSingleton<ServerConfigurationManager>();
|
||||
collection.AddSingleton<ApiController>();
|
||||
@@ -100,8 +100,8 @@ public sealed class Plugin : IDalamudPlugin
|
||||
collection.AddSingleton<HubFactory>();
|
||||
collection.AddSingleton<FileUploadManager>();
|
||||
collection.AddSingleton<FileTransferOrchestrator>();
|
||||
collection.AddSingleton<MarePlugin>();
|
||||
collection.AddSingleton<MareProfileManager>();
|
||||
collection.AddSingleton<LightlessPlugin>();
|
||||
collection.AddSingleton<LightlessProfileManager>();
|
||||
collection.AddSingleton<GameObjectHandlerFactory>();
|
||||
collection.AddSingleton<FileDownloadManagerFactory>();
|
||||
collection.AddSingleton<PairHandlerFactory>();
|
||||
@@ -123,47 +123,47 @@ public sealed class Plugin : IDalamudPlugin
|
||||
collection.AddSingleton<CharaDataGposeTogetherManager>();
|
||||
|
||||
collection.AddSingleton(s => new VfxSpawnManager(s.GetRequiredService<ILogger<VfxSpawnManager>>(),
|
||||
gameInteropProvider, s.GetRequiredService<MareMediator>()));
|
||||
gameInteropProvider, s.GetRequiredService<LightlessMediator>()));
|
||||
collection.AddSingleton((s) => new BlockedCharacterHandler(s.GetRequiredService<ILogger<BlockedCharacterHandler>>(), gameInteropProvider));
|
||||
collection.AddSingleton((s) => new IpcProvider(s.GetRequiredService<ILogger<IpcProvider>>(),
|
||||
pluginInterface,
|
||||
s.GetRequiredService<CharaDataManager>(),
|
||||
s.GetRequiredService<MareMediator>()));
|
||||
s.GetRequiredService<LightlessMediator>()));
|
||||
collection.AddSingleton<SelectPairForTagUi>();
|
||||
collection.AddSingleton((s) => new EventAggregator(pluginInterface.ConfigDirectory.FullName,
|
||||
s.GetRequiredService<ILogger<EventAggregator>>(), s.GetRequiredService<MareMediator>()));
|
||||
s.GetRequiredService<ILogger<EventAggregator>>(), s.GetRequiredService<LightlessMediator>()));
|
||||
collection.AddSingleton((s) => new DalamudUtilService(s.GetRequiredService<ILogger<DalamudUtilService>>(),
|
||||
clientState, objectTable, framework, gameGui, condition, gameData, targetManager, gameConfig,
|
||||
s.GetRequiredService<BlockedCharacterHandler>(), s.GetRequiredService<MareMediator>(), s.GetRequiredService<PerformanceCollectorService>(),
|
||||
s.GetRequiredService<MareConfigService>()));
|
||||
collection.AddSingleton((s) => new DtrEntry(s.GetRequiredService<ILogger<DtrEntry>>(), dtrBar, s.GetRequiredService<MareConfigService>(),
|
||||
s.GetRequiredService<MareMediator>(), s.GetRequiredService<PairManager>(), s.GetRequiredService<ApiController>()));
|
||||
s.GetRequiredService<BlockedCharacterHandler>(), s.GetRequiredService<LightlessMediator>(), s.GetRequiredService<PerformanceCollectorService>(),
|
||||
s.GetRequiredService<LightlessConfigService>()));
|
||||
collection.AddSingleton((s) => new DtrEntry(s.GetRequiredService<ILogger<DtrEntry>>(), dtrBar, s.GetRequiredService<LightlessConfigService>(),
|
||||
s.GetRequiredService<LightlessMediator>(), s.GetRequiredService<PairManager>(), s.GetRequiredService<ApiController>()));
|
||||
collection.AddSingleton(s => new PairManager(s.GetRequiredService<ILogger<PairManager>>(), s.GetRequiredService<PairFactory>(),
|
||||
s.GetRequiredService<MareConfigService>(), s.GetRequiredService<MareMediator>(), contextMenu));
|
||||
s.GetRequiredService<LightlessConfigService>(), s.GetRequiredService<LightlessMediator>(), contextMenu));
|
||||
collection.AddSingleton<RedrawManager>();
|
||||
collection.AddSingleton((s) => new IpcCallerPenumbra(s.GetRequiredService<ILogger<IpcCallerPenumbra>>(), pluginInterface,
|
||||
s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<MareMediator>(), s.GetRequiredService<RedrawManager>()));
|
||||
s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<LightlessMediator>(), s.GetRequiredService<RedrawManager>()));
|
||||
collection.AddSingleton((s) => new IpcCallerGlamourer(s.GetRequiredService<ILogger<IpcCallerGlamourer>>(), pluginInterface,
|
||||
s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<MareMediator>(), s.GetRequiredService<RedrawManager>()));
|
||||
s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<LightlessMediator>(), s.GetRequiredService<RedrawManager>()));
|
||||
collection.AddSingleton((s) => new IpcCallerCustomize(s.GetRequiredService<ILogger<IpcCallerCustomize>>(), pluginInterface,
|
||||
s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<MareMediator>()));
|
||||
s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<LightlessMediator>()));
|
||||
collection.AddSingleton((s) => new IpcCallerHeels(s.GetRequiredService<ILogger<IpcCallerHeels>>(), pluginInterface,
|
||||
s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<MareMediator>()));
|
||||
s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<LightlessMediator>()));
|
||||
collection.AddSingleton((s) => new IpcCallerHonorific(s.GetRequiredService<ILogger<IpcCallerHonorific>>(), pluginInterface,
|
||||
s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<MareMediator>()));
|
||||
s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<LightlessMediator>()));
|
||||
collection.AddSingleton((s) => new IpcCallerMoodles(s.GetRequiredService<ILogger<IpcCallerMoodles>>(), pluginInterface,
|
||||
s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<MareMediator>()));
|
||||
s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<LightlessMediator>()));
|
||||
collection.AddSingleton((s) => new IpcCallerPetNames(s.GetRequiredService<ILogger<IpcCallerPetNames>>(), pluginInterface,
|
||||
s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<MareMediator>()));
|
||||
s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<LightlessMediator>()));
|
||||
collection.AddSingleton((s) => new IpcCallerBrio(s.GetRequiredService<ILogger<IpcCallerBrio>>(), pluginInterface,
|
||||
s.GetRequiredService<DalamudUtilService>()));
|
||||
collection.AddSingleton((s) => new IpcManager(s.GetRequiredService<ILogger<IpcManager>>(),
|
||||
s.GetRequiredService<MareMediator>(), s.GetRequiredService<IpcCallerPenumbra>(), s.GetRequiredService<IpcCallerGlamourer>(),
|
||||
s.GetRequiredService<LightlessMediator>(), s.GetRequiredService<IpcCallerPenumbra>(), s.GetRequiredService<IpcCallerGlamourer>(),
|
||||
s.GetRequiredService<IpcCallerCustomize>(), s.GetRequiredService<IpcCallerHeels>(), s.GetRequiredService<IpcCallerHonorific>(),
|
||||
s.GetRequiredService<IpcCallerMoodles>(), s.GetRequiredService<IpcCallerPetNames>(), s.GetRequiredService<IpcCallerBrio>()));
|
||||
collection.AddSingleton((s) => new NotificationService(s.GetRequiredService<ILogger<NotificationService>>(),
|
||||
s.GetRequiredService<MareMediator>(), s.GetRequiredService<DalamudUtilService>(),
|
||||
notificationManager, chatGui, s.GetRequiredService<MareConfigService>()));
|
||||
s.GetRequiredService<LightlessMediator>(), s.GetRequiredService<DalamudUtilService>(),
|
||||
notificationManager, chatGui, s.GetRequiredService<LightlessConfigService>()));
|
||||
collection.AddSingleton((s) =>
|
||||
{
|
||||
var httpClient = new HttpClient();
|
||||
@@ -171,7 +171,7 @@ public sealed class Plugin : IDalamudPlugin
|
||||
httpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue("LightlessSync", ver!.Major + "." + ver!.Minor + "." + ver!.Build));
|
||||
return httpClient;
|
||||
});
|
||||
collection.AddSingleton((s) => new MareConfigService(pluginInterface.ConfigDirectory.FullName));
|
||||
collection.AddSingleton((s) => new LightlessConfigService(pluginInterface.ConfigDirectory.FullName));
|
||||
collection.AddSingleton((s) => new ServerConfigService(pluginInterface.ConfigDirectory.FullName));
|
||||
collection.AddSingleton((s) => new NotesConfigService(pluginInterface.ConfigDirectory.FullName));
|
||||
collection.AddSingleton((s) => new ServerTagConfigService(pluginInterface.ConfigDirectory.FullName));
|
||||
@@ -179,14 +179,14 @@ public sealed class Plugin : IDalamudPlugin
|
||||
collection.AddSingleton((s) => new XivDataStorageService(pluginInterface.ConfigDirectory.FullName));
|
||||
collection.AddSingleton((s) => new PlayerPerformanceConfigService(pluginInterface.ConfigDirectory.FullName));
|
||||
collection.AddSingleton((s) => new CharaDataConfigService(pluginInterface.ConfigDirectory.FullName));
|
||||
collection.AddSingleton<IConfigService<IMareConfiguration>>(s => s.GetRequiredService<MareConfigService>());
|
||||
collection.AddSingleton<IConfigService<IMareConfiguration>>(s => s.GetRequiredService<ServerConfigService>());
|
||||
collection.AddSingleton<IConfigService<IMareConfiguration>>(s => s.GetRequiredService<NotesConfigService>());
|
||||
collection.AddSingleton<IConfigService<IMareConfiguration>>(s => s.GetRequiredService<ServerTagConfigService>());
|
||||
collection.AddSingleton<IConfigService<IMareConfiguration>>(s => s.GetRequiredService<TransientConfigService>());
|
||||
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<IConfigService<ILightlessConfiguration>>(s => s.GetRequiredService<LightlessConfigService>());
|
||||
collection.AddSingleton<IConfigService<ILightlessConfiguration>>(s => s.GetRequiredService<ServerConfigService>());
|
||||
collection.AddSingleton<IConfigService<ILightlessConfiguration>>(s => s.GetRequiredService<NotesConfigService>());
|
||||
collection.AddSingleton<IConfigService<ILightlessConfiguration>>(s => s.GetRequiredService<ServerTagConfigService>());
|
||||
collection.AddSingleton<IConfigService<ILightlessConfiguration>>(s => s.GetRequiredService<TransientConfigService>());
|
||||
collection.AddSingleton<IConfigService<ILightlessConfiguration>>(s => s.GetRequiredService<XivDataStorageService>());
|
||||
collection.AddSingleton<IConfigService<ILightlessConfiguration>>(s => s.GetRequiredService<PlayerPerformanceConfigService>());
|
||||
collection.AddSingleton<IConfigService<ILightlessConfiguration>>(s => s.GetRequiredService<CharaDataConfigService>());
|
||||
collection.AddSingleton<ConfigurationMigrator>();
|
||||
collection.AddSingleton<ConfigurationSaveService>();
|
||||
|
||||
@@ -209,28 +209,28 @@ public sealed class Plugin : IDalamudPlugin
|
||||
collection.AddScoped<WindowMediatorSubscriberBase, CharaDataHubUi>();
|
||||
|
||||
collection.AddScoped<WindowMediatorSubscriberBase, EditProfileUi>((s) => new EditProfileUi(s.GetRequiredService<ILogger<EditProfileUi>>(),
|
||||
s.GetRequiredService<MareMediator>(), s.GetRequiredService<ApiController>(), s.GetRequiredService<UiSharedService>(), s.GetRequiredService<FileDialogManager>(),
|
||||
s.GetRequiredService<MareProfileManager>(), s.GetRequiredService<PerformanceCollectorService>()));
|
||||
s.GetRequiredService<LightlessMediator>(), s.GetRequiredService<ApiController>(), s.GetRequiredService<UiSharedService>(), s.GetRequiredService<FileDialogManager>(),
|
||||
s.GetRequiredService<LightlessProfileManager>(), s.GetRequiredService<PerformanceCollectorService>()));
|
||||
collection.AddScoped<WindowMediatorSubscriberBase, PopupHandler>();
|
||||
collection.AddScoped<IPopupHandler, BanUserPopupHandler>();
|
||||
collection.AddScoped<IPopupHandler, CensusPopupHandler>();
|
||||
collection.AddScoped<CacheCreationService>();
|
||||
collection.AddScoped<PlayerDataFactory>();
|
||||
collection.AddScoped<VisibleUserDataDistributor>();
|
||||
collection.AddScoped((s) => new UiService(s.GetRequiredService<ILogger<UiService>>(), pluginInterface.UiBuilder, s.GetRequiredService<MareConfigService>(),
|
||||
collection.AddScoped((s) => new UiService(s.GetRequiredService<ILogger<UiService>>(), pluginInterface.UiBuilder, s.GetRequiredService<LightlessConfigService>(),
|
||||
s.GetRequiredService<WindowSystem>(), s.GetServices<WindowMediatorSubscriberBase>(),
|
||||
s.GetRequiredService<UiFactory>(),
|
||||
s.GetRequiredService<FileDialogManager>(), s.GetRequiredService<MareMediator>()));
|
||||
s.GetRequiredService<FileDialogManager>(), s.GetRequiredService<LightlessMediator>()));
|
||||
collection.AddScoped((s) => new CommandManagerService(commandManager, s.GetRequiredService<PerformanceCollectorService>(),
|
||||
s.GetRequiredService<ServerConfigurationManager>(), s.GetRequiredService<CacheMonitor>(), s.GetRequiredService<ApiController>(),
|
||||
s.GetRequiredService<MareMediator>(), s.GetRequiredService<MareConfigService>()));
|
||||
s.GetRequiredService<LightlessMediator>(), s.GetRequiredService<LightlessConfigService>()));
|
||||
collection.AddScoped((s) => new UiSharedService(s.GetRequiredService<ILogger<UiSharedService>>(), s.GetRequiredService<IpcManager>(), s.GetRequiredService<ApiController>(),
|
||||
s.GetRequiredService<CacheMonitor>(), s.GetRequiredService<FileDialogManager>(), s.GetRequiredService<MareConfigService>(), s.GetRequiredService<DalamudUtilService>(),
|
||||
s.GetRequiredService<CacheMonitor>(), s.GetRequiredService<FileDialogManager>(), s.GetRequiredService<LightlessConfigService>(), s.GetRequiredService<DalamudUtilService>(),
|
||||
pluginInterface, textureProvider, s.GetRequiredService<Dalamud.Localization>(), s.GetRequiredService<ServerConfigurationManager>(), s.GetRequiredService<TokenProvider>(),
|
||||
s.GetRequiredService<MareMediator>()));
|
||||
s.GetRequiredService<LightlessMediator>()));
|
||||
|
||||
collection.AddHostedService(p => p.GetRequiredService<ConfigurationSaveService>());
|
||||
collection.AddHostedService(p => p.GetRequiredService<MareMediator>());
|
||||
collection.AddHostedService(p => p.GetRequiredService<LightlessMediator>());
|
||||
collection.AddHostedService(p => p.GetRequiredService<NotificationService>());
|
||||
collection.AddHostedService(p => p.GetRequiredService<FileCacheManager>());
|
||||
collection.AddHostedService(p => p.GetRequiredService<ConfigurationMigrator>());
|
||||
@@ -239,7 +239,7 @@ public sealed class Plugin : IDalamudPlugin
|
||||
collection.AddHostedService(p => p.GetRequiredService<DtrEntry>());
|
||||
collection.AddHostedService(p => p.GetRequiredService<EventAggregator>());
|
||||
collection.AddHostedService(p => p.GetRequiredService<IpcProvider>());
|
||||
collection.AddHostedService(p => p.GetRequiredService<MarePlugin>());
|
||||
collection.AddHostedService(p => p.GetRequiredService<LightlessPlugin>());
|
||||
})
|
||||
.Build();
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public sealed class CharaDataCharacterHandler : DisposableMediatorSubscriberBase
|
||||
|
||||
public IEnumerable<HandledCharaDataEntry> HandledCharaData => _handledCharaData;
|
||||
|
||||
public CharaDataCharacterHandler(ILogger<CharaDataCharacterHandler> logger, MareMediator mediator,
|
||||
public CharaDataCharacterHandler(ILogger<CharaDataCharacterHandler> logger, LightlessMediator mediator,
|
||||
GameObjectHandlerFactory gameObjectHandlerFactory, DalamudUtilService dalamudUtilService,
|
||||
IpcManager ipcManager)
|
||||
: base(logger, mediator)
|
||||
|
||||
@@ -22,7 +22,7 @@ public sealed class CharaDataFileHandler : IDisposable
|
||||
private readonly FileUploadManager _fileUploadManager;
|
||||
private readonly GameObjectHandlerFactory _gameObjectHandlerFactory;
|
||||
private readonly ILogger<CharaDataFileHandler> _logger;
|
||||
private readonly MareCharaFileDataFactory _mareCharaFileDataFactory;
|
||||
private readonly LightlessCharaFileDataFactory _lightlessCharaFileDataFactory;
|
||||
private readonly PlayerDataFactory _playerDataFactory;
|
||||
private int _globalFileCounter = 0;
|
||||
|
||||
@@ -36,7 +36,7 @@ public sealed class CharaDataFileHandler : IDisposable
|
||||
_dalamudUtilService = dalamudUtilService;
|
||||
_gameObjectHandlerFactory = gameObjectHandlerFactory;
|
||||
_playerDataFactory = playerDataFactory;
|
||||
_mareCharaFileDataFactory = new(fileCacheManager);
|
||||
_lightlessCharaFileDataFactory = new(fileCacheManager);
|
||||
}
|
||||
|
||||
public void ComputeMissingFiles(CharaDataDownloadDto charaDataDownloadDto, out Dictionary<string, string> modPaths, out List<FileReplacementData> missingFiles)
|
||||
@@ -132,16 +132,16 @@ public sealed class CharaDataFileHandler : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
public Task<(MareCharaFileHeader loadedCharaFile, long expectedLength)> LoadCharaFileHeader(string filePath)
|
||||
public Task<(LightlessCharaFileHeader loadedCharaFile, long expectedLength)> LoadCharaFileHeader(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
using var unwrapped = File.OpenRead(filePath);
|
||||
using var lz4Stream = new LZ4Stream(unwrapped, LZ4StreamMode.Decompress, LZ4StreamFlags.HighCompression);
|
||||
using var reader = new BinaryReader(lz4Stream);
|
||||
var loadedCharaFile = MareCharaFileHeader.FromBinaryReader(filePath, reader);
|
||||
var loadedCharaFile = LightlessCharaFileHeader.FromBinaryReader(filePath, reader);
|
||||
|
||||
_logger.LogInformation("Read Mare Chara File");
|
||||
_logger.LogInformation("Read Lightless Chara File");
|
||||
_logger.LogInformation("Version: {ver}", (loadedCharaFile?.Version ?? -1));
|
||||
long expectedLength = 0;
|
||||
if (loadedCharaFile != null)
|
||||
@@ -181,19 +181,19 @@ public sealed class CharaDataFileHandler : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<string, string> McdfExtractFiles(MareCharaFileHeader? charaFileHeader, long expectedLength, List<string> extractedFiles)
|
||||
public Dictionary<string, string> McdfExtractFiles(LightlessCharaFileHeader? charaFileHeader, long expectedLength, List<string> extractedFiles)
|
||||
{
|
||||
if (charaFileHeader == null) return [];
|
||||
|
||||
using var lz4Stream = new LZ4Stream(File.OpenRead(charaFileHeader.FilePath), LZ4StreamMode.Decompress, LZ4StreamFlags.HighCompression);
|
||||
using var reader = new BinaryReader(lz4Stream);
|
||||
MareCharaFileHeader.AdvanceReaderToData(reader);
|
||||
LightlessCharaFileHeader.AdvanceReaderToData(reader);
|
||||
|
||||
long totalRead = 0;
|
||||
Dictionary<string, string> gamePathToFilePath = new(StringComparer.Ordinal);
|
||||
foreach (var fileData in charaFileHeader.CharaFileData.Files)
|
||||
{
|
||||
var fileName = Path.Combine(_fileCacheManager.CacheFolder, "mare_" + _globalFileCounter++ + ".tmp");
|
||||
var fileName = Path.Combine(_fileCacheManager.CacheFolder, "lightless_" + _globalFileCounter++ + ".tmp");
|
||||
extractedFiles.Add(fileName);
|
||||
var length = fileData.Length;
|
||||
var bufferSize = length;
|
||||
@@ -256,8 +256,8 @@ public sealed class CharaDataFileHandler : IDisposable
|
||||
var data = await CreatePlayerData().ConfigureAwait(false);
|
||||
if (data == null) return;
|
||||
|
||||
var mareCharaFileData = _mareCharaFileDataFactory.Create(description, data);
|
||||
MareCharaFileHeader output = new(MareCharaFileHeader.CurrentVersion, mareCharaFileData);
|
||||
var lightlessCharaFileData = _lightlessCharaFileDataFactory.Create(description, data);
|
||||
LightlessCharaFileHeader output = new(LightlessCharaFileHeader.CurrentVersion, lightlessCharaFileData);
|
||||
|
||||
using var fs = new FileStream(tempFilePath, FileMode.Create, FileAccess.ReadWrite, FileShare.None);
|
||||
using var lz4 = new LZ4Stream(fs, LZ4StreamMode.Compress, LZ4StreamFlags.HighCompression);
|
||||
@@ -291,7 +291,7 @@ public sealed class CharaDataFileHandler : IDisposable
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Failure Saving Mare Chara File, deleting output");
|
||||
_logger.LogError(ex, "Failure Saving Lightless Chara File, deleting output");
|
||||
File.Delete(tempFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class CharaDataGposeTogetherManager : DisposableMediatorSubscriberBase
|
||||
private CancellationTokenSource _lobbyCts = new();
|
||||
private int _poseGenerationExecutions = 0;
|
||||
|
||||
public CharaDataGposeTogetherManager(ILogger<CharaDataGposeTogetherManager> logger, MareMediator mediator,
|
||||
public CharaDataGposeTogetherManager(ILogger<CharaDataGposeTogetherManager> logger, LightlessMediator mediator,
|
||||
ApiController apiController, IpcCallerBrio brio, DalamudUtilService dalamudUtil, VfxSpawnManager vfxSpawnManager,
|
||||
CharaDataFileHandler charaDataFileHandler, CharaDataManager charaDataManager) : base(logger, mediator)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using K4os.Compression.LZ4.Legacy;
|
||||
using LightlessSync.API.Data;
|
||||
using LightlessSync.API.Dto.CharaData;
|
||||
using LightlessSync.Interop.Ipc;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.PlayerData.Factories;
|
||||
using LightlessSync.PlayerData.Handlers;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
@@ -42,10 +42,10 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
||||
|
||||
public CharaDataManager(ILogger<CharaDataManager> logger, ApiController apiController,
|
||||
CharaDataFileHandler charaDataFileHandler,
|
||||
MareMediator mareMediator, IpcManager ipcManager, DalamudUtilService dalamudUtilService,
|
||||
LightlessMediator lightlessMediator, IpcManager ipcManager, DalamudUtilService dalamudUtilService,
|
||||
FileDownloadManagerFactory fileDownloadManagerFactory,
|
||||
CharaDataConfigService charaDataConfigService, CharaDataNearbyManager charaDataNearbyManager,
|
||||
CharaDataCharacterHandler charaDataCharacterHandler, PairManager pairManager) : base(logger, mareMediator)
|
||||
CharaDataCharacterHandler charaDataCharacterHandler, PairManager pairManager) : base(logger, lightlessMediator)
|
||||
{
|
||||
_apiController = apiController;
|
||||
_fileHandler = charaDataFileHandler;
|
||||
@@ -55,7 +55,7 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
||||
_nearbyManager = charaDataNearbyManager;
|
||||
_characterHandler = charaDataCharacterHandler;
|
||||
_pairManager = pairManager;
|
||||
mareMediator.Subscribe<ConnectedMessage>(this, (msg) =>
|
||||
lightlessMediator.Subscribe<ConnectedMessage>(this, (msg) =>
|
||||
{
|
||||
_connectCts?.Cancel();
|
||||
_connectCts?.Dispose();
|
||||
@@ -75,7 +75,7 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
||||
_ = GetAllSharedData(token);
|
||||
}
|
||||
});
|
||||
mareMediator.Subscribe<DisconnectedMessage>(this, (msg) =>
|
||||
lightlessMediator.Subscribe<DisconnectedMessage>(this, (msg) =>
|
||||
{
|
||||
_ownCharaData.Clear();
|
||||
_metaInfoCache.Clear();
|
||||
@@ -98,7 +98,7 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
||||
public IEnumerable<HandledCharaDataEntry> HandledCharaData => _characterHandler.HandledCharaData;
|
||||
public bool Initialized { get; private set; }
|
||||
public CharaDataMetaInfoExtendedDto? LastDownloadedMetaInfo { get; private set; }
|
||||
public Task<(MareCharaFileHeader LoadedFile, long ExpectedLength)>? LoadedMcdfHeader { get; private set; }
|
||||
public Task<(LightlessCharaFileHeader LoadedFile, long ExpectedLength)>? LoadedMcdfHeader { get; private set; }
|
||||
public int MaxCreatableCharaData { get; private set; }
|
||||
public Task? McdfApplicationTask { get; private set; }
|
||||
public List<CharaDataMetaInfoExtendedDto> NearbyData => _nearbyData;
|
||||
@@ -519,7 +519,7 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveMareCharaFile(string description, string filePath)
|
||||
public void SaveLightlessCharaFile(string description, string filePath)
|
||||
{
|
||||
UiBlockingComputation = Task.Run(async () => await _fileHandler.SaveCharaFileAsync(description, filePath).ConfigureAwait(false));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
|
||||
using LightlessSync.API.Data;
|
||||
using LightlessSync.Interop;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.Services.CharaData.Models;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Services.ServerConfiguration;
|
||||
@@ -29,7 +29,7 @@ public sealed class CharaDataNearbyManager : DisposableMediatorSubscriberBase
|
||||
private (Guid VfxId, PoseEntryExtended Pose)? _hoveredVfx = null;
|
||||
private DateTime _lastExecutionTime = DateTime.UtcNow;
|
||||
private SemaphoreSlim _sharedDataUpdateSemaphore = new(1, 1);
|
||||
public CharaDataNearbyManager(ILogger<CharaDataNearbyManager> logger, MareMediator mediator,
|
||||
public CharaDataNearbyManager(ILogger<CharaDataNearbyManager> logger, LightlessMediator mediator,
|
||||
DalamudUtilService dalamudUtilService, VfxSpawnManager vfxSpawnManager,
|
||||
ServerConfigurationManager serverConfigurationManager,
|
||||
CharaDataConfigService charaDataConfigService) : base(logger, mediator)
|
||||
|
||||
@@ -4,17 +4,17 @@ using LightlessSync.Services.CharaData.Models;
|
||||
|
||||
namespace LightlessSync.Services.CharaData;
|
||||
|
||||
public sealed class MareCharaFileDataFactory
|
||||
public sealed class LightlessCharaFileDataFactory
|
||||
{
|
||||
private readonly FileCacheManager _fileCacheManager;
|
||||
|
||||
public MareCharaFileDataFactory(FileCacheManager fileCacheManager)
|
||||
public LightlessCharaFileDataFactory(FileCacheManager fileCacheManager)
|
||||
{
|
||||
_fileCacheManager = fileCacheManager;
|
||||
}
|
||||
|
||||
public MareCharaFileData Create(string description, CharacterData characterCacheDto)
|
||||
public LightlessCharaFileData Create(string description, CharacterData characterCacheDto)
|
||||
{
|
||||
return new MareCharaFileData(_fileCacheManager, description, characterCacheDto);
|
||||
return new LightlessCharaFileData(_fileCacheManager, description, characterCacheDto);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ using System.Text.Json;
|
||||
|
||||
namespace LightlessSync.Services.CharaData.Models;
|
||||
|
||||
public record MareCharaFileData
|
||||
public record LightlessCharaFileData
|
||||
{
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public string GlamourerData { get; set; } = string.Empty;
|
||||
@@ -15,8 +15,8 @@ public record MareCharaFileData
|
||||
public List<FileData> Files { get; set; } = [];
|
||||
public List<FileSwap> FileSwaps { get; set; } = [];
|
||||
|
||||
public MareCharaFileData() { }
|
||||
public MareCharaFileData(FileCacheManager manager, string description, CharacterData dto)
|
||||
public LightlessCharaFileData() { }
|
||||
public LightlessCharaFileData(FileCacheManager manager, string description, CharacterData dto)
|
||||
{
|
||||
Description = description;
|
||||
|
||||
@@ -59,9 +59,9 @@ public record MareCharaFileData
|
||||
return Encoding.UTF8.GetBytes(JsonSerializer.Serialize(this));
|
||||
}
|
||||
|
||||
public static MareCharaFileData FromByteArray(byte[] data)
|
||||
public static LightlessCharaFileData FromByteArray(byte[] data)
|
||||
{
|
||||
return JsonSerializer.Deserialize<MareCharaFileData>(Encoding.UTF8.GetString(data))!;
|
||||
return JsonSerializer.Deserialize<LightlessCharaFileData>(Encoding.UTF8.GetString(data))!;
|
||||
}
|
||||
|
||||
public record FileSwap(IEnumerable<string> GamePaths, string FileSwapPath);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
namespace LightlessSync.Services.CharaData.Models;
|
||||
|
||||
public record MareCharaFileHeader(byte Version, MareCharaFileData CharaFileData)
|
||||
public record LightlessCharaFileHeader(byte Version, LightlessCharaFileData CharaFileData)
|
||||
{
|
||||
public static readonly byte CurrentVersion = 1;
|
||||
|
||||
public byte Version { get; set; } = Version;
|
||||
public MareCharaFileData CharaFileData { get; set; } = CharaFileData;
|
||||
public LightlessCharaFileData CharaFileData { get; set; } = CharaFileData;
|
||||
public string FilePath { get; private set; } = string.Empty;
|
||||
|
||||
public void WriteToStream(BinaryWriter writer)
|
||||
@@ -20,19 +20,19 @@ public record MareCharaFileHeader(byte Version, MareCharaFileData CharaFileData)
|
||||
writer.Write(charaFileDataArray);
|
||||
}
|
||||
|
||||
public static MareCharaFileHeader? FromBinaryReader(string path, BinaryReader reader)
|
||||
public static LightlessCharaFileHeader? FromBinaryReader(string path, BinaryReader reader)
|
||||
{
|
||||
var chars = new string(reader.ReadChars(4));
|
||||
if (!string.Equals(chars, "MCDF", StringComparison.Ordinal)) throw new InvalidDataException("Not a Mare Chara File");
|
||||
if (!string.Equals(chars, "MCDF", StringComparison.Ordinal)) throw new InvalidDataException("Not a Lightless Chara File");
|
||||
|
||||
MareCharaFileHeader? decoded = null;
|
||||
LightlessCharaFileHeader? decoded = null;
|
||||
|
||||
var version = reader.ReadByte();
|
||||
if (version == 1)
|
||||
{
|
||||
var dataLength = reader.ReadInt32();
|
||||
|
||||
decoded = new(version, MareCharaFileData.FromByteArray(reader.ReadBytes(dataLength)))
|
||||
decoded = new(version, LightlessCharaFileData.FromByteArray(reader.ReadBytes(dataLength)))
|
||||
{
|
||||
FilePath = path,
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@ public sealed class CharacterAnalyzer : MediatorSubscriberBase, IDisposable
|
||||
private CancellationTokenSource _baseAnalysisCts = new();
|
||||
private string _lastDataHash = string.Empty;
|
||||
|
||||
public CharacterAnalyzer(ILogger<CharacterAnalyzer> logger, MareMediator mediator, FileCacheManager fileCacheManager, XivDataAnalyzer modelAnalyzer)
|
||||
public CharacterAnalyzer(ILogger<CharacterAnalyzer> logger, LightlessMediator mediator, FileCacheManager fileCacheManager, XivDataAnalyzer modelAnalyzer)
|
||||
: base(logger, mediator)
|
||||
{
|
||||
Mediator.Subscribe<CharacterDataCreatedMessage>(this, (msg) =>
|
||||
@@ -185,7 +185,7 @@ public sealed class CharacterAnalyzer : MediatorSubscriberBase, IDisposable
|
||||
LastAnalysis.Values.Sum(v => v.Values.Count),
|
||||
UiSharedService.ByteToString(LastAnalysis.Values.Sum(c => c.Values.Sum(v => v.OriginalSize))),
|
||||
UiSharedService.ByteToString(LastAnalysis.Values.Sum(c => c.Values.Sum(v => v.CompressedSize))));
|
||||
Logger.LogInformation("IMPORTANT NOTES:\n\r- For Mare up- and downloads only the compressed size is relevant.\n\r- An unusually high total files count beyond 200 and up will also increase your download time to others significantly.");
|
||||
Logger.LogInformation("IMPORTANT NOTES:\n\r- For Lightless up- and downloads only the compressed size is relevant.\n\r- An unusually high total files count beyond 200 and up will also increase your download time to others significantly.");
|
||||
}
|
||||
|
||||
internal sealed record FileDataEntry(string Hash, string FileType, List<string> GamePaths, List<string> FilePaths, long OriginalSize, long CompressedSize, long Triangles)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using Dalamud.Game.Command;
|
||||
using Dalamud.Plugin.Services;
|
||||
using LightlessSync.FileCache;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Services.ServerConfiguration;
|
||||
using LightlessSync.UI;
|
||||
@@ -17,15 +17,15 @@ public sealed class CommandManagerService : IDisposable
|
||||
|
||||
private readonly ApiController _apiController;
|
||||
private readonly ICommandManager _commandManager;
|
||||
private readonly MareMediator _mediator;
|
||||
private readonly MareConfigService _mareConfigService;
|
||||
private readonly LightlessMediator _mediator;
|
||||
private readonly LightlessConfigService _lightlessConfigService;
|
||||
private readonly PerformanceCollectorService _performanceCollectorService;
|
||||
private readonly CacheMonitor _cacheMonitor;
|
||||
private readonly ServerConfigurationManager _serverConfigurationManager;
|
||||
|
||||
public CommandManagerService(ICommandManager commandManager, PerformanceCollectorService performanceCollectorService,
|
||||
ServerConfigurationManager serverConfigurationManager, CacheMonitor periodicFileScanner,
|
||||
ApiController apiController, MareMediator mediator, MareConfigService mareConfigService)
|
||||
ApiController apiController, LightlessMediator mediator, LightlessConfigService lightlessConfigService)
|
||||
{
|
||||
_commandManager = commandManager;
|
||||
_performanceCollectorService = performanceCollectorService;
|
||||
@@ -33,16 +33,16 @@ public sealed class CommandManagerService : IDisposable
|
||||
_cacheMonitor = periodicFileScanner;
|
||||
_apiController = apiController;
|
||||
_mediator = mediator;
|
||||
_mareConfigService = mareConfigService;
|
||||
_lightlessConfigService = lightlessConfigService;
|
||||
_commandManager.AddHandler(_commandName, new CommandInfo(OnCommand)
|
||||
{
|
||||
HelpMessage = "Opens the Lightless Sync UI" + Environment.NewLine + Environment.NewLine +
|
||||
"Additionally possible commands:" + Environment.NewLine +
|
||||
"\t /light toggle - Disconnects from Mare, if connected. Connects to Mare, if disconnected" + Environment.NewLine +
|
||||
"\t /light toggle on|off - Connects or disconnects to Mare respectively" + Environment.NewLine +
|
||||
"\t /light gpose - Opens the Mare Character Data Hub window" + Environment.NewLine +
|
||||
"\t /light analyze - Opens the Mare Character Data Analysis window" + Environment.NewLine +
|
||||
"\t /light settings - Opens the Mare Settings window"
|
||||
"\t /light toggle - Disconnects from Lightless, if connected. Connects to Lightless, if disconnected" + Environment.NewLine +
|
||||
"\t /light toggle on|off - Connects or disconnects to Lightless respectively" + Environment.NewLine +
|
||||
"\t /light gpose - Opens the Lightless Character Data Hub window" + Environment.NewLine +
|
||||
"\t /light analyze - Opens the Lightless Character Data Analysis window" + Environment.NewLine +
|
||||
"\t /light settings - Opens the Lightless Settings window"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -58,21 +58,21 @@ public sealed class CommandManagerService : IDisposable
|
||||
if (splitArgs.Length == 0)
|
||||
{
|
||||
// Interpret this as toggling the UI
|
||||
if (_mareConfigService.Current.HasValidSetup())
|
||||
if (_lightlessConfigService.Current.HasValidSetup())
|
||||
_mediator.Publish(new UiToggleMessage(typeof(CompactUi)));
|
||||
else
|
||||
_mediator.Publish(new UiToggleMessage(typeof(IntroUi)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_mareConfigService.Current.HasValidSetup())
|
||||
if (!_lightlessConfigService.Current.HasValidSetup())
|
||||
return;
|
||||
|
||||
if (string.Equals(splitArgs[0], "toggle", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (_apiController.ServerState == WebAPI.SignalR.Utils.ServerState.Disconnecting)
|
||||
{
|
||||
_mediator.Publish(new NotificationMessage("Mare disconnecting", "Cannot use /toggle while Lightless Sync is still disconnecting",
|
||||
_mediator.Publish(new NotificationMessage("Lightless disconnecting", "Cannot use /toggle while Lightless Sync is still disconnecting",
|
||||
NotificationType.Error));
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
||||
using Lumina.Excel.Sheets;
|
||||
using LightlessSync.API.Dto.CharaData;
|
||||
using LightlessSync.Interop;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.PlayerData.Handlers;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Utils;
|
||||
@@ -39,7 +39,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||
private readonly ILogger<DalamudUtilService> _logger;
|
||||
private readonly IObjectTable _objectTable;
|
||||
private readonly PerformanceCollectorService _performanceCollector;
|
||||
private readonly MareConfigService _configService;
|
||||
private readonly LightlessConfigService _configService;
|
||||
private uint? _classJobId = 0;
|
||||
private DateTime _delayedFrameworkUpdateCheck = DateTime.UtcNow;
|
||||
private string _lastGlobalBlockPlayer = string.Empty;
|
||||
@@ -52,8 +52,8 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||
|
||||
public DalamudUtilService(ILogger<DalamudUtilService> logger, IClientState clientState, IObjectTable objectTable, IFramework framework,
|
||||
IGameGui gameGui, ICondition condition, IDataManager gameData, ITargetManager targetManager, IGameConfig gameConfig,
|
||||
BlockedCharacterHandler blockedCharacterHandler, MareMediator mediator, PerformanceCollectorService performanceCollector,
|
||||
MareConfigService configService)
|
||||
BlockedCharacterHandler blockedCharacterHandler, LightlessMediator mediator, PerformanceCollectorService performanceCollector,
|
||||
LightlessConfigService configService)
|
||||
{
|
||||
_logger = logger;
|
||||
_clientState = clientState;
|
||||
@@ -169,7 +169,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||
public Lazy<Dictionary<uint, string>> TerritoryData { get; private set; }
|
||||
public Lazy<Dictionary<uint, (Map Map, string MapName)>> MapData { get; private set; }
|
||||
public bool IsLodEnabled { get; private set; }
|
||||
public MareMediator Mediator { get; }
|
||||
public LightlessMediator Mediator { get; }
|
||||
|
||||
public IGameObject? CreateGameObject(IntPtr reference)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ public class EventAggregator : MediatorSubscriberBase, IHostedService
|
||||
private string CurrentLogName => $"{DateTime.Now:yyyy-MM-dd}-events.log";
|
||||
private DateTime _currentTime;
|
||||
|
||||
public EventAggregator(string configDirectory, ILogger<EventAggregator> logger, MareMediator mareMediator) : base(logger, mareMediator)
|
||||
public EventAggregator(string configDirectory, ILogger<EventAggregator> logger, LightlessMediator lightlessMediator) : base(logger, lightlessMediator)
|
||||
{
|
||||
Mediator.Subscribe<EventMessage>(this, (msg) =>
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace LightlessSync.Services;
|
||||
|
||||
public record MareProfileData(bool IsFlagged, bool IsNSFW, string Base64ProfilePicture, string Base64SupporterPicture, string Description)
|
||||
public record LightlessProfileData(bool IsFlagged, bool IsNSFW, string Base64ProfilePicture, string Base64SupporterPicture, string Description)
|
||||
{
|
||||
public Lazy<byte[]> ImageData { get; } = new Lazy<byte[]>(Convert.FromBase64String(Base64ProfilePicture));
|
||||
public Lazy<byte[]> SupporterImageData { get; } = new Lazy<byte[]>(string.IsNullOrEmpty(Base64SupporterPicture) ? [] : Convert.FromBase64String(Base64SupporterPicture));
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -4,7 +4,7 @@ namespace LightlessSync.Services.Mediator;
|
||||
|
||||
public abstract class DisposableMediatorSubscriberBase : MediatorSubscriberBase, IDisposable
|
||||
{
|
||||
protected DisposableMediatorSubscriberBase(ILogger logger, MareMediator mediator) : base(logger, mediator)
|
||||
protected DisposableMediatorSubscriberBase(ILogger logger, LightlessMediator mediator) : base(logger, mediator)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
public interface IMediatorSubscriber
|
||||
{
|
||||
MareMediator Mediator { get; }
|
||||
LightlessMediator Mediator { get; }
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Collections.Concurrent;
|
||||
@@ -7,23 +7,23 @@ using System.Text;
|
||||
|
||||
namespace LightlessSync.Services.Mediator;
|
||||
|
||||
public sealed class MareMediator : IHostedService
|
||||
public sealed class LightlessMediator : IHostedService
|
||||
{
|
||||
private readonly object _addRemoveLock = new();
|
||||
private readonly ConcurrentDictionary<object, DateTime> _lastErrorTime = [];
|
||||
private readonly ILogger<MareMediator> _logger;
|
||||
private readonly ILogger<LightlessMediator> _logger;
|
||||
private readonly CancellationTokenSource _loopCts = new();
|
||||
private readonly ConcurrentQueue<MessageBase> _messageQueue = new();
|
||||
private readonly PerformanceCollectorService _performanceCollector;
|
||||
private readonly MareConfigService _mareConfigService;
|
||||
private readonly LightlessConfigService _lightlessConfigService;
|
||||
private readonly ConcurrentDictionary<Type, HashSet<SubscriberAction>> _subscriberDict = [];
|
||||
private bool _processQueue = false;
|
||||
private readonly ConcurrentDictionary<Type, MethodInfo?> _genericExecuteMethods = new();
|
||||
public MareMediator(ILogger<MareMediator> logger, PerformanceCollectorService performanceCollector, MareConfigService mareConfigService)
|
||||
public LightlessMediator(ILogger<LightlessMediator> logger, PerformanceCollectorService performanceCollector, LightlessConfigService lightlessConfigService)
|
||||
{
|
||||
_logger = logger;
|
||||
_performanceCollector = performanceCollector;
|
||||
_mareConfigService = mareConfigService;
|
||||
_lightlessConfigService = lightlessConfigService;
|
||||
}
|
||||
|
||||
public void PrintSubscriberInfo()
|
||||
@@ -59,7 +59,7 @@ public sealed class MareMediator : IHostedService
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogInformation("Starting MareMediator");
|
||||
_logger.LogInformation("Starting LightlessMediator");
|
||||
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
@@ -83,7 +83,7 @@ public sealed class MareMediator : IHostedService
|
||||
}
|
||||
});
|
||||
|
||||
_logger.LogInformation("Started MareMediator");
|
||||
_logger.LogInformation("Started LightlessMediator");
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
@@ -164,7 +164,7 @@ public sealed class MareMediator : IHostedService
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_mareConfigService.Current.LogPerformance)
|
||||
if (_lightlessConfigService.Current.LogPerformance)
|
||||
{
|
||||
var isSameThread = message.KeepThreadContext ? "$" : string.Empty;
|
||||
_performanceCollector.LogPerformance(this, $"{isSameThread}Execute>{message.GetType().Name}+{subscriber.Subscriber.GetType().Name}>{subscriber.Subscriber}",
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace LightlessSync.Services.Mediator;
|
||||
|
||||
public abstract class MediatorSubscriberBase : IMediatorSubscriber
|
||||
{
|
||||
protected MediatorSubscriberBase(ILogger logger, MareMediator mediator)
|
||||
protected MediatorSubscriberBase(ILogger logger, LightlessMediator mediator)
|
||||
{
|
||||
Logger = logger;
|
||||
|
||||
@@ -12,7 +12,7 @@ public abstract class MediatorSubscriberBase : IMediatorSubscriber
|
||||
Mediator = mediator;
|
||||
}
|
||||
|
||||
public MareMediator Mediator { get; }
|
||||
public LightlessMediator Mediator { get; }
|
||||
protected ILogger Logger { get; }
|
||||
|
||||
protected void UnsubscribeAll()
|
||||
|
||||
@@ -3,7 +3,7 @@ using LightlessSync.API.Data;
|
||||
using LightlessSync.API.Dto;
|
||||
using LightlessSync.API.Dto.CharaData;
|
||||
using LightlessSync.API.Dto.Group;
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.PlayerData.Handlers;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
using LightlessSync.Services.Events;
|
||||
|
||||
@@ -8,7 +8,7 @@ public abstract class WindowMediatorSubscriberBase : Window, IMediatorSubscriber
|
||||
protected readonly ILogger _logger;
|
||||
private readonly PerformanceCollectorService _performanceCollectorService;
|
||||
|
||||
protected WindowMediatorSubscriberBase(ILogger logger, MareMediator mediator, string name,
|
||||
protected WindowMediatorSubscriberBase(ILogger logger, LightlessMediator mediator, string name,
|
||||
PerformanceCollectorService performanceCollectorService) : base(name)
|
||||
{
|
||||
_logger = logger;
|
||||
@@ -25,7 +25,7 @@ public abstract class WindowMediatorSubscriberBase : Window, IMediatorSubscriber
|
||||
});
|
||||
}
|
||||
|
||||
public MareMediator Mediator { get; }
|
||||
public LightlessMediator Mediator { get; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using Dalamud.Game.Text.SeStringHandling;
|
||||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Dalamud.Plugin.Services;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NotificationType = LightlessSync.MareConfiguration.Models.NotificationType;
|
||||
using NotificationType = LightlessSync.LightlessConfiguration.Models.NotificationType;
|
||||
|
||||
namespace LightlessSync.Services;
|
||||
|
||||
@@ -15,12 +15,12 @@ public class NotificationService : DisposableMediatorSubscriberBase, IHostedServ
|
||||
private readonly DalamudUtilService _dalamudUtilService;
|
||||
private readonly INotificationManager _notificationManager;
|
||||
private readonly IChatGui _chatGui;
|
||||
private readonly MareConfigService _configurationService;
|
||||
private readonly LightlessConfigService _configurationService;
|
||||
|
||||
public NotificationService(ILogger<NotificationService> logger, MareMediator mediator,
|
||||
public NotificationService(ILogger<NotificationService> logger, LightlessMediator mediator,
|
||||
DalamudUtilService dalamudUtilService,
|
||||
INotificationManager notificationManager,
|
||||
IChatGui chatGui, MareConfigService configurationService) : base(logger, mediator)
|
||||
IChatGui chatGui, LightlessConfigService configurationService) : base(logger, mediator)
|
||||
{
|
||||
_dalamudUtilService = dalamudUtilService;
|
||||
_notificationManager = notificationManager;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.Utils;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -12,19 +12,19 @@ public sealed class PerformanceCollectorService : IHostedService
|
||||
{
|
||||
private const string _counterSplit = "=>";
|
||||
private readonly ILogger<PerformanceCollectorService> _logger;
|
||||
private readonly MareConfigService _mareConfigService;
|
||||
private readonly LightlessConfigService _lightlessConfigService;
|
||||
public ConcurrentDictionary<string, RollingList<(TimeOnly, long)>> PerformanceCounters { get; } = new(StringComparer.Ordinal);
|
||||
private readonly CancellationTokenSource _periodicLogPruneTaskCts = new();
|
||||
|
||||
public PerformanceCollectorService(ILogger<PerformanceCollectorService> logger, MareConfigService mareConfigService)
|
||||
public PerformanceCollectorService(ILogger<PerformanceCollectorService> logger, LightlessConfigService lightlessConfigService)
|
||||
{
|
||||
_logger = logger;
|
||||
_mareConfigService = mareConfigService;
|
||||
_lightlessConfigService = lightlessConfigService;
|
||||
}
|
||||
|
||||
public T LogPerformance<T>(object sender, MareInterpolatedStringHandler counterName, Func<T> func, int maxEntries = 10000)
|
||||
public T LogPerformance<T>(object sender, LightlessInterpolatedStringHandler counterName, Func<T> func, int maxEntries = 10000)
|
||||
{
|
||||
if (!_mareConfigService.Current.LogPerformance) return func.Invoke();
|
||||
if (!_lightlessConfigService.Current.LogPerformance) return func.Invoke();
|
||||
|
||||
string cn = sender.GetType().Name + _counterSplit + counterName.BuildMessage();
|
||||
|
||||
@@ -49,9 +49,9 @@ public sealed class PerformanceCollectorService : IHostedService
|
||||
}
|
||||
}
|
||||
|
||||
public void LogPerformance(object sender, MareInterpolatedStringHandler counterName, Action act, int maxEntries = 10000)
|
||||
public void LogPerformance(object sender, LightlessInterpolatedStringHandler counterName, Action act, int maxEntries = 10000)
|
||||
{
|
||||
if (!_mareConfigService.Current.LogPerformance) { act.Invoke(); return; }
|
||||
if (!_lightlessConfigService.Current.LogPerformance) { act.Invoke(); return; }
|
||||
|
||||
var cn = sender.GetType().Name + _counterSplit + counterName.BuildMessage();
|
||||
|
||||
@@ -93,7 +93,7 @@ public sealed class PerformanceCollectorService : IHostedService
|
||||
|
||||
internal void PrintPerformanceStats(int limitBySeconds = 0)
|
||||
{
|
||||
if (!_mareConfigService.Current.LogPerformance)
|
||||
if (!_lightlessConfigService.Current.LogPerformance)
|
||||
{
|
||||
_logger.LogWarning("Performance counters are disabled");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using LightlessSync.API.Data;
|
||||
using LightlessSync.FileCache;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.PlayerData.Handlers;
|
||||
using LightlessSync.Services.Events;
|
||||
using LightlessSync.Services.Mediator;
|
||||
@@ -15,11 +15,11 @@ public class PlayerPerformanceService
|
||||
private readonly FileCacheManager _fileCacheManager;
|
||||
private readonly XivDataAnalyzer _xivDataAnalyzer;
|
||||
private readonly ILogger<PlayerPerformanceService> _logger;
|
||||
private readonly MareMediator _mediator;
|
||||
private readonly LightlessMediator _mediator;
|
||||
private readonly PlayerPerformanceConfigService _playerPerformanceConfigService;
|
||||
private readonly Dictionary<string, bool> _warnedForPlayers = new(StringComparer.Ordinal);
|
||||
|
||||
public PlayerPerformanceService(ILogger<PlayerPerformanceService> logger, MareMediator mediator,
|
||||
public PlayerPerformanceService(ILogger<PlayerPerformanceService> logger, LightlessMediator mediator,
|
||||
PlayerPerformanceConfigService playerPerformanceConfigService, FileCacheManager fileCacheManager,
|
||||
XivDataAnalyzer xivDataAnalyzer)
|
||||
{
|
||||
@@ -94,7 +94,7 @@ public class PlayerPerformanceService
|
||||
}
|
||||
|
||||
_mediator.Publish(new NotificationMessage($"{pairHandler.Pair.PlayerName} ({pairHandler.Pair.UserData.AliasOrUID}) exceeds performance threshold(s)",
|
||||
warningText, MareConfiguration.Models.NotificationType.Warning));
|
||||
warningText, LightlessConfiguration.Models.NotificationType.Warning));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -142,7 +142,7 @@ public class PlayerPerformanceService
|
||||
$"Player {pair.PlayerName} ({pair.UserData.AliasOrUID}) exceeded your configured triangle auto pause threshold (" +
|
||||
$"{triUsage}/{config.TrisAutoPauseThresholdThousands * 1000} triangles)" +
|
||||
$" and has been automatically paused.",
|
||||
MareConfiguration.Models.NotificationType.Warning));
|
||||
LightlessConfiguration.Models.NotificationType.Warning));
|
||||
|
||||
_mediator.Publish(new EventMessage(new Event(pair.PlayerName, pair.UserData, nameof(PlayerPerformanceService), EventSeverity.Warning,
|
||||
$"Exceeds triangle threshold: automatically paused ({triUsage}/{config.TrisAutoPauseThresholdThousands * 1000} triangles)")));
|
||||
@@ -218,7 +218,7 @@ public class PlayerPerformanceService
|
||||
$"Player {pair.PlayerName} ({pair.UserData.AliasOrUID}) exceeded your configured VRAM auto pause threshold (" +
|
||||
$"{UiSharedService.ByteToString(vramUsage, addSuffix: true)}/{config.VRAMSizeAutoPauseThresholdMiB}MiB)" +
|
||||
$" and has been automatically paused.",
|
||||
MareConfiguration.Models.NotificationType.Warning));
|
||||
LightlessConfiguration.Models.NotificationType.Warning));
|
||||
|
||||
_mediator.Publish(new PauseMessage(pair.UserData));
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using LightlessSync.API.Data;
|
||||
using LightlessSync.API.Data.Comparer;
|
||||
using LightlessSync.Interop.Ipc;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
@@ -12,12 +12,12 @@ public class PluginWarningNotificationService
|
||||
{
|
||||
private readonly ConcurrentDictionary<UserData, OptionalPluginWarning> _cachedOptionalPluginWarnings = new(UserDataComparer.Instance);
|
||||
private readonly IpcManager _ipcManager;
|
||||
private readonly MareConfigService _mareConfigService;
|
||||
private readonly MareMediator _mediator;
|
||||
private readonly LightlessConfigService _lightlessConfigService;
|
||||
private readonly LightlessMediator _mediator;
|
||||
|
||||
public PluginWarningNotificationService(MareConfigService mareConfigService, IpcManager ipcManager, MareMediator mediator)
|
||||
public PluginWarningNotificationService(LightlessConfigService lightlessConfigService, IpcManager ipcManager, LightlessMediator mediator)
|
||||
{
|
||||
_mareConfigService = mareConfigService;
|
||||
_lightlessConfigService = lightlessConfigService;
|
||||
_ipcManager = ipcManager;
|
||||
_mediator = mediator;
|
||||
}
|
||||
@@ -28,11 +28,11 @@ public class PluginWarningNotificationService
|
||||
{
|
||||
_cachedOptionalPluginWarnings[user] = warning = new()
|
||||
{
|
||||
ShownCustomizePlusWarning = _mareConfigService.Current.DisableOptionalPluginWarnings,
|
||||
ShownHeelsWarning = _mareConfigService.Current.DisableOptionalPluginWarnings,
|
||||
ShownHonorificWarning = _mareConfigService.Current.DisableOptionalPluginWarnings,
|
||||
ShownMoodlesWarning = _mareConfigService.Current.DisableOptionalPluginWarnings,
|
||||
ShowPetNicknamesWarning = _mareConfigService.Current.DisableOptionalPluginWarnings
|
||||
ShownCustomizePlusWarning = _lightlessConfigService.Current.DisableOptionalPluginWarnings,
|
||||
ShownHeelsWarning = _lightlessConfigService.Current.DisableOptionalPluginWarnings,
|
||||
ShownHonorificWarning = _lightlessConfigService.Current.DisableOptionalPluginWarnings,
|
||||
ShownMoodlesWarning = _lightlessConfigService.Current.DisableOptionalPluginWarnings,
|
||||
ShowPetNicknamesWarning = _lightlessConfigService.Current.DisableOptionalPluginWarnings
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Dalamud.Utility;
|
||||
using LightlessSync.API.Routes;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.WebAPI;
|
||||
using Microsoft.AspNetCore.Http.Connections;
|
||||
@@ -18,25 +18,25 @@ public class ServerConfigurationManager
|
||||
{
|
||||
private readonly ServerConfigService _configService;
|
||||
private readonly DalamudUtilService _dalamudUtil;
|
||||
private readonly MareConfigService _mareConfigService;
|
||||
private readonly LightlessConfigService _lightlessConfigService;
|
||||
private readonly HttpClient _httpClient;
|
||||
private readonly ILogger<ServerConfigurationManager> _logger;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
private readonly NotesConfigService _notesConfig;
|
||||
private readonly ServerTagConfigService _serverTagConfig;
|
||||
|
||||
public ServerConfigurationManager(ILogger<ServerConfigurationManager> logger, ServerConfigService configService,
|
||||
ServerTagConfigService serverTagConfig, NotesConfigService notesConfig, DalamudUtilService dalamudUtil,
|
||||
MareConfigService mareConfigService, HttpClient httpClient, MareMediator mareMediator)
|
||||
LightlessConfigService lightlessConfigService, HttpClient httpClient, LightlessMediator lightlessMediator)
|
||||
{
|
||||
_logger = logger;
|
||||
_configService = configService;
|
||||
_serverTagConfig = serverTagConfig;
|
||||
_notesConfig = notesConfig;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
_mareConfigService = mareConfigService;
|
||||
_lightlessConfigService = lightlessConfigService;
|
||||
_httpClient = httpClient;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
EnsureMainExists();
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ public class ServerConfigurationManager
|
||||
{
|
||||
CurrentServerTagStorage().ServerAvailablePairTags.Add(tag);
|
||||
_serverTagConfig.Save();
|
||||
_mareMediator.Publish(new RefreshUiMessage());
|
||||
_lightlessMediator.Publish(new RefreshUiMessage());
|
||||
}
|
||||
|
||||
internal void AddTagForUid(string uid, string tagName)
|
||||
@@ -306,7 +306,7 @@ public class ServerConfigurationManager
|
||||
if (CurrentServerTagStorage().UidServerPairedUserTags.TryGetValue(uid, out var tags))
|
||||
{
|
||||
tags.Add(tagName);
|
||||
_mareMediator.Publish(new RefreshUiMessage());
|
||||
_lightlessMediator.Publish(new RefreshUiMessage());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -410,7 +410,7 @@ public class ServerConfigurationManager
|
||||
RemoveTagForUid(uid, tag, save: false);
|
||||
}
|
||||
_serverTagConfig.Save();
|
||||
_mareMediator.Publish(new RefreshUiMessage());
|
||||
_lightlessMediator.Publish(new RefreshUiMessage());
|
||||
}
|
||||
|
||||
internal void RemoveTagForUid(string uid, string tagName, bool save = true)
|
||||
@@ -422,7 +422,7 @@ public class ServerConfigurationManager
|
||||
if (save)
|
||||
{
|
||||
_serverTagConfig.Save();
|
||||
_mareMediator.Publish(new RefreshUiMessage());
|
||||
_lightlessMediator.Publish(new RefreshUiMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -463,7 +463,7 @@ public class ServerConfigurationManager
|
||||
|
||||
internal void AutoPopulateNoteForUid(string uid, string note)
|
||||
{
|
||||
if (!_mareConfigService.Current.AutoPopulateEmptyNotesFromCharaName
|
||||
if (!_lightlessConfigService.Current.AutoPopulateEmptyNotesFromCharaName
|
||||
|| GetNoteForUid(uid) != null)
|
||||
return;
|
||||
|
||||
|
||||
@@ -12,43 +12,43 @@ namespace LightlessSync.Services;
|
||||
public class UiFactory
|
||||
{
|
||||
private readonly ILoggerFactory _loggerFactory;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
private readonly ApiController _apiController;
|
||||
private readonly UiSharedService _uiSharedService;
|
||||
private readonly PairManager _pairManager;
|
||||
private readonly ServerConfigurationManager _serverConfigManager;
|
||||
private readonly MareProfileManager _mareProfileManager;
|
||||
private readonly LightlessProfileManager _lightlessProfileManager;
|
||||
private readonly PerformanceCollectorService _performanceCollectorService;
|
||||
|
||||
public UiFactory(ILoggerFactory loggerFactory, MareMediator mareMediator, ApiController apiController,
|
||||
public UiFactory(ILoggerFactory loggerFactory, LightlessMediator lightlessMediator, ApiController apiController,
|
||||
UiSharedService uiSharedService, PairManager pairManager, ServerConfigurationManager serverConfigManager,
|
||||
MareProfileManager mareProfileManager, PerformanceCollectorService performanceCollectorService)
|
||||
LightlessProfileManager lightlessProfileManager, PerformanceCollectorService performanceCollectorService)
|
||||
{
|
||||
_loggerFactory = loggerFactory;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
_apiController = apiController;
|
||||
_uiSharedService = uiSharedService;
|
||||
_pairManager = pairManager;
|
||||
_serverConfigManager = serverConfigManager;
|
||||
_mareProfileManager = mareProfileManager;
|
||||
_lightlessProfileManager = lightlessProfileManager;
|
||||
_performanceCollectorService = performanceCollectorService;
|
||||
}
|
||||
|
||||
public SyncshellAdminUI CreateSyncshellAdminUi(GroupFullInfoDto dto)
|
||||
{
|
||||
return new SyncshellAdminUI(_loggerFactory.CreateLogger<SyncshellAdminUI>(), _mareMediator,
|
||||
return new SyncshellAdminUI(_loggerFactory.CreateLogger<SyncshellAdminUI>(), _lightlessMediator,
|
||||
_apiController, _uiSharedService, _pairManager, dto, _performanceCollectorService);
|
||||
}
|
||||
|
||||
public StandaloneProfileUi CreateStandaloneProfileUi(Pair pair)
|
||||
{
|
||||
return new StandaloneProfileUi(_loggerFactory.CreateLogger<StandaloneProfileUi>(), _mareMediator,
|
||||
_uiSharedService, _serverConfigManager, _mareProfileManager, _pairManager, pair, _performanceCollectorService);
|
||||
return new StandaloneProfileUi(_loggerFactory.CreateLogger<StandaloneProfileUi>(), _lightlessMediator,
|
||||
_uiSharedService, _serverConfigManager, _lightlessProfileManager, _pairManager, pair, _performanceCollectorService);
|
||||
}
|
||||
|
||||
public PermissionWindowUI CreatePermissionPopupUi(Pair pair)
|
||||
{
|
||||
return new PermissionWindowUI(_loggerFactory.CreateLogger<PermissionWindowUI>(), pair,
|
||||
_mareMediator, _uiSharedService, _apiController, _performanceCollectorService);
|
||||
_lightlessMediator, _uiSharedService, _apiController, _performanceCollectorService);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.ImGuiFileDialog;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.UI;
|
||||
using LightlessSync.UI.Components.Popup;
|
||||
@@ -15,20 +15,20 @@ public sealed class UiService : DisposableMediatorSubscriberBase
|
||||
private readonly IUiBuilder _uiBuilder;
|
||||
private readonly FileDialogManager _fileDialogManager;
|
||||
private readonly ILogger<UiService> _logger;
|
||||
private readonly MareConfigService _mareConfigService;
|
||||
private readonly LightlessConfigService _lightlessConfigService;
|
||||
private readonly WindowSystem _windowSystem;
|
||||
private readonly UiFactory _uiFactory;
|
||||
|
||||
public UiService(ILogger<UiService> logger, IUiBuilder uiBuilder,
|
||||
MareConfigService mareConfigService, WindowSystem windowSystem,
|
||||
LightlessConfigService lightlessConfigService, WindowSystem windowSystem,
|
||||
IEnumerable<WindowMediatorSubscriberBase> windows,
|
||||
UiFactory uiFactory, FileDialogManager fileDialogManager,
|
||||
MareMediator mareMediator) : base(logger, mareMediator)
|
||||
LightlessMediator lightlessMediator) : base(logger, lightlessMediator)
|
||||
{
|
||||
_logger = logger;
|
||||
_logger.LogTrace("Creating {type}", GetType().Name);
|
||||
_uiBuilder = uiBuilder;
|
||||
_mareConfigService = mareConfigService;
|
||||
_lightlessConfigService = lightlessConfigService;
|
||||
_windowSystem = windowSystem;
|
||||
_uiFactory = uiFactory;
|
||||
_fileDialogManager = fileDialogManager;
|
||||
@@ -86,7 +86,7 @@ public sealed class UiService : DisposableMediatorSubscriberBase
|
||||
|
||||
public void ToggleMainUi()
|
||||
{
|
||||
if (_mareConfigService.Current.HasValidSetup())
|
||||
if (_lightlessConfigService.Current.HasValidSetup())
|
||||
Mediator.Publish(new UiToggleMessage(typeof(CompactUi)));
|
||||
else
|
||||
Mediator.Publish(new UiToggleMessage(typeof(IntroUi)));
|
||||
@@ -94,7 +94,7 @@ public sealed class UiService : DisposableMediatorSubscriberBase
|
||||
|
||||
public void ToggleUi()
|
||||
{
|
||||
if (_mareConfigService.Current.HasValidSetup())
|
||||
if (_lightlessConfigService.Current.HasValidSetup())
|
||||
Mediator.Publish(new UiToggleMessage(typeof(SettingsUi)));
|
||||
else
|
||||
Mediator.Publish(new UiToggleMessage(typeof(IntroUi)));
|
||||
|
||||
@@ -5,7 +5,7 @@ using FFXIVClientStructs.Havok.Common.Base.Types;
|
||||
using FFXIVClientStructs.Havok.Common.Serialize.Util;
|
||||
using LightlessSync.FileCache;
|
||||
using LightlessSync.Interop.GameModel;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.PlayerData.Handlers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using LightlessSync.API.Dto.CharaData;
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.Services.CharaData.Models;
|
||||
using System.Text;
|
||||
|
||||
|
||||
@@ -560,10 +560,10 @@ internal sealed partial class CharaDataHubUi
|
||||
|
||||
private void DrawMcdOnline()
|
||||
{
|
||||
_uiSharedService.BigText("Mare Character Data Online");
|
||||
_uiSharedService.BigText("Lightless Character Data Online");
|
||||
|
||||
DrawHelpFoldout("In this tab you can create, view and edit your own Mare Character Data that is stored on the server." + Environment.NewLine + Environment.NewLine
|
||||
+ "Mare Character Data Online functions similar to the previous MCDF standard for exporting your character, except that you do not have to send a file to the other person but solely a code." + Environment.NewLine + Environment.NewLine
|
||||
DrawHelpFoldout("In this tab you can create, view and edit your own Lightless Character Data that is stored on the server." + Environment.NewLine + Environment.NewLine
|
||||
+ "Lightless Character Data Online functions similar to the previous MCDF standard for exporting your character, except that you do not have to send a file to the other person but solely a code." + Environment.NewLine + Environment.NewLine
|
||||
+ "There would be a bit too much to explain here on what you can do here in its entirety, however, all elements in this tab have help texts attached what they are used for. Please review them carefully." + Environment.NewLine + Environment.NewLine
|
||||
+ "Be mindful that when you share your Character Data with other people there is a chance that, with the help of unsanctioned 3rd party plugins, your appearance could be stolen irreversibly, just like when using MCDF.");
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ internal partial class CharaDataHubUi
|
||||
_configService.Current.NearbyDrawWisps = showWisps;
|
||||
_configService.Save();
|
||||
}
|
||||
_uiSharedService.DrawHelpText("When enabled, Mare will draw floating wisps where other's poses are in the world.");
|
||||
_uiSharedService.DrawHelpText("When enabled, Lightless will draw floating wisps where other's poses are in the world.");
|
||||
int poseDetectionDistance = _configService.Current.NearbyDistanceFilter;
|
||||
UiSharedService.ScaledNextItemWidth(100);
|
||||
if (ImGui.SliderInt("Detection Distance", ref poseDetectionDistance, 5, 1000))
|
||||
@@ -71,7 +71,7 @@ internal partial class CharaDataHubUi
|
||||
_configService.Current.NearbyShowAlways = alwaysShow;
|
||||
_configService.Save();
|
||||
}
|
||||
_uiSharedService.DrawHelpText("This will allow Mare to continue the calculation of position of wisps etc. active outside of the 'Poses Nearby' tab." + UiSharedService.TooltipSeparator
|
||||
_uiSharedService.DrawHelpText("This will allow Lightless to continue the calculation of position of wisps etc. active outside of the 'Poses Nearby' tab." + UiSharedService.TooltipSeparator
|
||||
+ "Note: The wisps etc. will disappear during combat and performing.");
|
||||
});
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ using Dalamud.Interface.ImGuiFileDialog;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using LightlessSync.API.Dto.CharaData;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.MareConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
using LightlessSync.Services;
|
||||
using LightlessSync.Services.CharaData;
|
||||
@@ -74,7 +74,7 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
||||
private (string Id, string? Alias, string AliasOrId, string? Note)[]? _openComboHybridEntries = null;
|
||||
private bool _comboHybridUsedLastFrame = false;
|
||||
|
||||
public CharaDataHubUi(ILogger<CharaDataHubUi> logger, MareMediator mediator, PerformanceCollectorService performanceCollectorService,
|
||||
public CharaDataHubUi(ILogger<CharaDataHubUi> logger, LightlessMediator mediator, PerformanceCollectorService performanceCollectorService,
|
||||
CharaDataManager charaDataManager, CharaDataNearbyManager charaDataNearbyManager, CharaDataConfigService configService,
|
||||
UiSharedService uiSharedService, ServerConfigurationManager serverConfigurationManager,
|
||||
DalamudUtilService dalamudUtilService, FileDialogManager fileDialogManager, PairManager pairManager,
|
||||
@@ -92,7 +92,7 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
||||
_fileDialogManager = fileDialogManager;
|
||||
_pairManager = pairManager;
|
||||
_charaDataGposeTogetherManager = charaDataGposeTogetherManager;
|
||||
Mediator.Subscribe<GposeStartMessage>(this, (_) => IsOpen |= _configService.Current.OpenMareHubOnGposeStart);
|
||||
Mediator.Subscribe<GposeStartMessage>(this, (_) => IsOpen |= _configService.Current.OpenLightlessHubOnGposeStart);
|
||||
Mediator.Subscribe<OpenCharaDataHubWithFilterMessage>(this, (msg) =>
|
||||
{
|
||||
IsOpen = true;
|
||||
@@ -863,9 +863,9 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
||||
|
||||
private void DrawMcdfExport()
|
||||
{
|
||||
_uiSharedService.BigText("Mare Character Data File Export");
|
||||
_uiSharedService.BigText("Lightless Character Data File Export");
|
||||
|
||||
DrawHelpFoldout("This feature allows you to pack your character into a MCDF file and manually send it to other people. MCDF files can officially only be imported during GPose through Mare. " +
|
||||
DrawHelpFoldout("This feature allows you to pack your character into a MCDF file and manually send it to other people. MCDF files can officially only be imported during GPose through Lightless. " +
|
||||
"Be aware that the possibility exists that people write unofficial custom exporters to extract the containing data.");
|
||||
|
||||
ImGuiHelpers.ScaledDummy(5);
|
||||
@@ -891,7 +891,7 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
||||
_configService.Current.LastSavedCharaDataLocation = Path.GetDirectoryName(path) ?? string.Empty;
|
||||
_configService.Save();
|
||||
|
||||
_charaDataManager.SaveMareCharaFile(_exportDescription, path);
|
||||
_charaDataManager.SaveLightlessCharaFile(_exportDescription, path);
|
||||
_exportDescription = string.Empty;
|
||||
}, Directory.Exists(_configService.Current.LastSavedCharaDataLocation) ? _configService.Current.LastSavedCharaDataLocation : null);
|
||||
}
|
||||
@@ -1048,10 +1048,10 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
||||
ImGuiHelpers.ScaledDummy(5);
|
||||
_uiSharedService.BigText("Settings");
|
||||
ImGuiHelpers.ScaledDummy(5);
|
||||
bool openInGpose = _configService.Current.OpenMareHubOnGposeStart;
|
||||
bool openInGpose = _configService.Current.OpenLightlessHubOnGposeStart;
|
||||
if (ImGui.Checkbox("Open Character Data Hub when GPose loads", ref openInGpose))
|
||||
{
|
||||
_configService.Current.OpenMareHubOnGposeStart = openInGpose;
|
||||
_configService.Current.OpenLightlessHubOnGposeStart = openInGpose;
|
||||
_configService.Save();
|
||||
}
|
||||
_uiSharedService.DrawHelpText("This will automatically open the import menu when loading into Gpose. If unchecked you can open the menu manually with /light gpose");
|
||||
|
||||
@@ -7,7 +7,7 @@ using Dalamud.Utility;
|
||||
using LightlessSync.API.Data.Extensions;
|
||||
using LightlessSync.API.Dto.Group;
|
||||
using LightlessSync.Interop.Ipc;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.PlayerData.Handlers;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
using LightlessSync.Services;
|
||||
@@ -31,7 +31,7 @@ namespace LightlessSync.UI;
|
||||
public class CompactUi : WindowMediatorSubscriberBase
|
||||
{
|
||||
private readonly ApiController _apiController;
|
||||
private readonly MareConfigService _configService;
|
||||
private readonly LightlessConfigService _configService;
|
||||
private readonly ConcurrentDictionary<GameObjectHandler, Dictionary<string, FileDownloadStatus>> _currentDownloads = new();
|
||||
private readonly DrawEntityFactory _drawEntityFactory;
|
||||
private readonly FileUploadManager _fileTransferManager;
|
||||
@@ -54,8 +54,8 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
private bool _wasOpen;
|
||||
private float _windowContentWidth;
|
||||
|
||||
public CompactUi(ILogger<CompactUi> logger, UiSharedService uiShared, MareConfigService configService, ApiController apiController, PairManager pairManager,
|
||||
ServerConfigurationManager serverManager, MareMediator mediator, FileUploadManager fileTransferManager,
|
||||
public CompactUi(ILogger<CompactUi> logger, UiSharedService uiShared, LightlessConfigService configService, ApiController apiController, PairManager pairManager,
|
||||
ServerConfigurationManager serverManager, LightlessMediator mediator, FileUploadManager fileTransferManager,
|
||||
TagHandler tagHandler, DrawEntityFactory drawEntityFactory, SelectTagForPairUi selectTagForPairUi, SelectPairForTagUi selectPairForTagUi,
|
||||
PerformanceCollectorService performanceCollectorService, IpcManager ipcManager)
|
||||
: base(logger, mediator, "###LightlessSyncMainUI", performanceCollectorService)
|
||||
@@ -88,7 +88,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
ShowTooltip = () =>
|
||||
{
|
||||
ImGui.BeginTooltip();
|
||||
ImGui.Text("Open Mare Settings");
|
||||
ImGui.Text("Open Lightless Settings");
|
||||
ImGui.EndTooltip();
|
||||
}
|
||||
},
|
||||
@@ -103,7 +103,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
ShowTooltip = () =>
|
||||
{
|
||||
ImGui.BeginTooltip();
|
||||
ImGui.Text("Open Mare Event Viewer");
|
||||
ImGui.Text("Open Lightless Event Viewer");
|
||||
ImGui.EndTooltip();
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
var penumAvailable = _ipcManager.Penumbra.APIAvailable;
|
||||
var glamAvailable = _ipcManager.Glamourer.APIAvailable;
|
||||
|
||||
UiSharedService.ColorTextWrapped($"One or more Plugins essential for Mare operation are unavailable. Enable or update following plugins:", ImGuiColors.DalamudRed);
|
||||
UiSharedService.ColorTextWrapped($"One or more Plugins essential for Lightless operation are unavailable. Enable or update following plugins:", ImGuiColors.DalamudRed);
|
||||
using var indent = ImRaii.PushIndent(10f);
|
||||
if (!penumAvailable)
|
||||
{
|
||||
@@ -578,7 +578,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
ServerState.MultiChara => "Your Character Configuration has multiple characters configured with same name and world. You will not be able to connect until you fix this issue. Remove the duplicates from the configuration in Settings -> Service Settings -> Character Management and reconnect manually after.",
|
||||
ServerState.OAuthMisconfigured => "OAuth2 is enabled but not fully configured, verify in the Settings -> Service Settings that you have OAuth2 connected and, importantly, a UID assigned to your current character.",
|
||||
ServerState.OAuthLoginTokenStale => "Your OAuth2 login token is stale and cannot be used to renew. Go to the Settings -> Service Settings and unlink then relink your OAuth2 configuration.",
|
||||
ServerState.NoAutoLogon => "This character has automatic login into Mare disabled. Press the connect button to connect to Mare.",
|
||||
ServerState.NoAutoLogon => "This character has automatic login into Lightless disabled. Press the connect button to connect to Lightless.",
|
||||
_ => string.Empty
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,17 +18,17 @@ public class DrawFolderGroup : DrawFolderBase
|
||||
private readonly ApiController _apiController;
|
||||
private readonly GroupFullInfoDto _groupFullInfoDto;
|
||||
private readonly IdDisplayHandler _idDisplayHandler;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly LightlessMediator _lightlessMediator;
|
||||
|
||||
public DrawFolderGroup(string id, GroupFullInfoDto groupFullInfoDto, ApiController apiController,
|
||||
IImmutableList<DrawUserPair> drawPairs, IImmutableList<Pair> allPairs, TagHandler tagHandler, IdDisplayHandler idDisplayHandler,
|
||||
MareMediator mareMediator, UiSharedService uiSharedService) :
|
||||
LightlessMediator lightlessMediator, UiSharedService uiSharedService) :
|
||||
base(id, drawPairs, allPairs, tagHandler, uiSharedService)
|
||||
{
|
||||
_groupFullInfoDto = groupFullInfoDto;
|
||||
_apiController = apiController;
|
||||
_idDisplayHandler = idDisplayHandler;
|
||||
_mareMediator = mareMediator;
|
||||
_lightlessMediator = lightlessMediator;
|
||||
}
|
||||
|
||||
protected override bool RenderIfEmpty => true;
|
||||
@@ -154,7 +154,7 @@ public class DrawFolderGroup : DrawFolderBase
|
||||
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Cog, "Open Admin Panel", menuWidth, true))
|
||||
{
|
||||
ImGui.CloseCurrentPopup();
|
||||
_mareMediator.Publish(new OpenSyncshellAdminPanel(_groupFullInfoDto));
|
||||
_lightlessMediator.Publish(new OpenSyncshellAdminPanel(_groupFullInfoDto));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ using Dalamud.Interface.Utility.Raii;
|
||||
using LightlessSync.API.Data.Extensions;
|
||||
using LightlessSync.API.Dto.Group;
|
||||
using LightlessSync.API.Dto.User;
|
||||
using LightlessSync.MareConfiguration;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
using LightlessSync.Services;
|
||||
using LightlessSync.Services.Mediator;
|
||||
@@ -20,7 +20,7 @@ public class DrawUserPair
|
||||
{
|
||||
protected readonly ApiController _apiController;
|
||||
protected readonly IdDisplayHandler _displayHandler;
|
||||
protected readonly MareMediator _mediator;
|
||||
protected readonly LightlessMediator _mediator;
|
||||
protected readonly List<GroupFullInfoDto> _syncedGroups;
|
||||
private readonly GroupFullInfoDto? _currentGroup;
|
||||
protected Pair _pair;
|
||||
@@ -36,7 +36,7 @@ public class DrawUserPair
|
||||
public DrawUserPair(string id, Pair entry, List<GroupFullInfoDto> syncedGroups,
|
||||
GroupFullInfoDto? currentGroup,
|
||||
ApiController apiController, IdDisplayHandler uIDDisplayHandler,
|
||||
MareMediator mareMediator, SelectTagForPairUi selectTagForPairUi,
|
||||
LightlessMediator lightlessMediator, SelectTagForPairUi selectTagForPairUi,
|
||||
ServerConfigurationManager serverConfigurationManager,
|
||||
UiSharedService uiSharedService, PlayerPerformanceConfigService performanceConfigService,
|
||||
CharaDataManager charaDataManager)
|
||||
@@ -47,7 +47,7 @@ public class DrawUserPair
|
||||
_currentGroup = currentGroup;
|
||||
_apiController = apiController;
|
||||
_displayHandler = uIDDisplayHandler;
|
||||
_mediator = mareMediator;
|
||||
_mediator = lightlessMediator;
|
||||
_selectTagForPairUi = selectTagForPairUi;
|
||||
_serverConfigurationManager = serverConfigurationManager;
|
||||
_uiSharedService = uiSharedService;
|
||||
|
||||
@@ -26,22 +26,22 @@ public class CensusPopupHandler : IPopupHandler
|
||||
var start = 0f;
|
||||
using (_uiSharedService.UidFont.Push())
|
||||
{
|
||||
start = ImGui.GetCursorPosY() - ImGui.CalcTextSize("Mare Census Data").Y;
|
||||
UiSharedService.TextWrapped("Mare Census Participation");
|
||||
start = ImGui.GetCursorPosY() - ImGui.CalcTextSize("Lightless Census Data").Y;
|
||||
UiSharedService.TextWrapped("Lightless Census Participation");
|
||||
}
|
||||
ImGuiHelpers.ScaledDummy(5f);
|
||||
UiSharedService.TextWrapped("If you are seeing this popup you are updating from a Mare version that did not collect census data. Please read the following carefully.");
|
||||
UiSharedService.TextWrapped("If you are seeing this popup you are updating from a Lightless version that did not collect census data. Please read the following carefully.");
|
||||
ImGui.Separator();
|
||||
UiSharedService.TextWrapped("Mare Census is a data collecting service that can be used for statistical purposes. " +
|
||||
"All data collected through Mare Census is temporary and will be stored associated with your UID on the connected service as long as you are connected. " +
|
||||
UiSharedService.TextWrapped("Lightless Census is a data collecting service that can be used for statistical purposes. " +
|
||||
"All data collected through Lightless Census is temporary and will be stored associated with your UID on the connected service as long as you are connected. " +
|
||||
"The data cannot be used for long term tracking of individuals.");
|
||||
UiSharedService.TextWrapped("If enabled, Mare Census will collect following data:" + Environment.NewLine
|
||||
UiSharedService.TextWrapped("If enabled, Lightless Census will collect following data:" + Environment.NewLine
|
||||
+ "- Currently connected World" + Environment.NewLine
|
||||
+ "- Current Gender (reflecting Glamourer changes)" + Environment.NewLine
|
||||
+ "- Current Race (reflecting Glamourer changes)" + Environment.NewLine
|
||||
+ "- Current Clan (i.e. Seeker of the Sun, Keeper of the Moon, etc., reflecting Glamourer changes)");
|
||||
UiSharedService.TextWrapped("To consent to collecting census data press the appropriate button below.");
|
||||
UiSharedService.TextWrapped("This setting can be changed anytime in the Mare Settings.");
|
||||
UiSharedService.TextWrapped("This setting can be changed anytime in the Lightless Settings.");
|
||||
var width = ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X;
|
||||
var buttonSize = ImGuiHelpers.GetButtonSize("I consent to send my census data");
|
||||
ImGuiHelpers.ScaledDummy(5f);
|
||||
|
||||
@@ -16,9 +16,9 @@ public class PopupHandler : WindowMediatorSubscriberBase
|
||||
private readonly UiSharedService _uiSharedService;
|
||||
private IPopupHandler? _currentHandler = null;
|
||||
|
||||
public PopupHandler(ILogger<PopupHandler> logger, MareMediator mediator, IEnumerable<IPopupHandler> popupHandlers,
|
||||
public PopupHandler(ILogger<PopupHandler> logger, LightlessMediator mediator, IEnumerable<IPopupHandler> popupHandlers,
|
||||
PerformanceCollectorService performanceCollectorService, UiSharedService uiSharedService)
|
||||
: base(logger, mediator, "MarePopupHandler", performanceCollectorService)
|
||||
: base(logger, mediator, "LightlessPopupHandler", performanceCollectorService)
|
||||
{
|
||||
Flags = ImGuiWindowFlags.NoBringToFrontOnFocus
|
||||
| ImGuiWindowFlags.NoDecoration
|
||||
|
||||
@@ -18,9 +18,9 @@ public class CreateSyncshellUI : WindowMediatorSubscriberBase
|
||||
private bool _errorGroupCreate;
|
||||
private GroupJoinDto? _lastCreatedGroup;
|
||||
|
||||
public CreateSyncshellUI(ILogger<CreateSyncshellUI> logger, MareMediator mareMediator, ApiController apiController, UiSharedService uiSharedService,
|
||||
public CreateSyncshellUI(ILogger<CreateSyncshellUI> logger, LightlessMediator lightlessMediator, ApiController apiController, UiSharedService uiSharedService,
|
||||
PerformanceCollectorService performanceCollectorService)
|
||||
: base(logger, mareMediator, "Create new Syncshell###LightlessSyncCreateSyncshell", performanceCollectorService)
|
||||
: base(logger, lightlessMediator, "Create new Syncshell###LightlessSyncCreateSyncshell", performanceCollectorService)
|
||||
{
|
||||
_apiController = apiController;
|
||||
_uiSharedService = uiSharedService;
|
||||
@@ -76,7 +76,7 @@ public class CreateSyncshellUI : WindowMediatorSubscriberBase
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextUnformatted("- VFX");
|
||||
_uiSharedService.BooleanToColoredIcon(!_apiController.DefaultPermissions!.DisableGroupVFX);
|
||||
UiSharedService.TextWrapped("(Those preferred permissions can be changed anytime after Syncshell creation, your defaults can be changed anytime in the Mare Settings)");
|
||||
UiSharedService.TextWrapped("(Those preferred permissions can be changed anytime after Syncshell creation, your defaults can be changed anytime in the Lightless Settings)");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user