Removed obselete functions, changed download bars a bit. renamed files correctly
This commit is contained in:
@@ -116,7 +116,7 @@ public sealed class CharacterAnalyzer : MediatorSubscriberBase, IDisposable
|
||||
{
|
||||
foreach (var entry in objectEntries.Values)
|
||||
{
|
||||
if (!entry.FilePaths.Any(path => normalized.Contains(path)))
|
||||
if (!entry.FilePaths.Exists(path => normalized.Contains(path)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public sealed class CommandManagerService : IDisposable
|
||||
}
|
||||
else if (string.Equals(splitArgs[0], "finder", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_mediator.Publish(new UiToggleMessage(typeof(BroadcastUI)));
|
||||
_mediator.Publish(new UiToggleMessage(typeof(LightFinderUI)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ using LightlessSync.UI.Services;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using LightlessSync.UI;
|
||||
using LightlessSync.Services.LightFinder;
|
||||
|
||||
namespace LightlessSync.Services;
|
||||
|
||||
@@ -28,8 +29,8 @@ internal class ContextMenuService : IHostedService
|
||||
private readonly ApiController _apiController;
|
||||
private readonly IObjectTable _objectTable;
|
||||
private readonly LightlessConfigService _configService;
|
||||
private readonly BroadcastScannerService _broadcastScannerService;
|
||||
private readonly BroadcastService _broadcastService;
|
||||
private readonly LightFinderScannerService _broadcastScannerService;
|
||||
private readonly LightFinderService _broadcastService;
|
||||
private readonly LightlessProfileManager _lightlessProfileManager;
|
||||
private readonly LightlessMediator _mediator;
|
||||
|
||||
@@ -47,8 +48,8 @@ internal class ContextMenuService : IHostedService
|
||||
PairRequestService pairRequestService,
|
||||
PairUiService pairUiService,
|
||||
IClientState clientState,
|
||||
BroadcastScannerService broadcastScannerService,
|
||||
BroadcastService broadcastService,
|
||||
LightFinderScannerService broadcastScannerService,
|
||||
LightFinderService broadcastService,
|
||||
LightlessProfileManager lightlessProfileManager,
|
||||
LightlessMediator mediator)
|
||||
{
|
||||
|
||||
@@ -14,14 +14,12 @@ using LightlessSync.Interop;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.PlayerData.Factories;
|
||||
using LightlessSync.PlayerData.Handlers;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
using LightlessSync.Services.ActorTracking;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Utils;
|
||||
using Lumina.Excel.Sheets;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
@@ -249,7 +247,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||
public bool GetIsPlayerPresent()
|
||||
{
|
||||
EnsureIsOnFramework();
|
||||
return _clientState.LocalPlayer != null && _clientState.LocalPlayer.IsValid();
|
||||
return _objectTable.LocalPlayer != null && _objectTable.LocalPlayer.IsValid();
|
||||
}
|
||||
|
||||
public async Task<bool> GetIsPlayerPresentAsync()
|
||||
@@ -293,7 +291,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||
public IPlayerCharacter GetPlayerCharacter()
|
||||
{
|
||||
EnsureIsOnFramework();
|
||||
return _clientState.LocalPlayer!;
|
||||
return _objectTable.LocalPlayer!;
|
||||
}
|
||||
|
||||
public IntPtr GetPlayerCharacterFromCachedTableByIdent(string characterName)
|
||||
@@ -306,7 +304,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||
public string GetPlayerName()
|
||||
{
|
||||
EnsureIsOnFramework();
|
||||
return _clientState.LocalPlayer?.Name.ToString() ?? "--";
|
||||
return _objectTable.LocalPlayer?.Name.ToString() ?? "--";
|
||||
}
|
||||
|
||||
public async Task<string> GetPlayerNameAsync()
|
||||
@@ -339,7 +337,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||
public IntPtr GetPlayerPtr()
|
||||
{
|
||||
EnsureIsOnFramework();
|
||||
return _clientState.LocalPlayer?.Address ?? IntPtr.Zero;
|
||||
return _objectTable.LocalPlayer?.Address ?? IntPtr.Zero;
|
||||
}
|
||||
|
||||
public async Task<IntPtr> GetPlayerPointerAsync()
|
||||
@@ -350,13 +348,13 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||
public uint GetHomeWorldId()
|
||||
{
|
||||
EnsureIsOnFramework();
|
||||
return _clientState.LocalPlayer?.HomeWorld.RowId ?? 0;
|
||||
return _objectTable.LocalPlayer?.HomeWorld.RowId ?? 0;
|
||||
}
|
||||
|
||||
public uint GetWorldId()
|
||||
{
|
||||
EnsureIsOnFramework();
|
||||
return _clientState.LocalPlayer!.CurrentWorld.RowId;
|
||||
return _objectTable.LocalPlayer!.CurrentWorld.RowId;
|
||||
}
|
||||
|
||||
public unsafe LocationInfo GetMapData()
|
||||
@@ -365,8 +363,8 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||
var agentMap = AgentMap.Instance();
|
||||
var houseMan = HousingManager.Instance();
|
||||
uint serverId = 0;
|
||||
if (_clientState.LocalPlayer == null) serverId = 0;
|
||||
else serverId = _clientState.LocalPlayer.CurrentWorld.RowId;
|
||||
if (_objectTable.LocalPlayer == null) serverId = 0;
|
||||
else serverId = _objectTable.LocalPlayer.CurrentWorld.RowId;
|
||||
uint mapId = agentMap == null ? 0 : agentMap->CurrentMapId;
|
||||
uint territoryId = agentMap == null ? 0 : agentMap->CurrentTerritoryId;
|
||||
uint divisionId = houseMan == null ? 0 : (uint)(houseMan->GetCurrentDivision());
|
||||
@@ -494,7 +492,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||
_framework.Update += FrameworkOnUpdate;
|
||||
if (IsLoggedIn)
|
||||
{
|
||||
_classJobId = _clientState.LocalPlayer!.ClassJob.RowId;
|
||||
_classJobId = _objectTable.LocalPlayer!.ClassJob.RowId;
|
||||
}
|
||||
|
||||
_logger.LogInformation("Started DalamudUtilService");
|
||||
@@ -647,7 +645,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||
|
||||
private unsafe void FrameworkOnUpdateInternal()
|
||||
{
|
||||
if ((_clientState.LocalPlayer?.IsDead ?? false) && _condition[ConditionFlag.BoundByDuty])
|
||||
if ((_objectTable.LocalPlayer?.IsDead ?? false) && _condition[ConditionFlag.BoundByDuty])
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -805,7 +803,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||
Mediator.Publish(new ResumeScanMessage(nameof(ConditionFlag.BetweenAreas)));
|
||||
}
|
||||
|
||||
var localPlayer = _clientState.LocalPlayer;
|
||||
var localPlayer = _objectTable.LocalPlayer;
|
||||
if (localPlayer != null)
|
||||
{
|
||||
_classJobId = localPlayer.ClassJob.RowId;
|
||||
|
||||
@@ -5,15 +5,15 @@ using LightlessSync.Services.Mediator;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace LightlessSync.Services;
|
||||
namespace LightlessSync.Services.LightFinder;
|
||||
|
||||
public class BroadcastScannerService : DisposableMediatorSubscriberBase
|
||||
public class LightFinderScannerService : DisposableMediatorSubscriberBase
|
||||
{
|
||||
private readonly ILogger<BroadcastScannerService> _logger;
|
||||
private readonly ILogger<LightFinderScannerService> _logger;
|
||||
private readonly ActorObjectService _actorTracker;
|
||||
private readonly IFramework _framework;
|
||||
|
||||
private readonly BroadcastService _broadcastService;
|
||||
private readonly LightFinderService _broadcastService;
|
||||
private readonly NameplateHandler _nameplateHandler;
|
||||
|
||||
private readonly ConcurrentDictionary<string, BroadcastEntry> _broadcastCache = new(StringComparer.Ordinal);
|
||||
@@ -37,9 +37,9 @@ public class BroadcastScannerService : DisposableMediatorSubscriberBase
|
||||
public IReadOnlyDictionary<string, BroadcastEntry> BroadcastCache => _broadcastCache;
|
||||
public readonly record struct BroadcastEntry(bool IsBroadcasting, DateTime ExpiryTime, string? GID);
|
||||
|
||||
public BroadcastScannerService(ILogger<BroadcastScannerService> logger,
|
||||
public LightFinderScannerService(ILogger<LightFinderScannerService> logger,
|
||||
IFramework framework,
|
||||
BroadcastService broadcastService,
|
||||
LightFinderService broadcastService,
|
||||
LightlessMediator mediator,
|
||||
NameplateHandler nameplateHandler,
|
||||
ActorObjectService actorTracker) : base(logger, mediator)
|
||||
@@ -1,21 +1,21 @@
|
||||
using Dalamud.Interface;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.UI;
|
||||
using LightlessSync.UI.Models;
|
||||
using LightlessSync.API.Dto.Group;
|
||||
using LightlessSync.API.Dto.User;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.UI;
|
||||
using LightlessSync.UI.Models;
|
||||
using LightlessSync.Utils;
|
||||
using LightlessSync.WebAPI;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace LightlessSync.Services;
|
||||
public class BroadcastService : IHostedService, IMediatorSubscriber
|
||||
namespace LightlessSync.Services.LightFinder;
|
||||
public class LightFinderService : IHostedService, IMediatorSubscriber
|
||||
{
|
||||
private readonly ILogger<BroadcastService> _logger;
|
||||
private readonly ILogger<LightFinderService> _logger;
|
||||
private readonly ApiController _apiController;
|
||||
private readonly LightlessMediator _mediator;
|
||||
private readonly LightlessConfigService _config;
|
||||
@@ -44,7 +44,7 @@ public class BroadcastService : IHostedService, IMediatorSubscriber
|
||||
}
|
||||
}
|
||||
|
||||
public BroadcastService(ILogger<BroadcastService> logger, LightlessMediator mediator, LightlessConfigService config, DalamudUtilService dalamudUtil, ApiController apiController)
|
||||
public LightFinderService(ILogger<LightFinderService> logger, LightlessMediator mediator, LightlessConfigService config, DalamudUtilService dalamudUtil, ApiController apiController)
|
||||
{
|
||||
_logger = logger;
|
||||
_mediator = mediator;
|
||||
@@ -281,7 +281,7 @@ public class BroadcastService : IHostedService, IMediatorSubscriber
|
||||
if (!msg.Enabled)
|
||||
{
|
||||
ApplyBroadcastDisabled(forcePublish: true);
|
||||
Mediator.Publish(new EventMessage(new Services.Events.Event(nameof(BroadcastService), Services.Events.EventSeverity.Informational, $"Disabled Lightfinder for Player: {msg.HashedCid}")));
|
||||
Mediator.Publish(new EventMessage(new Events.Event(nameof(LightFinderService), Services.Events.EventSeverity.Informational, $"Disabled Lightfinder for Player: {msg.HashedCid}")));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ public class BroadcastService : IHostedService, IMediatorSubscriber
|
||||
if (TryApplyBroadcastEnabled(ttl, "client request"))
|
||||
{
|
||||
_logger.LogDebug("Fetched TTL from server: {TTL}", ttl);
|
||||
Mediator.Publish(new EventMessage(new Services.Events.Event(nameof(BroadcastService), Services.Events.EventSeverity.Informational, $"Enabled Lightfinder for Player: {msg.HashedCid}")));
|
||||
Mediator.Publish(new EventMessage(new Events.Event(nameof(LightFinderService), Services.Events.EventSeverity.Informational, $"Enabled Lightfinder for Player: {msg.HashedCid}")));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -26,7 +26,7 @@ public unsafe class NameplateHandler : IMediatorSubscriber
|
||||
private readonly ILogger<NameplateHandler> _logger;
|
||||
private readonly IAddonLifecycle _addonLifecycle;
|
||||
private readonly IGameGui _gameGui;
|
||||
private readonly IClientState _clientState;
|
||||
private readonly IObjectTable _objectTable;
|
||||
private readonly LightlessConfigService _configService;
|
||||
private readonly PairUiService _pairUiService;
|
||||
private readonly LightlessMediator _mediator;
|
||||
@@ -48,14 +48,14 @@ public unsafe class NameplateHandler : IMediatorSubscriber
|
||||
|
||||
private ImmutableHashSet<string> _activeBroadcastingCids = [];
|
||||
|
||||
public NameplateHandler(ILogger<NameplateHandler> logger, IAddonLifecycle addonLifecycle, IGameGui gameGui, LightlessConfigService configService, LightlessMediator mediator, IClientState clientState, PairUiService pairUiService)
|
||||
public NameplateHandler(ILogger<NameplateHandler> logger, IAddonLifecycle addonLifecycle, IGameGui gameGui, LightlessConfigService configService, LightlessMediator mediator, IObjectTable objectTable, PairUiService pairUiService)
|
||||
{
|
||||
_logger = logger;
|
||||
_addonLifecycle = addonLifecycle;
|
||||
_gameGui = gameGui;
|
||||
_configService = configService;
|
||||
_mediator = mediator;
|
||||
_clientState = clientState;
|
||||
_objectTable = objectTable;
|
||||
_pairUiService = pairUiService;
|
||||
|
||||
System.Array.Fill(_cachedNameplateTextOffsets, int.MinValue);
|
||||
@@ -323,7 +323,7 @@ public unsafe class NameplateHandler : IMediatorSubscriber
|
||||
continue;
|
||||
}
|
||||
|
||||
var local = _clientState.LocalPlayer;
|
||||
var local = _objectTable.LocalPlayer;
|
||||
if (!config.LightfinderLabelShowOwn && local != null &&
|
||||
objectInfo->GameObject->GetGameObjectId() == local.GameObjectId)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ public class NotificationService : DisposableMediatorSubscriberBase, IHostedServ
|
||||
private readonly INotificationManager _notificationManager;
|
||||
private readonly IChatGui _chatGui;
|
||||
private readonly PairRequestService _pairRequestService;
|
||||
private readonly HashSet<string> _shownPairRequestNotifications = new();
|
||||
private readonly HashSet<string> _shownPairRequestNotifications = [];
|
||||
private readonly PairUiService _pairUiService;
|
||||
private readonly PairFactory _pairFactory;
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Services.PairProcessing;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace LightlessSync.Services;
|
||||
namespace LightlessSync.Services.PairProcessing;
|
||||
|
||||
public sealed class PairProcessingLimiter : DisposableMediatorSubscriberBase
|
||||
{
|
||||
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using LightlessSync.API.Data;
|
||||
using LightlessSync.API.Data.Extensions;
|
||||
using LightlessSync.FileCache;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
|
||||
@@ -39,6 +39,7 @@ public class LightlessProfileManager : MediatorSubscriberBase
|
||||
Base64BannerPicture: _lightlessBanner,
|
||||
Description: _noUserDescription,
|
||||
Tags: _emptyTagSet);
|
||||
|
||||
private readonly LightlessUserProfileData _loadingProfileUserData = new(
|
||||
IsFlagged: false,
|
||||
IsNSFW: false,
|
||||
@@ -47,6 +48,7 @@ public class LightlessProfileManager : MediatorSubscriberBase
|
||||
Base64BannerPicture: _lightlessBanner,
|
||||
Description: _loadingData,
|
||||
Tags: _emptyTagSet);
|
||||
|
||||
private readonly LightlessGroupProfileData _loadingProfileGroupData = new(
|
||||
IsDisabled: false,
|
||||
IsNsfw: false,
|
||||
@@ -54,6 +56,7 @@ public class LightlessProfileManager : MediatorSubscriberBase
|
||||
Base64BannerPicture: _lightlessBanner,
|
||||
Description: _loadingData,
|
||||
Tags: _emptyTagSet);
|
||||
|
||||
private readonly LightlessGroupProfileData _defaultProfileGroupData = new(
|
||||
IsDisabled: false,
|
||||
IsNsfw: false,
|
||||
@@ -61,6 +64,7 @@ public class LightlessProfileManager : MediatorSubscriberBase
|
||||
Base64BannerPicture: _lightlessBanner,
|
||||
Description: _noGroupDescription,
|
||||
Tags: _emptyTagSet);
|
||||
|
||||
private readonly LightlessUserProfileData _nsfwProfileUserData = new(
|
||||
IsFlagged: false,
|
||||
IsNSFW: true,
|
||||
@@ -69,6 +73,7 @@ public class LightlessProfileManager : MediatorSubscriberBase
|
||||
Base64BannerPicture: string.Empty,
|
||||
Description: _nsfwDescription,
|
||||
Tags: _emptyTagSet);
|
||||
|
||||
private readonly LightlessGroupProfileData _nsfwProfileGroupData = new(
|
||||
IsDisabled: false,
|
||||
IsNsfw: true,
|
||||
@@ -76,6 +81,7 @@ public class LightlessProfileManager : MediatorSubscriberBase
|
||||
Base64BannerPicture: string.Empty,
|
||||
Description: _nsfwDescription,
|
||||
Tags: _emptyTagSet);
|
||||
|
||||
private const string _noDescription = "-- Profile has no description set --";
|
||||
private readonly ConcurrentDictionary<UserData, LightlessProfileData> _lightlessProfiles = new(UserDataComparer.Instance);
|
||||
private readonly LightlessProfileData _defaultProfileData = new(
|
||||
@@ -86,6 +92,7 @@ public class LightlessProfileManager : MediatorSubscriberBase
|
||||
Base64BannerPicture: _lightlessBanner,
|
||||
Description: _noDescription,
|
||||
Tags: _emptyTagSet);
|
||||
|
||||
private readonly LightlessProfileData _loadingProfileData = new(
|
||||
IsFlagged: false,
|
||||
IsNSFW: false,
|
||||
@@ -94,6 +101,7 @@ public class LightlessProfileManager : MediatorSubscriberBase
|
||||
Base64BannerPicture: _lightlessBanner,
|
||||
Description: _loadingData,
|
||||
Tags: _emptyTagSet);
|
||||
|
||||
private readonly LightlessProfileData _nsfwProfileData = new(
|
||||
IsFlagged: false,
|
||||
IsNSFW: false,
|
||||
Reference in New Issue
Block a user