Add project files.

This commit is contained in:
Zura
2025-08-21 21:38:57 +02:00
parent 54ede2292c
commit dd2e9bf7d1
193 changed files with 32957 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
using MareSynchronos.MareConfiguration.Models;
namespace MareSynchronos.MareConfiguration.Configurations;
public class CharaDataConfig : IMareConfiguration
{
public bool OpenMareHubOnGposeStart { get; set; } = false;
public string LastSavedCharaDataLocation { get; set; } = string.Empty;
public Dictionary<string, CharaDataFavorite> FavoriteCodes { get; set; } = [];
public bool DownloadMcdDataOnConnection { get; set; } = true;
public int Version { get; set; } = 0;
public bool NearbyOwnServerOnly { get; set; } = false;
public bool NearbyIgnoreHousingLimitations { get; set; } = false;
public bool NearbyDrawWisps { get; set; } = true;
public int NearbyDistanceFilter { get; set; } = 100;
public bool NearbyShowOwnData { get; set; } = false;
public bool ShowHelpTexts { get; set; } = true;
public bool NearbyShowAlways { get; set; } = false;
}

View File

@@ -0,0 +1,6 @@
namespace MareSynchronos.MareConfiguration.Configurations;
public interface IMareConfiguration
{
int Version { get; set; }
}

View File

@@ -0,0 +1,63 @@
using MareSynchronos.MareConfiguration.Models;
using MareSynchronos.UI;
using Microsoft.Extensions.Logging;
namespace MareSynchronos.MareConfiguration.Configurations;
[Serializable]
public class MareConfig : IMareConfiguration
{
public bool AcceptedAgreement { get; set; } = false;
public string CacheFolder { get; set; } = string.Empty;
public bool DisableOptionalPluginWarnings { get; set; } = false;
public bool EnableDtrEntry { get; set; } = false;
public bool ShowUidInDtrTooltip { get; set; } = true;
public bool PreferNoteInDtrTooltip { get; set; } = false;
public bool UseColorsInDtr { get; set; } = true;
public DtrEntry.Colors DtrColorsDefault { get; set; } = default;
public DtrEntry.Colors DtrColorsNotConnected { get; set; } = new(Glow: 0x0428FFu);
public DtrEntry.Colors DtrColorsPairsInRange { get; set; } = new(Glow: 0xFFBA47u);
public bool EnableRightClickMenus { get; set; } = true;
public NotificationLocation ErrorNotification { get; set; } = NotificationLocation.Both;
public string ExportFolder { get; set; } = string.Empty;
public bool FileScanPaused { get; set; } = false;
public NotificationLocation InfoNotification { get; set; } = NotificationLocation.Toast;
public bool InitialScanComplete { get; set; } = false;
public LogLevel LogLevel { get; set; } = LogLevel.Information;
public bool LogPerformance { get; set; } = false;
public double MaxLocalCacheInGiB { get; set; } = 20;
public bool OpenGposeImportOnGposeStart { get; set; } = false;
public bool OpenPopupOnAdd { get; set; } = true;
public int ParallelDownloads { get; set; } = 10;
public int DownloadSpeedLimitInBytes { get; set; } = 0;
public DownloadSpeeds DownloadSpeedType { get; set; } = DownloadSpeeds.MBps;
public bool PreferNotesOverNamesForVisible { get; set; } = false;
public float ProfileDelay { get; set; } = 1.5f;
public bool ProfilePopoutRight { get; set; } = false;
public bool ProfilesAllowNsfw { get; set; } = false;
public bool ProfilesShow { get; set; } = true;
public bool ShowSyncshellUsersInVisible { get; set; } = true;
public bool ShowCharacterNameInsteadOfNotesForVisible { get; set; } = false;
public bool ShowOfflineUsersSeparately { get; set; } = true;
public bool ShowSyncshellOfflineUsersSeparately { get; set; } = true;
public bool GroupUpSyncshells { get; set; } = true;
public bool ShowOnlineNotifications { get; set; } = false;
public bool ShowOnlineNotificationsOnlyForIndividualPairs { get; set; } = true;
public bool ShowOnlineNotificationsOnlyForNamedPairs { get; set; } = false;
public bool ShowTransferBars { get; set; } = true;
public bool ShowTransferWindow { get; set; } = false;
public bool ShowUploading { get; set; } = true;
public bool ShowUploadingBigText { get; set; } = true;
public bool ShowVisibleUsersSeparately { get; set; } = true;
public int TimeSpanBetweenScansInSeconds { get; set; } = 30;
public int TransferBarsHeight { get; set; } = 12;
public bool TransferBarsShowText { get; set; } = true;
public int TransferBarsWidth { get; set; } = 250;
public bool UseAlternativeFileUpload { get; set; } = false;
public bool UseCompactor { get; set; } = false;
public bool DebugStopWhining { get; set; } = false;
public bool AutoPopulateEmptyNotesFromCharaName { get; set; } = false;
public int Version { get; set; } = 1;
public NotificationLocation WarningNotification { get; set; } = NotificationLocation.Both;
public bool UseFocusTarget { get; set; } = false;
}

View File

@@ -0,0 +1,16 @@
namespace MareSynchronos.MareConfiguration.Configurations;
public class PlayerPerformanceConfig : IMareConfiguration
{
public int Version { get; set; } = 1;
public bool ShowPerformanceIndicator { get; set; } = true;
public bool WarnOnExceedingThresholds { get; set; } = true;
public bool WarnOnPreferredPermissionsExceedingThresholds { get; set; } = false;
public int VRAMSizeWarningThresholdMiB { get; set; } = 375;
public int TrisWarningThresholdThousands { get; set; } = 165;
public bool AutoPausePlayersExceedingThresholds { get; set; } = false;
public bool AutoPausePlayersWithPreferredPermissionsExceedingThresholds { get; set; } = false;
public int VRAMSizeAutoPauseThresholdMiB { get; set; } = 550;
public int TrisAutoPauseThresholdThousands { get; set; } = 250;
public List<string> UIDsToIgnore { get; set; } = new();
}

View File

@@ -0,0 +1,20 @@
using MareSynchronos.MareConfiguration.Models;
using MareSynchronos.WebAPI;
namespace MareSynchronos.MareConfiguration.Configurations;
[Serializable]
public class ServerConfig : IMareConfiguration
{
public int CurrentServer { get; set; } = 0;
public List<ServerStorage> ServerStorage { get; set; } = new()
{
{ new ServerStorage() { ServerName = ApiController.MainServer, ServerUri = ApiController.MainServiceUri, UseOAuth2 = true } },
};
public bool SendCensusData { get; set; } = false;
public bool ShownCensusPopup { get; set; } = false;
public int Version { get; set; } = 2;
}

View File

@@ -0,0 +1,9 @@
using MareSynchronos.MareConfiguration.Models;
namespace MareSynchronos.MareConfiguration.Configurations;
public class ServerTagConfig : IMareConfiguration
{
public Dictionary<string, ServerTagStorage> ServerTagStorage { get; set; } = new(StringComparer.OrdinalIgnoreCase);
public int Version { get; set; } = 0;
}

View File

@@ -0,0 +1,84 @@
using MareSynchronos.API.Data.Enum;
namespace MareSynchronos.MareConfiguration.Configurations;
public class TransientConfig : IMareConfiguration
{
public Dictionary<string, TransientPlayerConfig> TransientConfigs { get; set; } = [];
public int Version { get; set; } = 1;
public class TransientPlayerConfig
{
public List<string> GlobalPersistentCache { get; set; } = [];
public Dictionary<uint, List<string>> JobSpecificCache { get; set; } = [];
public Dictionary<uint, List<string>> JobSpecificPetCache { get; set; } = [];
public TransientPlayerConfig()
{
}
private bool ElevateIfNeeded(uint jobId, string gamePath)
{
// check if it's in the job cache of other jobs and elevate if needed
foreach (var kvp in JobSpecificCache)
{
if (kvp.Key == jobId) continue;
// elevate if the gamepath is included somewhere else
if (kvp.Value.Contains(gamePath, StringComparer.Ordinal))
{
JobSpecificCache[kvp.Key].Remove(gamePath);
GlobalPersistentCache.Add(gamePath);
return true;
}
}
return false;
}
public int RemovePath(string gamePath, ObjectKind objectKind)
{
int removedEntries = 0;
if (objectKind == ObjectKind.Player)
{
if (GlobalPersistentCache.Remove(gamePath)) removedEntries++;
foreach (var kvp in JobSpecificCache)
{
if (kvp.Value.Remove(gamePath)) removedEntries++;
}
}
if (objectKind == ObjectKind.Pet)
{
foreach (var kvp in JobSpecificPetCache)
{
if (kvp.Value.Remove(gamePath)) removedEntries++;
}
}
return removedEntries;
}
public void AddOrElevate(uint jobId, string gamePath)
{
// check if it's in the global cache, if yes, do nothing
if (GlobalPersistentCache.Contains(gamePath, StringComparer.Ordinal))
{
return;
}
if (ElevateIfNeeded(jobId, gamePath)) return;
// check if the jobid is already in the cache to start
if (!JobSpecificCache.TryGetValue(jobId, out var jobCache))
{
JobSpecificCache[jobId] = jobCache = new();
}
// check if the path is already in the job specific cache
if (!jobCache.Contains(gamePath, StringComparer.Ordinal))
{
jobCache.Add(gamePath);
}
}
}
}

View File

@@ -0,0 +1,9 @@
using MareSynchronos.MareConfiguration.Models;
namespace MareSynchronos.MareConfiguration.Configurations;
public class UidNotesConfig : IMareConfiguration
{
public Dictionary<string, ServerNotesStorage> ServerNotes { get; set; } = new(StringComparer.Ordinal);
public int Version { get; set; } = 0;
}

View File

@@ -0,0 +1,10 @@
using System.Collections.Concurrent;
namespace MareSynchronos.MareConfiguration.Configurations;
public class XivDataStorageConfig : IMareConfiguration
{
public ConcurrentDictionary<string, long> TriangleDictionary { get; set; } = new(StringComparer.OrdinalIgnoreCase);
public ConcurrentDictionary<string, Dictionary<string, List<ushort>>> BonesDictionary { get; set; } = new(StringComparer.OrdinalIgnoreCase);
public int Version { get; set; } = 0;
}