using System; using System.IO; using System.Threading; using System.Threading.Tasks; using Luski.net.Enums; using Luski.Shared.PublicServers.V1.Enums; namespace Luski.net.Structures.Public; public class ServerProfile { public PublicServer Server { get; init; } = default!; public long ID { get; init; } = default!; public string DisplayName { get; init; } = default!; public PictureType? PictureType { get; init; } = default!; public long[] Controllers { get; internal set; } = default!; public long[] RoleControllers { get; internal set; } = default!; internal ColorType? ColorType { get; set; } = default!; internal Color[]? Color { get; set; } = default!; public Task GetColors() { return Task.FromResult(Color); } public Task GetColorType() { return Task.FromResult(ColorType); } public async Task GetAvatar(CancellationToken CancellationToken) { bool isc = System.IO.File.Exists(Server.Storage.GetStorageDirectory(StorageDirectory.ProfileAvatars) + ID.ToString()); if (!isc) await Server.GetFromServer($"socketprofile/Avatar/{ID}", Server.Storage.GetStorageDirectory(StorageDirectory.ProfileAvatars) + ID.ToString(), CancellationToken); return Server.Storage.GetResourceStream(StorageDirectory.ProfileAvatars, ID.ToString()); } public Task GetUserKeys(CancellationToken CancellationToken) { throw new NotImplementedException(); } }