Luski.Net/Luski.net/Structures/Public/ServerProfile.cs
2024-11-18 23:24:23 -05:00

30 lines
1.2 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!;
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();
}
}