Luski.Net/Luski.net/Structures/Public/ServerProfile.cs

42 lines
1.5 KiB
C#

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<Color[]?> GetColors()
{
return Task.FromResult(Color);
}
public Task<ColorType?> GetColorType()
{
return Task.FromResult(ColorType);
}
public async Task<Stream> 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<PublicKeyInfo[]> GetUserKeys(CancellationToken CancellationToken)
{
throw new NotImplementedException();
}
}