2.0.0 (#92)
All checks were successful
Tag and Release Lightless / tag-and-release (push) Successful in 2m27s
All checks were successful
Tag and Release Lightless / tag-and-release (push) Successful in 2m27s
2.0.0 Changes: - Reworked shell finder UI with compact or list view with profile tags showing with the listing, allowing moderators to broadcast the syncshell as well to have it be used more. - Reworked user list in syncshell admin screen to have filter visible and moved away from table to its own thing, allowing to copy uid/note/alias when clicking on the name. - Reworked download bars and download box to make it look more modern, removed the jitter around, so it shouldn't vibrate around much. - Chat has been added to the top menu, working in Zone or in Syncshells to be used there. - Paired system has been revamped to make pausing and unpausing faster, and loading people should be faster as well. - Moved to the internal object table to have faster load times for users; people should load in faster - Compactor is running on a multi-threaded level instead of single-threaded; this should increase the speed of compacting files - Nameplate Service has been reworked so it wouldn't use the nameplate handler anymore. - Files can be resized when downloading to reduce load on users if they aren't compressed. (can be toggled to resize all). - Penumbra Collections are now only made when people are visible, reducing the load on boot-up when having many syncshells in your list. - Lightfinder plates have been moved away from using Nameplates, but will use an overlay. - Main UI has been changed a bit with a gradient, and on hover will glow up now. - Reworked Profile UI for Syncshell and Users to be more user-facing with more customizable items. - Reworked Settings UI to look more modern. - Performance should be better due to new systems that would dispose of the collections and better caching of items. Co-authored-by: defnotken <itsdefnotken@gmail.com> Co-authored-by: azyges <aaaaaa@aaa.aaa> Co-authored-by: choco <choco@patat.nl> Co-authored-by: cake <admin@cakeandbanana.nl> Co-authored-by: Minmoose <KennethBohr@outlook.com> Reviewed-on: #92
This commit was merged in pull request #92.
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
using LightlessSync.API.Dto.Group;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using LightlessSync.API.Data.Extensions;
|
||||
using LightlessSync.API.Dto.Group;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.PlayerData.Factories;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
using LightlessSync.Services;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Services.ServerConfiguration;
|
||||
using LightlessSync.UI.Components;
|
||||
using LightlessSync.UI.Handlers;
|
||||
using LightlessSync.UI.Models;
|
||||
using LightlessSync.WebAPI;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Collections.Immutable;
|
||||
|
||||
namespace LightlessSync.UI;
|
||||
|
||||
@@ -19,6 +26,7 @@ public class DrawEntityFactory
|
||||
private readonly LightlessMediator _mediator;
|
||||
private readonly SelectPairForTagUi _selectPairForTagUi;
|
||||
private readonly ServerConfigurationManager _serverConfigurationManager;
|
||||
private readonly LightlessConfigService _configService;
|
||||
private readonly UiSharedService _uiSharedService;
|
||||
private readonly PlayerPerformanceConfigService _playerPerformanceConfigService;
|
||||
private readonly CharaDataManager _charaDataManager;
|
||||
@@ -29,13 +37,28 @@ public class DrawEntityFactory
|
||||
private readonly SelectSyncshellForTagUi _selectSyncshellForTagUi;
|
||||
private readonly TagHandler _tagHandler;
|
||||
private readonly IdDisplayHandler _uidDisplayHandler;
|
||||
private readonly PairLedger _pairLedger;
|
||||
private readonly PairFactory _pairFactory;
|
||||
|
||||
public DrawEntityFactory(ILogger<DrawEntityFactory> logger, ApiController apiController, IdDisplayHandler uidDisplayHandler,
|
||||
SelectTagForPairUi selectTagForPairUi, RenamePairTagUi renamePairTagUi, LightlessMediator mediator,
|
||||
TagHandler tagHandler, SelectPairForTagUi selectPairForTagUi,
|
||||
ServerConfigurationManager serverConfigurationManager, UiSharedService uiSharedService,
|
||||
PlayerPerformanceConfigService playerPerformanceConfigService, CharaDataManager charaDataManager,
|
||||
SelectTagForSyncshellUi selectTagForSyncshellUi, RenameSyncshellTagUi renameSyncshellTagUi, SelectSyncshellForTagUi selectSyncshellForTagUi)
|
||||
public DrawEntityFactory(
|
||||
ILogger<DrawEntityFactory> logger,
|
||||
ApiController apiController,
|
||||
IdDisplayHandler uidDisplayHandler,
|
||||
SelectTagForPairUi selectTagForPairUi,
|
||||
RenamePairTagUi renamePairTagUi,
|
||||
LightlessMediator mediator,
|
||||
TagHandler tagHandler,
|
||||
SelectPairForTagUi selectPairForTagUi,
|
||||
ServerConfigurationManager serverConfigurationManager,
|
||||
LightlessConfigService configService,
|
||||
UiSharedService uiSharedService,
|
||||
PlayerPerformanceConfigService playerPerformanceConfigService,
|
||||
CharaDataManager charaDataManager,
|
||||
SelectTagForSyncshellUi selectTagForSyncshellUi,
|
||||
RenameSyncshellTagUi renameSyncshellTagUi,
|
||||
SelectSyncshellForTagUi selectSyncshellForTagUi,
|
||||
PairLedger pairLedger,
|
||||
PairFactory pairFactory)
|
||||
{
|
||||
_logger = logger;
|
||||
_apiController = apiController;
|
||||
@@ -46,44 +69,152 @@ public class DrawEntityFactory
|
||||
_tagHandler = tagHandler;
|
||||
_selectPairForTagUi = selectPairForTagUi;
|
||||
_serverConfigurationManager = serverConfigurationManager;
|
||||
_configService = configService;
|
||||
_uiSharedService = uiSharedService;
|
||||
_playerPerformanceConfigService = playerPerformanceConfigService;
|
||||
_charaDataManager = charaDataManager;
|
||||
_selectTagForSyncshellUi = selectTagForSyncshellUi;
|
||||
_renameSyncshellTagUi = renameSyncshellTagUi;
|
||||
_selectSyncshellForTagUi = selectSyncshellForTagUi;
|
||||
_pairLedger = pairLedger;
|
||||
_pairFactory = pairFactory;
|
||||
}
|
||||
|
||||
public DrawFolderGroup CreateDrawGroupFolder(GroupFullInfoDto groupFullInfoDto,
|
||||
Dictionary<Pair, List<GroupFullInfoDto>> filteredPairs,
|
||||
IImmutableList<Pair> allPairs)
|
||||
public DrawFolderGroup CreateGroupFolder(
|
||||
string id,
|
||||
GroupFullInfoDto groupFullInfo,
|
||||
IEnumerable<PairUiEntry> drawEntries,
|
||||
IEnumerable<PairUiEntry> allEntries)
|
||||
{
|
||||
return new DrawFolderGroup(groupFullInfoDto.Group.GID, groupFullInfoDto, _apiController,
|
||||
filteredPairs.Select(p => CreateDrawPair(groupFullInfoDto.Group.GID + p.Key.UserData.UID, p.Key, p.Value, groupFullInfoDto)).ToImmutableList(),
|
||||
allPairs, _tagHandler, _uidDisplayHandler, _mediator, _uiSharedService, _selectTagForSyncshellUi);
|
||||
var drawPairs = drawEntries
|
||||
.Select(entry => CreateDrawPair($"{id}:{entry.DisplayEntry.Ident.UserId}", entry, groupFullInfo))
|
||||
.Where(draw => draw is not null)
|
||||
.Cast<DrawUserPair>()
|
||||
.ToImmutableList();
|
||||
|
||||
var allPairs = allEntries.ToImmutableList();
|
||||
|
||||
return new DrawFolderGroup(
|
||||
id,
|
||||
groupFullInfo,
|
||||
_apiController,
|
||||
drawPairs,
|
||||
allPairs,
|
||||
_tagHandler,
|
||||
_uidDisplayHandler,
|
||||
_mediator,
|
||||
_uiSharedService,
|
||||
_selectTagForSyncshellUi);
|
||||
}
|
||||
|
||||
public DrawFolderGroup CreateDrawGroupFolder(string id, GroupFullInfoDto groupFullInfoDto,
|
||||
Dictionary<Pair, List<GroupFullInfoDto>> filteredPairs,
|
||||
IImmutableList<Pair> allPairs)
|
||||
public DrawFolderTag CreateTagFolder(
|
||||
string tag,
|
||||
IEnumerable<PairUiEntry> drawEntries,
|
||||
IEnumerable<PairUiEntry> allEntries)
|
||||
{
|
||||
return new DrawFolderGroup(id, groupFullInfoDto, _apiController,
|
||||
filteredPairs.Select(p => CreateDrawPair(groupFullInfoDto.Group.GID + p.Key.UserData.UID, p.Key, p.Value, groupFullInfoDto)).ToImmutableList(),
|
||||
allPairs, _tagHandler, _uidDisplayHandler, _mediator, _uiSharedService, _selectTagForSyncshellUi);
|
||||
var drawPairs = drawEntries
|
||||
.Select(entry => CreateDrawPair($"{tag}:{entry.DisplayEntry.Ident.UserId}", entry))
|
||||
.Where(draw => draw is not null)
|
||||
.Cast<DrawUserPair>()
|
||||
.ToImmutableList();
|
||||
|
||||
var allPairs = allEntries.ToImmutableList();
|
||||
|
||||
return new DrawFolderTag(
|
||||
tag,
|
||||
drawPairs,
|
||||
allPairs,
|
||||
_tagHandler,
|
||||
_apiController,
|
||||
_selectPairForTagUi,
|
||||
_renamePairTagUi,
|
||||
_uiSharedService,
|
||||
_serverConfigurationManager,
|
||||
_configService,
|
||||
_mediator);
|
||||
}
|
||||
|
||||
public DrawFolderTag CreateDrawTagFolder(string tag,
|
||||
Dictionary<Pair, List<GroupFullInfoDto>> filteredPairs,
|
||||
IImmutableList<Pair> allPairs)
|
||||
public DrawUserPair? CreateDrawPair(
|
||||
string id,
|
||||
PairUiEntry entry,
|
||||
GroupFullInfoDto? currentGroup = null)
|
||||
{
|
||||
return new(tag, filteredPairs.Select(u => CreateDrawPair(tag, u.Key, u.Value, currentGroup: null)).ToImmutableList(),
|
||||
allPairs, _tagHandler, _apiController, _selectPairForTagUi, _renamePairTagUi, _uiSharedService);
|
||||
var pair = _pairFactory.Create(entry.DisplayEntry);
|
||||
if (pair is null)
|
||||
{
|
||||
if (_logger.IsEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.LogDebug("Skipping draw pair for {UserId}: legacy pair not found.", entry.DisplayEntry.Ident.UserId);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
return new DrawUserPair(
|
||||
id,
|
||||
entry,
|
||||
pair,
|
||||
currentGroup,
|
||||
_apiController,
|
||||
_uidDisplayHandler,
|
||||
_mediator,
|
||||
_selectTagForPairUi,
|
||||
_serverConfigurationManager,
|
||||
_uiSharedService,
|
||||
_playerPerformanceConfigService,
|
||||
_configService,
|
||||
_charaDataManager,
|
||||
_pairLedger);
|
||||
}
|
||||
|
||||
public DrawUserPair CreateDrawPair(string id, Pair user, List<GroupFullInfoDto> groups, GroupFullInfoDto? currentGroup)
|
||||
public IReadOnlyList<PairUiEntry> GetAllEntries()
|
||||
{
|
||||
return new DrawUserPair(id + user.UserData.UID, user, groups, currentGroup, _apiController, _uidDisplayHandler,
|
||||
_mediator, _selectTagForPairUi, _serverConfigurationManager, _uiSharedService, _playerPerformanceConfigService,
|
||||
_charaDataManager);
|
||||
try
|
||||
{
|
||||
return _pairLedger.GetAllEntries()
|
||||
.Select(BuildUiEntry)
|
||||
.ToList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Failed to build pair display entries.");
|
||||
return Array.Empty<PairUiEntry>();
|
||||
}
|
||||
}
|
||||
|
||||
private PairUiEntry BuildUiEntry(PairDisplayEntry entry)
|
||||
{
|
||||
var handler = entry.Handler;
|
||||
var alias = entry.User.AliasOrUID;
|
||||
if (string.IsNullOrWhiteSpace(alias))
|
||||
{
|
||||
alias = entry.Ident.UserId;
|
||||
}
|
||||
|
||||
var displayName = !string.IsNullOrWhiteSpace(handler?.PlayerName)
|
||||
? handler!.PlayerName!
|
||||
: alias;
|
||||
|
||||
var note = _serverConfigurationManager.GetNoteForUid(entry.Ident.UserId) ?? string.Empty;
|
||||
var isPaused = entry.SelfPermissions.IsPaused();
|
||||
|
||||
return new PairUiEntry(
|
||||
entry,
|
||||
alias,
|
||||
displayName,
|
||||
note,
|
||||
entry.IsVisible,
|
||||
entry.IsOnline,
|
||||
entry.IsDirectlyPaired,
|
||||
entry.IsOneSided,
|
||||
entry.HasAnyConnection,
|
||||
isPaused,
|
||||
entry.SelfPermissions,
|
||||
entry.OtherPermissions,
|
||||
entry.PairStatus,
|
||||
handler?.LastAppliedDataBytes ?? -1,
|
||||
handler?.LastAppliedDataTris ?? -1,
|
||||
handler?.LastAppliedApproximateVRAMBytes ?? -1,
|
||||
handler?.LastAppliedApproximateEffectiveVRAMBytes ?? -1,
|
||||
handler);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user