2024-08-07 18:48:13 -05:00
|
|
|
|
using LANCommander.Launcher.Models.Enums;
|
2025-01-12 02:54:41 -06:00
|
|
|
|
using LANCommander.SDK.Enums;
|
2024-07-12 18:22:17 -05:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
2024-09-11 00:24:34 -05:00
|
|
|
|
using Serilog;
|
2024-05-09 20:44:40 -05:00
|
|
|
|
|
2024-08-04 17:53:19 -05:00
|
|
|
|
namespace LANCommander.Launcher.Models
|
2024-05-09 20:44:40 -05:00
|
|
|
|
{
|
|
|
|
|
|
public class Settings
|
|
|
|
|
|
{
|
2025-05-13 00:17:14 +02:00
|
|
|
|
public const string DEFAULT_GAME_USERNAME = "Player";
|
|
|
|
|
|
|
2024-07-28 18:32:45 -05:00
|
|
|
|
public int LaunchCount { get; set; } = 0;
|
|
|
|
|
|
|
2024-05-20 19:42:31 -05:00
|
|
|
|
public DatabaseSettings Database { get; set; } = new DatabaseSettings();
|
2024-05-09 20:44:40 -05:00
|
|
|
|
public AuthenticationSettings Authentication { get; set; } = new AuthenticationSettings();
|
|
|
|
|
|
public GameSettings Games { get; set; } = new GameSettings();
|
2024-05-28 00:24:29 -05:00
|
|
|
|
public MediaSettings Media { get; set; } = new MediaSettings();
|
2024-07-12 18:22:17 -05:00
|
|
|
|
public FilterSettings Filter { get; set; } = new FilterSettings();
|
2024-06-11 21:43:12 -05:00
|
|
|
|
public DebugSettings Debug { get; set; } = new DebugSettings();
|
2024-07-25 19:21:52 -05:00
|
|
|
|
public UpdateSettings Updates { get; set; } = new UpdateSettings();
|
2024-09-17 19:48:23 -05:00
|
|
|
|
public WindowSettings Window { get; set; } = new WindowSettings();
|
2024-05-09 20:44:40 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-20 19:42:31 -05:00
|
|
|
|
public class DatabaseSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
public string ConnectionString { get; set; } = "Data Source=LANCommander.db;Cache=Shared";
|
2024-07-25 19:21:52 -05:00
|
|
|
|
public string BackupsPath { get; set; } = "Backups";
|
2024-05-20 19:42:31 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-09 20:44:40 -05:00
|
|
|
|
public class AuthenticationSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
public string ServerAddress { get; set; } = "";
|
|
|
|
|
|
public string AccessToken { get; set; } = "";
|
|
|
|
|
|
public string RefreshToken { get; set; } = "";
|
2024-07-15 17:26:24 -05:00
|
|
|
|
public bool OfflineMode { get; set; } = false;
|
2024-05-09 20:44:40 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class GameSettings
|
|
|
|
|
|
{
|
2024-09-12 19:09:13 -05:00
|
|
|
|
public string[] InstallDirectories { get; set; } = new string[] { };
|
|
|
|
|
|
|
2024-07-12 18:22:17 -05:00
|
|
|
|
public Guid? LastSelected { get; set; } = null;
|
2024-05-09 20:44:40 -05:00
|
|
|
|
}
|
2024-05-28 00:24:29 -05:00
|
|
|
|
|
|
|
|
|
|
public class MediaSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
public string StoragePath { get; set; } = "Media";
|
|
|
|
|
|
}
|
2024-05-29 19:25:41 -05:00
|
|
|
|
|
2024-07-12 18:22:17 -05:00
|
|
|
|
public class FilterSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
public string? Title { get; set; }
|
|
|
|
|
|
public GroupBy GroupBy { get; set; } = GroupBy.Collection;
|
2024-10-30 18:53:05 -05:00
|
|
|
|
public SortBy SortBy { get; set; } = SortBy.Title;
|
|
|
|
|
|
public SortDirection SortDirection { get; set; } = SortDirection.Ascending;
|
2024-07-12 18:22:17 -05:00
|
|
|
|
public IEnumerable<string> Engines { get; set; }
|
|
|
|
|
|
public IEnumerable<string> Genres { get; set; }
|
|
|
|
|
|
public IEnumerable<string> Tags { get; set; }
|
2024-07-12 22:24:15 -05:00
|
|
|
|
public IEnumerable<string> Platforms { get; set; }
|
2024-07-12 18:22:17 -05:00
|
|
|
|
public IEnumerable<string> Developers { get; set; }
|
|
|
|
|
|
public IEnumerable<string> Publishers { get; set; }
|
|
|
|
|
|
public int? MinPlayers { get; set; }
|
|
|
|
|
|
public int? MaxPlayers { get; set; }
|
|
|
|
|
|
public bool Installed { get; set; } = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-06-11 21:43:12 -05:00
|
|
|
|
public class DebugSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
public bool EnableScriptDebugging { get; set; } = false;
|
|
|
|
|
|
public LogLevel LoggingLevel { get; set; } = LogLevel.Warning;
|
|
|
|
|
|
public string LoggingPath { get; set; } = "Logs";
|
2024-09-11 00:24:34 -05:00
|
|
|
|
public RollingInterval LoggingArchivePeriod { get; set; } = RollingInterval.Day;
|
2024-07-16 00:18:41 -05:00
|
|
|
|
public int MaxArchiveFiles { get; set; } = 10;
|
2024-06-11 21:43:12 -05:00
|
|
|
|
}
|
2024-07-25 19:21:52 -05:00
|
|
|
|
|
|
|
|
|
|
public class UpdateSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
public string StoragePath { get; set; } = "Updates";
|
|
|
|
|
|
}
|
2024-09-17 19:48:23 -05:00
|
|
|
|
|
|
|
|
|
|
public class WindowSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
public bool Maximized { get; set; } = false;
|
|
|
|
|
|
public int Width { get; set; } = 1024;
|
|
|
|
|
|
public int Height { get; set; } = 768;
|
|
|
|
|
|
public int X { get; set; } = 0;
|
|
|
|
|
|
public int Y { get; set; } = 0;
|
|
|
|
|
|
}
|
2024-05-09 20:44:40 -05:00
|
|
|
|
}
|